Skip to content
Browse files

clean up determination of PASS, FAIL for a given test

add new jsps for different results reporting so that tests do not need to be called in particular order

Change-Id: Ia06912e16a9b4ce542171ee2d83ddbf24ec84271
  • Loading branch information...
1 parent 927e422 commit 17a808262547d5da6ad4c79bc37ddaee0b836476 @ejohansen ejohansen committed Dec 20, 2011
View
4 spring/app-spring-dbeater/src/main/java/org/cloudfoundry/s2qa/HomeController.java
@@ -85,7 +85,7 @@ public String newtables(Model model) {
model.addAttribute("dbInfo", referenceRepository.getDbInfo());
model.addAttribute("itemExists", referenceRepository.addNewItemCategories());
model.addAttribute("allTables", referenceRepository.findAllTables());
- return "dbtablelist";
+ return "dbadditionaltablelist";
}
@RequestMapping(value = "/addtaxtable", method = RequestMethod.GET)
@@ -94,7 +94,7 @@ public String newtaxes(Model model) {
model.addAttribute("dbInfo", referenceRepository.getDbInfo());
model.addAttribute("itemExists", referenceRepository.addTaxTable());
model.addAttribute("allTables", referenceRepository.findAllTables());
- return "dbtablelist";
+ return "dbtaxtablelist";
}
@RequestMapping(value = "/differentview", method = RequestMethod.GET)
View
3 spring/app-spring-dbeater/src/main/java/org/cloudfoundry/s2qa/ReferenceDataRepository.java
@@ -50,6 +50,7 @@ public boolean setupInitTestDBTable() {
String vendor = getDBVendor();
//make sure we are starting from scratch...
this.jdbcTemplate.execute("drop table if exists current_items");
+ this.jdbcTemplate.execute("drop table if exists item_taxes");
if (vendor.equalsIgnoreCase("mysql")) {
this.jdbcTemplate.execute("create table current_items (id INT(3) PRIMARY KEY AUTO_INCREMENT, item_code char(2), name varchar(1024))");
@@ -115,7 +116,7 @@ public boolean dropItemsTable() {
}
public int removeItems() {
- this.jdbcTemplate.update("delete from current_items where id > 10000");
+ this.jdbcTemplate.update("delete from current_items where id > 5000");
int slimmerRowCount = this.jdbcTemplate.queryForInt("select count(*) from current_items");
return slimmerRowCount;
}
View
33 spring/app-spring-dbeater/src/main/webapp/WEB-INF/views/dbadditionaltablelist.jsp
@@ -0,0 +1,33 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+<%@ page session="false" %>
+<html>
+<head>
+ <title>Database tables may have been Modified!</title>
+</head>
+<body>
+ <h1>Database tables may have been Modified!!</h1>
+
+ <h4>Database Info:</h4>
+ DataSource: <c:out value="${dbInfo}"/></br>
+
+ <h4>Could we modify db tables?</h4>
+ <p>
+ <c:out value="${itemExists}"/></br>
+ </p>
+
+ <c:if test="${not empty allTables}">
+ <p>
+ <c:forEach var="table" items="${allTables}">
+ <c:if test="${fn:contains(table,'other_categories_')}">
+ <p>PASS: other_categories table(s) found. </p>
+ </c:if>
+ <c:out value="${table}"/></br>
+ </c:forEach>
+ </p>
+ </c:if>
+ <c:if test="${empty allTables}">
+ <p>FAIL: No Tables found</p>
+ </c:if>
+</body>
+</html>
View
17 spring/app-spring-dbeater/src/main/webapp/WEB-INF/views/dbslimmer.jsp
@@ -16,24 +16,15 @@
</p>
<h4>New Slimmer ItemCount:</h4>
- <p>
- <c:out value="${slimmerItemCount}"/></br>
- </p>
- <c:if test="${empty slimmerItemCount}">
- <p>No Items found</p>
- </c:if>
<c:if test="${empty updatedItemCount}">
<p>No Items found</p>
</c:if>
- <c:if test="${updatedItemCount <= previousItemCount}">
- <p>FAIL: Expected new current_items count to be greater than previous current_items count</p>
+ <c:if test="${updatedItemCount > previousItemCount}">
+ <p>FAIL: Expected new current_items count to be lesser than previous current_items count</p>
<c:out value="${updatedItemCount}"/></br>
</c:if>
- <c:if test="${empty updatedItemCount}">
- <p>FAIL: No Current Items found</p>
- </c:if>
- <c:if test="${updatedItemCount >= previousItemCount}">
- <p>PASS: found new entries in current_items table</p>
+ <c:if test="${updatedItemCount <= previousItemCount}">
+ <p>PASS: found fewer or equal number of items in current_items table</p>
<c:out value="${updatedItemCount}"/></br>
</c:if>
</body>
View
16 spring/app-spring-dbeater/src/main/webapp/WEB-INF/views/dbtablelist.jsp
@@ -18,23 +18,15 @@
<c:if test="${not empty allTables}">
<p>
<c:forEach var="table" items="${allTables}">
+ <c:if test="${table == 'current_items'}">
+ <p>PASS: current_item table found. </p>
+ </c:if>
<c:out value="${table}"/></br>
</c:forEach>
</p>
</c:if>
<c:if test="${empty allTables}">
- <p>No Tables found</p>
- </c:if>
- <c:if test="${updatedItemCount <= previousItemCount}">
- <p>FAIL: Expected new current_items count to be greater than previous current_items count</p>
- <c:out value="${updatedItemCount}"/></br>
- </c:if>
- <c:if test="${empty updatedItemCount}">
- <p>FAIL: No Current Items found</p>
- </c:if>
- <c:if test="${updatedItemCount >= previousItemCount}">
- <p>PASS: found new entries in current_items table</p>
- <c:out value="${updatedItemCount}"/></br>
+ <p>FAIL: No Tables found</p>
</c:if>
</body>
</html>
View
3 spring/app-spring-dbeater/src/main/webapp/WEB-INF/views/dbtally.jsp
@@ -14,6 +14,9 @@
<p>
<c:out value="${currentItemCount}"/></br>
</p>
+ <c:if test="${not empty currentItemCount}">
+ <p>PASS: ${currentItemCount} items found</p>
+ </c:if>
<c:if test="${empty currentItemCount}">
<p>No Items found</p>
</c:if>
View
32 spring/app-spring-dbeater/src/main/webapp/WEB-INF/views/dbtaxtablelist.jsp
@@ -0,0 +1,32 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ page session="false" %>
+<html>
+<head>
+ <title>Database tables may have been Modified!</title>
+</head>
+<body>
+ <h1>Database tables may have been Modified!!</h1>
+
+ <h4>Database Info:</h4>
+ DataSource: <c:out value="${dbInfo}"/></br>
+
+ <h4>Could we modify db tables?</h4>
+ <p>
+ <c:out value="${itemExists}"/></br>
+ </p>
+
+ <c:if test="${not empty allTables}">
+ <p>
+ <c:forEach var="table" items="${allTables}">
+ <c:if test="${table == 'item_taxes'}">
+ <p>PASS: item_taxes table found. </p>
+ </c:if>
+ <c:out value="${table}"/></br>
+ </c:forEach>
+ </p>
+ </c:if>
+ <c:if test="${empty allTables}">
+ <p>FAIL: No Tables found</p>
+ </c:if>
+</body>
+</html>
View
3 spring/app-spring-dbeater/src/main/webapp/WEB-INF/views/taxtally.jsp
@@ -17,9 +17,10 @@
<c:out value="${taxItem}"/></br>
</c:forEach>
</p>
+ <p>PASS: TaxItems found</p>
</c:if>
<c:if test="${empty taxItems}">
- <p>No TaxItems found</p>
+ <p>FAIL: No TaxItems found</p>
</c:if>
</body>
</html>

0 comments on commit 17a8082

Please sign in to comment.
Something went wrong with that request. Please try again.