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 2004/08/12 08:24:50 UTC

cvs commit: jakarta-commons/jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml suite.jelly

dion        2004/08/11 23:24:50

  Modified:    jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml
                        suite.jelly
  Log:
  detab
  
  Revision  Changes    Path
  1.7       +128 -128  jakarta-commons/jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml/suite.jelly
  
  Index: suite.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml/suite.jelly,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- suite.jelly	21 Jun 2004 11:20:11 -0000	1.6
  +++ suite.jelly	12 Aug 2004 06:24:50 -0000	1.7
  @@ -15,84 +15,84 @@
     limitations under the License.
   -->
   <test:suite 
  -	xmlns:j="jelly:core" 
  -	xmlns:x="jelly:xml" 
  -	xmlns:test="jelly:junit">
  +    xmlns:j="jelly:core" 
  +    xmlns:x="jelly:xml" 
  +    xmlns:test="jelly:junit">
   
   
  -	<test:case name="testUriParse">
  -		<x:parse var="doc" xml="dummy.xml"/>
  -		
  -		<test:assert xpath="$doc/dummy/entry[@id='2']"/>		
  -	</test:case>
  -	
  +    <test:case name="testUriParse">
  +        <x:parse var="doc" xml="dummy.xml"/>
  +        
  +        <test:assert xpath="$doc/dummy/entry[@id='2']"/>        
  +    </test:case>
  +    
     <test:case name="testBodyParse">
  -  	
  -  	<x:parse var="doc">
  -  		<foo>
  -  			<bar a="1"/>
  -  		</foo>
  -  	</x:parse>
  -	
  -		<test:assert xpath="$doc/foo/bar[@a='1']"/>
  +      
  +      <x:parse var="doc">
  +          <foo>
  +              <bar a="1"/>
  +          </foo>
  +      </x:parse>
  +    
  +        <test:assert xpath="$doc/foo/bar[@a='1']"/>
     </test:case>
     
     <test:case name="testTextParse">
  -  	
  -  	<j:set var="text" encode="false">
  -  		<foo>
  -  			<bar a="1"/>
  -  		</foo>
  -  	</j:set>
  -	
  -  	<x:parse var="doc" text="${text}"/>
  -	
  -		<test:assert xpath="$doc/foo/bar[@a='1']"/>
  +      
  +      <j:set var="text" encode="false">
  +          <foo>
  +              <bar a="1"/>
  +          </foo>
  +      </j:set>
  +    
  +      <x:parse var="doc" text="${text}"/>
  +    
  +        <test:assert xpath="$doc/foo/bar[@a='1']"/>
     </test:case>
     
     <test:case name="testElementAndAttribute">
  -  	
  -  	<x:parse var="doc">
  -  		<x:element name="foo">
  -  			<x:attribute name="x">1234</x:attribute>
  -  			
  -  			<x:element name="bar">
  -					<x:attribute name="y">ABC</x:attribute>
  -					hello
  -				</x:element>
  -  		</x:element>
  -  	</x:parse>
  -	
  -		<test:assert xpath="$doc/foo"/>
  -		<test:assert xpath="$doc/foo[@x='1234']"/>
  -		<test:assert xpath="count($doc/bar) = 0"/>
  -
  -		<!-- test nested element and attributes -->		
  -		<test:assert xpath="$doc/foo[@x='1234']/bar[@y='ABC']"/>
  -		<test:assert xpath="$doc/foo[@x='1234']/bar[@y='ABC']='hello'"/>
  +      
  +      <x:parse var="doc">
  +          <x:element name="foo">
  +              <x:attribute name="x">1234</x:attribute>
  +              
  +              <x:element name="bar">
  +                    <x:attribute name="y">ABC</x:attribute>
  +                    hello
  +                </x:element>
  +          </x:element>
  +      </x:parse>
  +    
  +        <test:assert xpath="$doc/foo"/>
  +        <test:assert xpath="$doc/foo[@x='1234']"/>
  +        <test:assert xpath="count($doc/bar) = 0"/>
  +
  +        <!-- test nested element and attributes -->        
  +        <test:assert xpath="$doc/foo[@x='1234']/bar[@y='ABC']"/>
  +        <test:assert xpath="$doc/foo[@x='1234']/bar[@y='ABC']='hello'"/>
     </test:case>
     
     <test:case name="testBadElementAndAttribute">
   
  -		
  -			<j:catch var="ex">
  -				<x:element name="foo">
  -					some text
  -					<x:attribute name="x">1234</x:attribute>
  -				</x:element>
  -			</j:catch>    	
  -		  	
  -		
  -		<test:assert test="${ex != null}">
  -			We should have created an exception as some text is output before the attributes
  -		</test:assert>
  +        
  +            <j:catch var="ex">
  +                <x:element name="foo">
  +                    some text
  +                    <x:attribute name="x">1234</x:attribute>
  +                </x:element>
  +            </j:catch>        
  +              
  +        
  +        <test:assert test="${ex != null}">
  +            We should have created an exception as some text is output before the attributes
  +        </test:assert>
     </test:case>
     
     <test:case name="assertXPathTests">
     
       <x:parse var="doc">
         <foo>
  -      	<bar>cheese</bar>
  +          <bar>cheese</bar>
         </foo>
       </x:parse>  
        
  @@ -101,20 +101,20 @@
       <test:assert xpath="$doc/foo/bar = 'cheese'">This should never fail</test:assert>
       
       <j:catch var="ex">
  -		  <test:assert xpath="$doc/foo/xyz">This should always fail</test:assert>
  -		</j:catch>    	
  -		
  -		<test:assert test="${ex != null}">We should have created an exception</test:assert>
  -		
  -		The exception was: ${ex.message}
  +          <test:assert xpath="$doc/foo/xyz">This should always fail</test:assert>
  +        </j:catch>        
  +        
  +        <test:assert test="${ex != null}">We should have created an exception</test:assert>
  +        
  +        The exception was: ${ex.message}
     </test:case>
   
  -	<!-- test the use of namespaces with XPath -->
  +    <!-- test the use of namespaces with XPath -->
     <test:case name="assertXPathWithNamespaceTests" xmlns:a="fooURI" xmlns:z="doesNotMatch" xmlns="different">
     
       <x:parse var="doc">
         <foo xmlns="fooURI">
  -      	<bar>cheese</bar>
  +          <bar>cheese</bar>
         </foo>
       </x:parse>  
        
  @@ -122,23 +122,23 @@
       <test:assert xpath="$doc/b:foo/b:bar" xmlns:b="fooURI">This should never fail</test:assert>
       
       <j:catch var="ex">
  -		  <test:assert xpath="$doc/z:foo/z:bar">This should always fail</test:assert>
  -		</j:catch>    	
  -		
  -		<test:assert test="${ex != null}">We should have created an exception</test:assert>
  -		
  +          <test:assert xpath="$doc/z:foo/z:bar">This should always fail</test:assert>
  +        </j:catch>        
  +        
  +        <test:assert test="${ex != null}">We should have created an exception</test:assert>
  +        
       <j:catch var="ex">
  -		  <test:assert xpath="$doc/foo/bar">This should always fail, since foo is not in the empty namespace</test:assert>
  -		</j:catch>    	
  -		
  -		<test:assert test="${ex != null}">We should have created an exception</test:assert>
  -		
  -		<!-- 
  -			|| now lets test that the default namespace 'different' is ignored by the XPath expressions
  -			|| since XPath should ignore the default namespace - you must use a prefix in XPath to denote
  -			|| a namespace
  -			-->
  -		<test:assert xpath="$doc/*[local-name()='foo']"/>
  +          <test:assert xpath="$doc/foo/bar">This should always fail, since foo is not in the empty namespace</test:assert>
  +        </j:catch>        
  +        
  +        <test:assert test="${ex != null}">We should have created an exception</test:assert>
  +        
  +        <!-- 
  +            || now lets test that the default namespace 'different' is ignored by the XPath expressions
  +            || since XPath should ignore the default namespace - you must use a prefix in XPath to denote
  +            || a namespace
  +            -->
  +        <test:assert xpath="$doc/*[local-name()='foo']"/>
     </test:case>
   
       <!-- test xpath sorting -->
  @@ -221,38 +221,38 @@
   
   
     <test:case name="testComment">
  -  	
  -  	<x:parse var="doc">
  -  		<foo>
  -				<!-- this will not be output -->
  -				
  -				<x:comment text="this is a comment"/>
  -  		</foo>
  -  	</x:parse>
  -	
  -		<test:assert xpath="$doc/foo"/>
  -
  -		<j:set var="t"><x:copyOf select="$doc/foo/comment()"/></j:set>
  -		
  -		<test:assertEquals expected="&lt;!--this is a comment--&gt;" actual="${t.trim()}"/>
  +      
  +      <x:parse var="doc">
  +          <foo>
  +                <!-- this will not be output -->
  +                
  +                <x:comment text="this is a comment"/>
  +          </foo>
  +      </x:parse>
  +    
  +        <test:assert xpath="$doc/foo"/>
   
  -	</test:case>
  +        <j:set var="t"><x:copyOf select="$doc/foo/comment()"/></j:set>
  +        
  +        <test:assertEquals expected="&lt;!--this is a comment--&gt;" actual="${t.trim()}"/>
  +
  +    </test:case>
   
     <test:case name="testCommentWithTextAttribute">
  -  	
  -  	<x:parse var="doc">
  -  		<foo>
  -				<!-- this will not be output -->
  -				
  -				<x:comment text="this is a comment"/>
  -  		</foo>
  -  	</x:parse>
  -	
  -		<test:assert xpath="$doc/foo"/>
  -
  -		<j:set var="t"><x:copyOf select="$doc/foo/comment()"/></j:set>
  -		
  -		<test:assertEquals expected="&lt;!--this is a comment--&gt;" actual="${t.trim()}"/>
  +      
  +      <x:parse var="doc">
  +          <foo>
  +                <!-- this will not be output -->
  +                
  +                <x:comment text="this is a comment"/>
  +          </foo>
  +      </x:parse>
  +    
  +        <test:assert xpath="$doc/foo"/>
  +
  +        <j:set var="t"><x:copyOf select="$doc/foo/comment()"/></j:set>
  +        
  +        <test:assertEquals expected="&lt;!--this is a comment--&gt;" actual="${t.trim()}"/>
     </test:case>
     
     <test:case name="testFileParse">
  @@ -264,20 +264,20 @@
       <x:parse var="suite" xml="${theSuite}"/> -->
     </test:case>
   
  -	
  -	<test:case name="testSetSingleNode">
  -		<x:parse var="blopElements">
  -			<root>
  -			<blop>blop1</blop>
  -			<blop>blop0</blop></root>
  -			</x:parse>
  -		<x:set var="blopSingle" select="$blopElements/root/blop" sort="text()" single="true"/>
  -		<!-- should return the second -->
  -		<j:invokeStatic var="eltClass" className="java.lang.Class" method="forName"><j:arg value="org.dom4j.Element"/></j:invokeStatic>
  -	  <test:assert test="${eltClass.isAssignableFrom(blopSingle.getClass())}"/>
  -		<j:set var="blopSingleText"><x:expr select="$blopSingle/text()"/></j:set>
  -		<test:assertEquals actual="${blopSingleText}" expected="blop0"/>
  -		</test:case>
  -	
  -	
  +    
  +    <test:case name="testSetSingleNode">
  +        <x:parse var="blopElements">
  +            <root>
  +            <blop>blop1</blop>
  +            <blop>blop0</blop></root>
  +        </x:parse>
  +        <x:set var="blopSingle" select="$blopElements/root/blop" sort="text()" single="true"/>
  +        <!-- should return the second -->
  +        <j:invokeStatic var="eltClass" className="java.lang.Class" method="forName"><j:arg value="org.dom4j.Element"/></j:invokeStatic>
  +      <test:assert test="${eltClass.isAssignableFrom(blopSingle.getClass())}"/>
  +        <j:set var="blopSingleText"><x:expr select="$blopSingle/text()"/></j:set>
  +        <test:assertEquals actual="${blopSingleText}" expected="blop0"/>
  +        </test:case>
  +    
  +    
   </test:suite>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org