commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jelly/jelly-tags/xmlunit/src/test/org/apache/commons/jelly/tags/xmlunit TestJelly.java suite.jelly
Date Sun, 05 Jan 2003 08:10:27 GMT
dion        2003/01/05 00:10:27

  Added:       jelly/jelly-tags/xmlunit/src/test/org/apache/commons/jelly/tags/xmlunit
                        TestJelly.java suite.jelly
  Log:
  Moved xmlunit out of core
  
  Revision  Changes    Path
  1.1                  jakarta-commons-sandbox/jelly/jelly-tags/xmlunit/src/test/org/apache/commons/jelly/tags/xmlunit/TestJelly.java
  
  Index: TestJelly.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 The Apache Software Foundation.  All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * Portions of this software are based upon public domain software
   * originally written at the National Center for Supercomputing Applications,
   * University of Illinois, Urbana-Champaign.
   */
  
  package org.apache.commons.jelly.tags.xmlunit;
  
  import junit.framework.TestSuite;
  import junit.textui.TestRunner;
  
  import org.apache.commons.jelly.tags.junit.JellyTestSuite;
  
  public class TestJelly extends JellyTestSuite {
  
  	public static void main(String[] args) throws Exception {
  		TestRunner.run(suite());
  	}
  
  	public static TestSuite suite() throws Exception {
  		return createTestSuite(TestJelly.class, "suite.jelly");
  	}
  
  }
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/jelly-tags/xmlunit/src/test/org/apache/commons/jelly/tags/xmlunit/suite.jelly
  
  Index: suite.jelly
  ===================================================================
  <?xml version="1.0"?>
  <test:suite 
  	xmlns:j="jelly:core" 
  	xmlns:x="jelly:xml" 
  	xmlns:test="jelly:junit" 
  	xmlns:log="jelly:log"
  	xmlns:xu="jelly:xmlunit">
  
  	<test:case name="illegalArgument">
  
  		<j:catch var="ex">
  			<j:new var="illegalDoc" className="java.util.ArrayList"/>
  			<xu:assertDocumentsEqual actual="${illegalDoc}">
  				<xu:expected/>
  			</xu:assertDocumentsEqual>
  		</j:catch>
  
  		<test:assert test="${ex != null}">An exception should have been thrown</test:assert>
  		<log:info>The exception was ${ex.message}</log:info>
  
  	</test:case>
  
  	<test:case name="emptyDocuments">
  
  		<xu:assertDocumentsEqual>
  			<xu:actual/>
  			<xu:expected/>
  		</xu:assertDocumentsEqual>
  
  	</test:case>
  
  	<test:case name="sameDocument">
  
  		<x:parse var="doc">
  			<testDoc/>
  		</x:parse>
  
  		<xu:assertDocumentsEqual actual="${doc}" expected="${doc}"/>
  
  		<xu:assertDocumentsEqual expected="${doc}">
  			<xu:actual>
  				<testDoc/>
  			</xu:actual>
  		</xu:assertDocumentsEqual>
  
  	</test:case>
  
  	<test:case name="differentDocuments">
  
  		<j:catch var="ex">
  			<x:parse var="doc1">
  				<testDoc1/>
  			</x:parse>
  			<x:parse var="doc2">
  				<testDoc2/>
  			</x:parse>
  			<xu:assertDocumentsEqual actual="${doc1}" expected="${doc2}"/>
  		</j:catch>
  
  		<test:assert test="${ex != null}">An exception should have been thrown</test:assert>
  		<log:info>The exception was ${ex.message}</log:info>
  
  	</test:case>
  
  	<test:case name="ignoreWhitespace">
  
  		<xu:assertDocumentsEqual trim="false" ignoreWhitespace="true">
  			<xu:actual>
  				<apa> </apa>
  			</xu:actual>
  			<xu:expected>
  				<apa/>
  			</xu:expected>
  		</xu:assertDocumentsEqual>
  
  		<j:catch var="ex">
  			<xu:assertDocumentsEqual trim="false">
  				<xu:actual>
  					<apa> </apa>
  				</xu:actual>
  				<xu:expected>
  					<apa/>
  				</xu:expected>
  			</xu:assertDocumentsEqual>
  		</j:catch>
  
  		<test:assert test="${ex != null}">An exception should have been thrown</test:assert>
  		<log:info>The exception was ${ex.message}</log:info>
  
  	</test:case>
  
  </test:suite>
  
  
  

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


Mime
View raw message