jstrachan 2002/11/27 11:13:25 Modified: jelly/src/test simplelog.properties jelly/src/test/org/apache/commons/jelly/junit suite.jelly jelly/src/test/org/apache/commons/jelly/mock suite.jelly service.jelly jelly/src/test/org/apache/commons/jelly/betwixt common.jelly jelly/src/test/org/apache/commons/jelly/jsl suite.jelly Log: Patches to the JellyUnit scripts to make them a little quieter when folks run them. Revision Changes Path 1.2 +2 -2 jakarta-commons-sandbox/jelly/src/test/simplelog.properties Index: simplelog.properties =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/simplelog.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- simplelog.properties 21 Nov 2002 12:41:23 -0000 1.1 +++ simplelog.properties 27 Nov 2002 19:13:24 -0000 1.2 @@ -1,4 +1,4 @@ -org.apache.commons.logging.simplelog.defaultlog = info +# uncomment these lines to turn on debugging -# uncomment this line to turn on debugging +#org.apache.commons.logging.simplelog.defaultlog = info #org.apache.commons.logging.simplelog.log.org.apache.commons.jelly = debug 1.7 +6 -5 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/junit/suite.jelly Index: suite.jelly =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/junit/suite.jelly,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- suite.jelly 13 Nov 2002 09:03:31 -0000 1.6 +++ suite.jelly 27 Nov 2002 19:13:25 -0000 1.7 @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<test:suite xmlns:j="jelly:core" xmlns:test="jelly:junit" xmlns:x="jelly:xml"> +<test:suite xmlns:j="jelly:core" xmlns:test="jelly:junit" xmlns:x="jelly:xml" xmlns:log="jelly:log"> <test:case name="assertTests"> @@ -10,8 +10,9 @@ </j:catch> <test:assert test="${ex != null}">We should have created an exception</test:assert> + + <log:info>The exception was: ${ex.message}</log:info> - The exception was: ${ex.message} </test:case> @@ -23,7 +24,7 @@ <test:assert test="${ex != null}">We should have created an exception</test:assert> - The exception was: ${ex.message} + <log:info>The exception was: ${ex.message}</log:info> <j:catch var="ex"> <test:fail message="This should always fail"/> @@ -31,7 +32,7 @@ <test:assert test="${ex != null}">We should have created an exception</test:assert> - The exception was: ${ex.message} + <log:info>The exception was: ${ex.message}</log:info> </test:case> @@ -47,7 +48,7 @@ <test:assert test="${ex != null}">We should have created an exception</test:assert> - The exception was: ${ex.message} + <log:info>The exception was: ${ex.message}</log:info> </test:case> <!-- 1.2 +3 -2 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/mock/suite.jelly Index: suite.jelly =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/mock/suite.jelly,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- suite.jelly 5 Sep 2002 16:44:38 -0000 1.1 +++ suite.jelly 27 Nov 2002 19:13:25 -0000 1.2 @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<test:suite xmlns:j="jelly:core" xmlns:test="jelly:junit" xmlns:mock="jelly:define" xmlns:sql="jelly:sql"> +<test:suite xmlns:j="jelly:core" xmlns:test="jelly:junit" xmlns:mock="jelly:define" xmlns:sql="jelly:sql" xmlns:log="jelly:log"> <!-- lets create some mock tags and test a sample script that it evaluates the || mock tags as we'd expect @@ -34,7 +34,8 @@ <mock:taglib uri="myFoodWebService"> <mock:tag name="eat"> - Invoking the eat web service with ${cheese} + <log:info>Invoking the eat web service with ${cheese}</log:info> + <!-- increment the counter, in the parent scope so not to use a local variable --> <j:set var="eatServiceCount" scope="parent" value="${1+eatServiceCount}"/> 1.2 +2 -2 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/mock/service.jelly Index: service.jelly =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/mock/service.jelly,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- service.jelly 5 Sep 2002 16:44:38 -0000 1.1 +++ service.jelly 27 Nov 2002 19:13:25 -0000 1.2 @@ -4,7 +4,7 @@ || via Mock Tags --> -<j:jelly xmlns:j="jelly:core" xmlns:sql="jelly:sql" xmlns:my="myFoodWebService"> +<j:jelly xmlns:j="jelly:core" xmlns:sql="jelly:sql" xmlns:my="myFoodWebService" xmlns:log="jelly:log"> <sql:query var="results"> select * from food where kind = ? @@ -16,7 +16,7 @@ <!-- invoke some service --> <j:forEach items="${results.rows}" var="row"> - Found row with ID ${row.id} + <log:info>Found row with ID ${row.id}</log:info> <!-- this tag could invoke a web service etc --> <my:eat cheese="${row.id}"/> 1.2 +2 -2 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/betwixt/common.jelly Index: common.jelly =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/betwixt/common.jelly,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- common.jelly 31 Jul 2002 11:19:20 -0000 1.1 +++ common.jelly 27 Nov 2002 19:13:25 -0000 1.2 @@ -2,9 +2,9 @@ <!-- common tests that the channel has been created properly --> -<test:suite xmlns:j="jelly:core" xmlns:test="jelly:junit" xmlns:b="jelly:betwixt"> +<test:suite xmlns:j="jelly:core" xmlns:test="jelly:junit" xmlns:b="jelly:betwixt" xmlns:log="jelly:log"> - Parsed channel with title: ${channel.title} + <log:info>Parsed channel with title: ${channel.title}</log:info> <test:assert test="${channel != null}"/> 1.10 +44 -42 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jsl/suite.jelly Index: suite.jelly =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jsl/suite.jelly,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- suite.jelly 20 Nov 2002 22:43:42 -0000 1.9 +++ suite.jelly 27 Nov 2002 19:13:25 -0000 1.10 @@ -8,49 +8,51 @@ xmlns:log="jelly:log"> <test:case name="testDionsBug" xmlns="dummy"> - - <!-- see if we can break template --> - <m:fileScanner var="files"> - <m:fileset dir="src/test/org/apache/commons/jelly/jsl"> - <m:patternset> - <m:include name="**/*.xml"/> - </m:patternset> - </m:fileset> - </m:fileScanner> - <j:forEach var="file" items="${files.iterator()}"> - <x:parse var="doc" xml="${file.toURL()}" /> - <jsl:stylesheet select="$doc"> - <jsl:template match="document" trim="no"> - - <h> - <j:set var="full"><x:expr select="$doc/document/properties/title"/></j:set> - <j:set var="short"><x:expr select="./properties/title" /></j:set> - <m:echo>full=${full},short=${short}</m:echo> - <test:assert test="${full == short}">All iterations should succeed</test:assert> - </h> - </jsl:template> - </jsl:stylesheet> - - </j:forEach> - - <!-- test stylesheet external to loop --> - <jsl:stylesheet var="ss1"> - <jsl:template match="document" trim="no"> - <h> - - <j:set var="full"><x:expr select="$doc/document/properties/title"/></j:set> - <j:set var="short"><x:expr select="./properties/title" /></j:set> - <m:echo>full=${full},short=${short}</m:echo> - <test:assert test="${full == short}">All iterations should succeed</test:assert> - </h> - </jsl:template> - </jsl:stylesheet> - - <j:forEach var="file" items="${files.iterator()}"> - <x:parse var="doc" xml="${file.toURL()}" /> - <jsl:style stylesheet="${ss1}" select="$doc" /> - </j:forEach> + <log:info> + <!-- see if we can break template --> + <m:fileScanner var="files"> + <m:fileset dir="src/test/org/apache/commons/jelly/jsl"> + <m:patternset> + <m:include name="**/*.xml"/> + </m:patternset> + </m:fileset> + </m:fileScanner> + + <j:forEach var="file" items="${files.iterator()}"> + <x:parse var="doc" xml="${file.toURL()}" /> + <jsl:stylesheet select="$doc"> + <jsl:template match="document" trim="no"> + + <h> + <j:set var="full"><x:expr select="$doc/document/properties/title"/></j:set> + <j:set var="short"><x:expr select="./properties/title" /></j:set> + <m:echo>full=${full},short=${short}</m:echo> + <test:assert test="${full == short}">All iterations should succeed</test:assert> + </h> + </jsl:template> + </jsl:stylesheet> + + </j:forEach> + + <!-- test stylesheet external to loop --> + <jsl:stylesheet var="ss1"> + <jsl:template match="document" trim="no"> + <h> + + <j:set var="full"><x:expr select="$doc/document/properties/title"/></j:set> + <j:set var="short"><x:expr select="./properties/title" /></j:set> + <m:echo>full=${full},short=${short}</m:echo> + <test:assert test="${full == short}">All iterations should succeed</test:assert> + </h> + </jsl:template> + </jsl:stylesheet> + + <j:forEach var="file" items="${files.iterator()}"> + <x:parse var="doc" xml="${file.toURL()}" /> + <jsl:style stylesheet="${ss1}" select="$doc" /> + </j:forEach> + </log:info> </test:case>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>