jmitchell 2003/03/06 21:27:20 Modified: web/test/test/org/apache/struts/taglib/html TestBaseTag.jsp TestButtonTag1.jsp TestButtonTag2.jsp TestCancelTag1.jsp TestCancelTag2.jsp TestCheckboxTag1.jsp TestCheckboxTag2.jsp TestCheckboxTag3.jsp TestCheckboxTag4.jsp TestErrorsTag1.jsp TestErrorsTag2.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 -4 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestBaseTag.jsp Index: TestBaseTag.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestBaseTag.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestBaseTag.jsp 27 Feb 2003 02:18:44 -0000 1.1 +++ TestBaseTag.jsp 7 Mar 2003 05:27:19 -0000 1.2 @@ -48,8 +48,17 @@ <% -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 +13 -5 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestButtonTag1.jsp Index: TestButtonTag1.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestButtonTag1.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestButtonTag1.jsp 28 Feb 2003 01:11:38 -0000 1.1 +++ TestButtonTag1.jsp 7 Mar 2003 05:27:19 -0000 1.2 @@ -230,10 +230,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.3 +13 -5 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestButtonTag2.jsp Index: TestButtonTag2.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestButtonTag2.jsp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TestButtonTag2.jsp 27 Feb 2003 04:39:43 -0000 1.2 +++ TestButtonTag2.jsp 7 Mar 2003 05:27:19 -0000 1.3 @@ -196,10 +196,18 @@ - <% -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 +13 -5 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestCancelTag1.jsp Index: TestCancelTag1.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestCancelTag1.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestCancelTag1.jsp 28 Feb 2003 01:11:38 -0000 1.1 +++ TestCancelTag1.jsp 7 Mar 2003 05:27:19 -0000 1.2 @@ -230,10 +230,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 +13 -5 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestCancelTag2.jsp Index: TestCancelTag2.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestCancelTag2.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestCancelTag2.jsp 28 Feb 2003 01:11:38 -0000 1.1 +++ TestCancelTag2.jsp 7 Mar 2003 05:27:19 -0000 1.2 @@ -111,10 +111,18 @@ </bean:define> </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 +13 -5 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestCheckboxTag1.jsp Index: TestCheckboxTag1.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestCheckboxTag1.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestCheckboxTag1.jsp 28 Feb 2003 01:11:38 -0000 1.1 +++ TestCheckboxTag1.jsp 7 Mar 2003 05:27:19 -0000 1.2 @@ -230,10 +230,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 +13 -5 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestCheckboxTag2.jsp Index: TestCheckboxTag2.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestCheckboxTag2.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestCheckboxTag2.jsp 28 Feb 2003 01:11:38 -0000 1.1 +++ TestCheckboxTag2.jsp 7 Mar 2003 05:27:19 -0000 1.2 @@ -196,10 +196,18 @@ - <% -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 +13 -5 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestCheckboxTag3.jsp Index: TestCheckboxTag3.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestCheckboxTag3.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestCheckboxTag3.jsp 28 Feb 2003 01:11:38 -0000 1.1 +++ TestCheckboxTag3.jsp 7 Mar 2003 05:27:19 -0000 1.2 @@ -230,10 +230,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 +13 -5 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestCheckboxTag4.jsp Index: TestCheckboxTag4.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestCheckboxTag4.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestCheckboxTag4.jsp 28 Feb 2003 01:11:38 -0000 1.1 +++ TestCheckboxTag4.jsp 7 Mar 2003 05:27:19 -0000 1.2 @@ -196,10 +196,18 @@ - <% -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 +3 -1 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestErrorsTag1.jsp Index: TestErrorsTag1.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestErrorsTag1.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestErrorsTag1.jsp 1 Mar 2003 06:00:13 -0000 1.1 +++ TestErrorsTag1.jsp 7 Mar 2003 05:27:19 -0000 1.2 @@ -531,7 +531,9 @@ String expected = ""; String compareTo = ""; -if (pageContext.getAttribute("EXPECTED_RESULTS") != null){ +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){ 1.2 +11 -10 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestErrorsTag2.jsp Index: TestErrorsTag2.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestErrorsTag2.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestErrorsTag2.jsp 1 Mar 2003 06:00:13 -0000 1.1 +++ TestErrorsTag2.jsp 7 Mar 2003 05:27:19 -0000 1.2 @@ -274,7 +274,7 @@ <!-- Name --> -<logic:equal name="runTest" value="testErrorsDefaultBundle0ErrorsName"> +<logic:equal name="runTest" value="testErrorsDefaultBundle0ErrorsNameProperty"> <bean:define id="EXPECTED_RESULTS" toScope="page"> My Errors go here:<html:errors name="MY_ERRORS_KEY" property="someProperty"/> </bean:define> @@ -283,7 +283,7 @@ </bean:define> </logic:equal> -<logic:equal name="runTest" value="testErrorsDefaultBundle2ErrorsName"> +<logic:equal name="runTest" value="testErrorsDefaultBundle2ErrorsNameProperty"> <% //This should be done in your action. I do it here to keep the tests simple. ActionErrors errors = new ActionErrors(); @@ -304,7 +304,7 @@ </bean:define> </logic:equal> -<logic:equal name="runTest" value="testErrorsAlternateBundle0ErrorsName"> +<logic:equal name="runTest" value="testErrorsAlternateBundle0ErrorsNameProperty"> <bean:define id="EXPECTED_RESULTS" toScope="page"> My Errors go here:<html:errors name="MY_ERRORS_KEY" property="someProperty"/> </bean:define> @@ -313,7 +313,7 @@ </bean:define> </logic:equal> -<logic:equal name="runTest" value="testErrorsAlternateBundle2ErrorsName"> +<logic:equal name="runTest" value="testErrorsAlternateBundle2ErrorsNameProperty"> <% //This should be done in your action. I do it here to keep the tests simple. ActionErrors errors = new ActionErrors(); @@ -334,7 +334,7 @@ </bean:define> </logic:equal> -<logic:equal name="runTest" value="testErrorsDefaultBundle0ErrorsName_fr"> +<logic:equal name="runTest" value="testErrorsDefaultBundle0ErrorsNameProperty_fr"> <bean:define id="EXPECTED_RESULTS" toScope="page"> My Errors go here:<html:errors name="MY_ERRORS_KEY" property="someProperty"/> </bean:define> @@ -343,7 +343,7 @@ </bean:define> </logic:equal> -<logic:equal name="runTest" value="testErrorsDefaultBundle2ErrorsName_fr"> +<logic:equal name="runTest" value="testErrorsDefaultBundle2ErrorsNameProperty_fr"> <% //This should be done in your action. I do it here to keep the tests simple. ActionErrors errors = new ActionErrors(); @@ -365,7 +365,7 @@ </logic:equal> -<logic:equal name="runTest" value="testErrorsAlternateBundle0ErrorsName_fr"> +<logic:equal name="runTest" value="testErrorsAlternateBundle0ErrorsNameProperty_fr"> <bean:define id="EXPECTED_RESULTS" toScope="page"> My Errors go here:<html:errors name="MY_ERRORS_KEY" property="someProperty"/> </bean:define> @@ -374,7 +374,7 @@ </bean:define> </logic:equal> -<logic:equal name="runTest" value="testErrorsAlternateBundle2ErrorsName_fr"> +<logic:equal name="runTest" value="testErrorsAlternateBundle2ErrorsNameProperty_fr"> <% //This should be done in your action. I do it here to keep the tests simple. ActionErrors errors = new ActionErrors(); @@ -528,12 +528,13 @@ - <% String expected = ""; String compareTo = ""; -if (pageContext.getAttribute("EXPECTED_RESULTS") != null){ +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){
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]