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 2002/03/30 11:25:08 UTC

cvs commit: jakarta-commons/latka/src/test/org/apache/commons/latka/junit TestJUnitTestAdapter.java

dion        02/03/30 02:25:08

  Modified:    latka    build.xml project.xml
               latka/src/test/org/apache/commons/latka/junit
                        TestJUnitTestAdapter.java
  Log:
  Reworked test cases so that they didn't rely on a relative directory to
  te build file to access the test file.
  
  Revision  Changes    Path
  1.32      +12 -11    jakarta-commons/latka/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/build.xml,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- build.xml	29 Mar 2002 10:13:19 -0000	1.31
  +++ build.xml	30 Mar 2002 10:25:08 -0000	1.32
  @@ -1,4 +1,4 @@
  -<!-- $Id: build.xml,v 1.31 2002/03/29 10:13:19 dion Exp $ -->
  +<!-- $Id: build.xml,v 1.32 2002/03/30 10:25:08 dion Exp $ -->
   <project name="commons-latka" default="build-java" basedir=".">
   
       <!-- patternset describing files to be copied from the doc directory -->
  @@ -310,20 +310,21 @@
       <!-- ######################################################### -->
   
       <target name="test" depends="build-test" if="test.entry" description="runs (junit) unit tests">
  -      <!--
  -      <junit printsummary="yes" fork="on" haltonfailure="yes">
  -        <formatter type="plain" usefile="false"/>
  -        <test name="${test.entry}"/>
  -        <classpath>
  -            <pathelement location="${dest.classes}" />
  -            <path refid="classpath"/>
  -            <pathelement path="${java.class.path}" />
  -        </classpath>
  -      </junit>
  +<!--        <junit printsummary="yes" fork="on" haltonfailure="yes">
  +            <formatter type="plain" usefile="false"/>
  +            <test name="${test.entry}"/>
  +            <sysproperty key="basedir" value="${basedir}"/> 
  +            <classpath>
  +                <pathelement location="${dest.classes}" />
  +                <path refid="classpath"/>
  +                <pathelement path="${java.class.path}" />
  +            </classpath>
  +        </junit>
         -->
   
           <java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
               <arg value="${test.entry}"/> 
  +            <sysproperty key="basedir" value="${basedir}"/> 
               <classpath>
                   <pathelement location="${dest.classes}" /> 
                   <path refid="classpath"/>
  
  
  
  1.5       +11 -17    jakarta-commons/latka/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/project.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- project.xml	29 Mar 2002 16:13:18 -0000	1.4
  +++ project.xml	30 Mar 2002 10:25:08 -0000	1.5
  @@ -82,14 +82,15 @@
       </developer>
     </developers>
   
  -  <dependencies>
  -    <dependency>
  -      <name>xml-apis</name>
  -      <type>required</type>
  -      <version>2.0.0</version>
  -      <jar>xmlParserAPIs-2.0.0.jar</jar>
  -    </dependency>
  -
  +    <dependencies>
  +<!--
  +        <dependency>
  +            <name>xml-apis</name>
  +            <type>required</type>
  +            <version>2.0.0</version>
  +            <jar>xmlParserAPIs-2.0.0.jar</jar>
  +        </dependency>
  +-->
       <dependency>
         <name>jakarta-log4j</name>
         <type>required</type>
  @@ -117,21 +118,14 @@
           <version>0.7</version>
           <jar>jdom-b7.jar</jar>
       </dependency>
  -
  +<!--
       <dependency>
           <name>xml-xalan2</name>
           <type>required</type>
           <version>2.3.1</version>
           <jar>xalan-2.1.0.jar</jar>
       </dependency>
  -    <!--
  -    <dependency>
  -        <name>sax2</name>
  -        <type>required</type>
  -        <version>2.0</version>
  -        <jar>sax2.jar</jar>
  -    </dependency>
  --->
  +    -->
       <dependency>
           <name>xml-xerces2</name>
           <type>required</type>
  
  
  
  1.3       +8 -2      jakarta-commons/latka/src/test/org/apache/commons/latka/junit/TestJUnitTestAdapter.java
  
  Index: TestJUnitTestAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/test/org/apache/commons/latka/junit/TestJUnitTestAdapter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestJUnitTestAdapter.java	18 Oct 2001 16:37:59 -0000	1.2
  +++ TestJUnitTestAdapter.java	30 Mar 2002 10:25:08 -0000	1.3
  @@ -77,7 +77,7 @@
   
   /**
    * @author Chuck Burdick
  - * @version $Id: TestJUnitTestAdapter.java,v 1.2 2001/10/18 16:37:59 morgand Exp $
  + * @version $Id: TestJUnitTestAdapter.java,v 1.3 2002/03/30 10:25:08 dion Exp $
    */
   public class TestJUnitTestAdapter extends TestCase {
      private String _xmlFileName = "tests/samples/TestCommonsWebsite.xml";
  @@ -98,7 +98,13 @@
         junit.textui.TestRunner.main(testCaseName);
      }
   
  -   public void setUp() throws FileNotFoundException {
  +   public void setUp() throws Exception {
  +       super.setUp();
  +       String baseDir = System.getProperty("basedir");
  +       assertNotNull("The system property basedir was not defined.", baseDir);
  +       String fs = System.getProperty("file.separator");
  +       assertNotNull("The system property file.separator was not defined.", fs);
  +       _xmlFileName = baseDir + fs + _xmlFileName;
         _xmlFile = new File(_xmlFileName);
         _suite = new Suite(new FileReader(_xmlFile));
         _adapter = new JUnitTestAdapter(_suite, 9);
  
  
  

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