You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by jm...@apache.org on 2003/03/07 06:28:51 UTC
cvs commit: jakarta-struts/web/test/test/org/apache/struts/taglib/html TestFileTag1.jsp TestFileTag2.jsp
jmitchell 2003/03/06 21:28:51
Modified: web/test/test/org/apache/struts/taglib/html TestFileTag1.jsp
TestFileTag2.jsp
Log:
fix to help better determine what errors are when tests fail.......but
we all know that's not going to happen ;D
Revision Changes Path
1.2 +13 -8 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestFileTag1.jsp
Index: TestFileTag1.jsp
===================================================================
RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestFileTag1.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestFileTag1.jsp 1 Mar 2003 06:00:13 -0000 1.1
+++ TestFileTag1.jsp 7 Mar 2003 05:28:51 -0000 1.2
@@ -13,9 +13,6 @@
</bean:define>
</logic:equal>
- enctype="multipart/form-data"
- accept="image/jpeg, image/gif"
-
<logic:equal name="runTest" value="testFilePropertyAccept">
<bean:define id="TEST_RESULTS" toScope="page">
<html:file property="string" accept="image/jpeg, image/gif"/>
@@ -242,10 +239,18 @@
</logic:equal>
-
<%
-Assert.assertEquals(
- pageContext.getAttribute("TEST_RESULTS").toString(),
- pageContext.getAttribute("EXPECTED_RESULTS").toString()
- );
+String expected = "";
+String compareTo = "";
+
+if (pageContext.getAttribute("EXPECTED_RESULTS") == null){
+ throw new JspException("No tests on this page were called. Please verify that you've setup the tests correctly.");
+}else{
+ expected=pageContext.getAttribute("TEST_RESULTS").toString();
+}
+if (pageContext.getAttribute("TEST_RESULTS") != null){
+ compareTo=pageContext.getAttribute("EXPECTED_RESULTS").toString();
+}
+
+Assert.assertEquals(compareTo, expected);
%>
1.2 +12 -5 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestFileTag2.jsp
Index: TestFileTag2.jsp
===================================================================
RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestFileTag2.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestFileTag2.jsp 1 Mar 2003 06:00:13 -0000 1.1
+++ TestFileTag2.jsp 7 Mar 2003 05:28:51 -0000 1.2
@@ -195,11 +195,18 @@
</logic:equal>
+<%
+String expected = "";
+String compareTo = "";
+if (pageContext.getAttribute("EXPECTED_RESULTS") == null){
+ throw new JspException("No tests on this page were called. Please verify that you've setup the tests correctly.");
+}else{
+ expected=pageContext.getAttribute("TEST_RESULTS").toString();
+}
+if (pageContext.getAttribute("TEST_RESULTS") != null){
+ compareTo=pageContext.getAttribute("EXPECTED_RESULTS").toString();
+}
-<%
-Assert.assertEquals(
- pageContext.getAttribute("TEST_RESULTS").toString(),
- pageContext.getAttribute("EXPECTED_RESULTS").toString()
- );
+Assert.assertEquals(compareTo, expected);
%>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org