You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2003/01/11 23:25:02 UTC

cvs commit: jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/threads suite.jelly wait4.jelly

dion        2003/01/11 14:25:02

  Modified:    jelly/src/test/org/apache/commons/jelly
                        testCmdLineOptions.jelly
               jelly/src/test/org/apache/commons/jelly/benchmark
                        benchmark.jelly
               jelly/src/test/org/apache/commons/jelly/xml
                        filesetExample.jelly
               jelly/src/test/org/apache/commons/jelly/threads suite.jelly
                        wait4.jelly
  Removed:     jelly/src/test/org/apache/commons/jelly/beanshell
                        suite.jelly TestJelly.java TestBeanShellEL.java
  Log:
  Remove beanshell from test files and replace with something similar
  
  Revision  Changes    Path
  1.2       +2 -5      jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/testCmdLineOptions.jelly
  
  Index: testCmdLineOptions.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/testCmdLineOptions.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- testCmdLineOptions.jelly	4 Oct 2002 11:28:20 -0000	1.1
  +++ testCmdLineOptions.jelly	11 Jan 2003 22:25:02 -0000	1.2
  @@ -1,9 +1,6 @@
  -<jelly xmlns="jelly:core" xmlns:bsh="jelly:beanshell">
  +<jelly xmlns="jelly:core" >
   -a option = ${commandLine.getOptionValue("a")}
   -b option = ${commandLine.getOptionValue("b")}
   -c option = ${commandLine.getOptionValue("c")}
  -<bsh:script>
  -Properties sysprops = System.getProperties();
  -System.out.println("-testsysprop = " + sysprops.get("testsysprop"));
  -</bsh:script>
  +-testsysprop = ${systemScope['testsysprop']}
   </jelly>
  
  
  
  1.2       +5 -7      jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/benchmark/benchmark.jelly
  
  Index: benchmark.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/benchmark/benchmark.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- benchmark.jelly	22 Oct 2002 13:42:51 -0000	1.1
  +++ benchmark.jelly	11 Jan 2003 22:25:02 -0000	1.2
  @@ -2,17 +2,15 @@
   
   <!-- revaluates the same script many times to test performance -->
   
  -<j:jelly xmlns:j="jelly:core" xmlns:bsh="jelly:beanshell">
  +<j:jelly xmlns:j="jelly:core" xmlns:log="jelly:log">
   
  -	<bsh:script>
  -		System.out.println( "Started at: " + new java.util.Date() );
  -	</bsh:script>
  +  <j:useBean var="start" class="java.util.Date" />
  +  <log:info>Started at: ${start}</log:info>
   	
     <j:forEach begin="1" end="1000">
     	<j:include uri="sample.jelly"/>
     </j:forEach>
     
  -	<bsh:script>
  -		System.out.println( "Finished at: " + new java.util.Date() );
  -	</bsh:script>
  +  <j:useBean var="end" class="java.util.Date" />
  +  <log:info>Finished at: ${end}</log:info>
   </j:jelly>
  
  
  
  1.2       +4 -8      jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/xml/filesetExample.jelly
  
  Index: filesetExample.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/xml/filesetExample.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- filesetExample.jelly	26 Oct 2002 09:55:08 -0000	1.1
  +++ filesetExample.jelly	11 Jan 2003 22:25:02 -0000	1.2
  @@ -1,18 +1,14 @@
   <?xml version="1.0"?>
  -<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns="jelly:ant" xmlns:bsh="jelly:beanshell">
  +<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns="jelly:ant">
   
   	<fileScanner var="scanner">
   		<fileset dir="src/test/org/apache/commons/jelly/xml" includes="**/*.xml"/>
   	</fileScanner>
   	
   	<j:forEach var="file" items="${scanner.iterator()}">
  -		<bsh:script>
  -			fileName = file.getName();
  -			name = fileName.substring(0, fileName.length() - 4);
  -			context.setVariable("fileName", name);
  -	  </bsh:script>
  -
  -		About to proces file ${file} and generate file name ${fileName}.html
  +	    <j:set var="fileFullName" value="${file.name}"/>
  +	    <j:set var="fileName" value="${fileFullName.substring(0, fileFullName.length() - 4)}"/>
  +		About to process file ${file} and generate file name ${fileName}.html
   
   		<j:file name="target/${fileName}.html">
   			<x:transform xml="${file}" xslt="transformExample.xsl">
  
  
  
  1.2       +2 -4      jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/threads/suite.jelly
  
  Index: suite.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/threads/suite.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- suite.jelly	30 Oct 2002 19:13:01 -0000	1.1
  +++ suite.jelly	11 Jan 2003 22:25:02 -0000	1.2
  @@ -1,5 +1,5 @@
   <?xml version="1.0"?>
  -<test:suite xmlns="jelly:core" xmlns:test="jelly:junit" xmlns:threads="jelly:threads" xmlns:bsh="jelly:beanshell">
  +<test:suite xmlns="jelly:core" xmlns:test="jelly:junit" xmlns:threads="jelly:threads">
       <test:case name="testBasic">
           <set var="result" value=""/>
   
  @@ -170,9 +170,7 @@
   
           <threads:thread var="thread1">
               THROW AN EXCEPTION
  -            <bsh:script>
  -                throw new Exception("This exception SHOULD happen");
  -            </bsh:script>
  +			<new var="bogus" className="java.lang.System"/>
           </threads:thread>
   
           <threads:thread var="thread2">
  
  
  
  1.2       +2 -4      jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/threads/wait4.jelly
  
  Index: wait4.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/threads/wait4.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- wait4.jelly	30 Oct 2002 19:13:01 -0000	1.1
  +++ wait4.jelly	11 Jan 2003 22:25:02 -0000	1.2
  @@ -4,7 +4,7 @@
   This test shows the waitFor tag waiting for multiple threads. 
   -->
   
  -<jelly xmlns="jelly:core" xmlns:threads="jelly:threads" xmlns:bsh="jelly:beanshell">
  +<jelly xmlns="jelly:core" xmlns:threads="jelly:threads">
       <threads:thread var="thread1">
           <whitespace>
           thread1: going to sleep for 1 second
  @@ -21,9 +21,7 @@
   
       <!-- results in a FAILURE -->
       <threads:thread var="thread3">
  -        <bsh:script>
  -            throw new Exception("thread 3 exception");
  -        </bsh:script>
  +			<new var="bogus" className="java.lang.System"/>
       </threads:thread>
   
       <!-- waits for thread 1 and 2 -->
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>