ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Black <jbl...@ieee.org>
Subject Re: problem getting junit task to find classes
Date Wed, 30 Jul 2003 12:46:29 GMT
Antoine Levy-Lambert wrote:

>try to add a fork="true" attribute for your junit class.
>Also, if problems persist, run ant -verbose or ant -debug to find out more.
>You can send us the output of ant -verbose to have a look at.
>  
>
  I am including three sections in this response. The first is the part 
of the output from ant -verbose, the second is the listing of the jar 
file that does contain the class that it is failing on, and the third is 
my junit target.  I actually copied the jar files with the test classes 
to /usr/java/jre/lib/ext so that they could be found.
  I also unset CLASSPATH, btw before I ran this.

  Again, thank you for any help.

    [junit] Running edu.usf.acomp.jsf.nams.JSFCollegesTest
    [junit] Executing '/usr/j2sdk1.4.2/jre/bin/java' with arguments:
    [junit] '-Xmx400M'
    [junit] '-classpath'
    [junit]
'/usr/java/jre/lib/ext/classes12.zip:/usr/java/jre/lib/ext/nls_charset12.zip:/home/jblack/.netbeans/3.4/modules/taglibed.jar:/home/jblack/.netbeans/3.4/modules/jemmysupport.jar:/home/jblack/.netbeans/3.4/modules/testtools.jar:/home/jblack/.netbeans/3.4/modules/jspdebug.jar:/home/jblack/.netbeans/3.4/modules/toolsDebugger.jar:/home/jblack/.netbeans/3.4/modules/monitor.jar:/home/jblack/.netbeans/3.4/modules/apisupport-apidocs.jar:/home/jblack/.netbeans/3.4/modules/filecopy.jar:/home/jblack/.netbeans/3.4/modules/ant-docs.jar:/home/jblack/.netbeans/3.4/modules/junit.jar:/home/jblack/.netbeans/3.4/modules/jspie.jar:/home/jblack/.netbeans/3.4/modules/treefs.jar:/home/jblack/.netbeans/3.4/modules/comboswitcher.jar:/home/jblack/.netbeans/3.4/modules/ext/jemmy.jar:/home/jblack/.netbeans/3.4/modules/ext/jelly2-nb.jar:/home/jblack/.netbeans/3.4/modules/ext/httpmonitor.jar:/home/jblack/.netbeans/3.4/modules/ext/monitor-valve.jar:/home/jblack/.netbeans/3.4/modules/ext/ftpclient.jar:/home/jblack/.netbeans/3.4/modules/ext/junit-ext.jar:/home/jblack/.netbeans/3.4/modules/ext/junit-3.7.jar:/home/jblack/src/java/BB6_jars/bb-bridge.jar:/home/jblack/src/java/BB6_jars/bb-platform.jar:/home/jblack/src/java/BB6_jars/bb-cms-admin.jar:/home/jblack/src/java/jsf_jars/commons-beanutils.jar:/home/jblack/src/java/jsf_jars/commons-digester.jar:/home/jblack/src/java/jsf_jars/commons-logging.jar:/home/jblack/src/java/jsf_jars/jaxen-full.jar:/home/jblack/src/java/jsf_jars/jsf-api.jar:/home/jblack/src/java/jsf_jars/jsf-ri.jar:/home/jblack/src/java/jsf_jars/jstl.jar:/home/jblack/src/java/jsf_jars/saxpath.jar:/home/jblack/src/java/jsf_jars/standard.jar:/home/jblack/src/java/axislibs/axis.jar:/home/jblack/src/java/axislibs/commons-discovery.jar:/home/jblack/src/java/axislibs/commons-logging.jar:/home/jblack/src/java/axislibs/jaxrpc.jar:/home/jblack/src/java/axislibs/log4j-1.2.8.jar:/home/jblack/src/java/axislibs/saaj.jar:/home/jblack/src/java/axislibs/wsdl4j.jar:/home/jblack/src/java/axislibs/activation.jar:/home/jblack/src/java/axislibs/mail.jar:/home/jblack/src/java/axislibs/mailapi.jar:/home/jblack/src/java/axislibs/xmlsec.jar:/home/jblack/src/java/axislibs/bcmail-jdk14-118.jar:/home/jblack/src/java/axislibs/bcprov-jdk14-118.jar:/home/jblack/src/java/axislibs/pop3.jar:/home/jblack/src/java/axislibs/bouncycrypt.jar:/home/jblack/src/java/axislibs/imap.jar:/home/jblack/src/java/axislibs/mysql-connector-java-3.0.5-gamma-bin.jar:/home/jblack/src/java/axislibs/mysql_comp.jar:/home/jblack/src/java/axislibs/mysql_uncomp.jar:/home/jblack/src/java/axislibs/smtp.jar:/home/jblack/src/java/testdist/acompaxis.jar:/home/jblack/src/java/testdist/graphics.jar:/home/jblack/src/java/testdist/epicclient.jar:/home/jblack/src/java/testdist/epicserver.jar:/home/jblack/src/java/testdist/epic.jar:/home/jblack/src/java/testdist/numericalmethods.jar:/home/jblack/src/java/testdist/epictest.jar:/home/jblack/src/java/testdist/graphicstest.jar:/home/jblack/src/java/testdist/lmscommon.jar:/home/jblack/src/java/testdist/axistest.jar:/home/jblack/src/java/testdist/epicjsft
est.jar:/home/jblack/src/java/testdist/AmazonWebServices.jar:/home/jblack/src/java/testdist/epicjsf.jar:/home/jblack/src/java/testdist/emaillookup.jar'
    [junit] 'org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner'
    [junit] 'edu.usf.acomp.jsf.nams.JSFCollegesTest'
    [junit] 'filtertrace=false'
    [junit] 'haltOnError=false'
    [junit] 'haltOnFailure=false'
    [junit]
'formatter=org.apache.tools.ant.taskdefs.optional.junit.SummaryJUnitResultFormatter'
    [junit] 'showoutput=true'
    [junit]
'formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter'
    [junit]
'formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,/opt/home/jblack/src/java/testdir/data/TEST-edu.usf.acomp.jsf.nams.JSFCollegesTest.xml'
    [junit]
'propsfile=/opt/home/jblack/src/java/junit2112552541.properties'
    [junit]
    [junit] The ' characters around the executable and arguments are
    [junit] not part of the command.
    [junit] testGetCollegeOption
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.606 sec
    [junit] Testsuite: edu.usf.acomp.jsf.nams.JSFCollegesTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.606 sec
 [junit] ------------- Standard Output ---------------
    [junit] testGetDepartmentOption
    [junit] ------------- ---------------- ---------------
    [junit] Testcase:
testGetDepartmentOption(edu.usf.acomp.jsf.nams.JSFDepartmentsTest): Caused
an ERROR
    [junit] edu/usf/acomp/jsf/nams/JSFDepartments
    [junit] java.lang.NoClassDefFoundError:
edu/usf/acomp/jsf/nams/JSFDepartments
    [junit] at
edu.usf.acomp.jsf.nams.JSFDepartmentsTest.testGetDepartmentOption(JSFDepartmentsTest.java:34)
    [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [junit] at java.lang.reflect.Method.invoke(Method.java:324)
    [junit] at junit.framework.TestCase.runTest(TestCase.java:154)
    [junit] at junit.framework.TestCase.runBare(TestCase.java:127)
    [junit] at junit.framework.TestResult$1.protect(TestResult.java:106)
    [junit] at
junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit] at junit.framework.TestResult.run(TestResult.java:109)
    [junit] at junit.framework.TestCase.run(TestCase.java:118)
    [junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [junit] at junit.framework.TestSuite.run(TestSuite.java:203)
    [junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:325)
    [junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:536)
    [junit] TEST edu.usf.acomp.jsf.nams.JSFDepartmentsTest FAILED Override
ignored for property test.failed

dante.acomp.usf.edu% jar -tf testdist/epicjsf.jar META-INF/
META-INF/MANIFEST.MF edu/ edu/usf/ edu/usf/acomp/ edu/usf/acomp/jsf/
edu/usf/acomp/jsf/nams/ edu/usf/acomp/jsf/nams/JSFDepartments.class
edu/usf/acomp/jsf/nams/JSFColleges.class edu/usf/acomp/jsf/mail/
edu/usf/acomp/jsf/mail/MailClient.class META-INF/INDEX.LIST


    <target depends="init,test-compile,test-jar"
            description="Run Axis tests"
            name="runtests"
            unless="tests.uptodate">
        <junit dir="testdir/classes"
               filtertrace="false"
               haltonerror="false"
               haltonfailure="false"
               includeantruntime="false"
               newenvironment="true"
               errorProperty="test.failed"
               failureProperty="test.failed"
               fork="true"
               maxmemory="400M"
               showoutput="true"
               printsummary="yes">
            <formatter type="brief" usefile="false"/>
            <formatter type="xml"/>
            <classpath>
              <fileset dir="/usr/java/jre/lib/ext">
                <include name="*.zip" />
              </fileset>
              <fileset dir="/home/jblack/.netbeans/3.4/modules">
                <include name="*.jar" />
              </fileset>
              <fileset dir="/home/jblack/.netbeans/3.4/modules/ext">
                <include name="*.jar" />
              </fileset>
              <fileset dir="/home/jblack/src/java/BB6_jars">
                <include name="*.jar" />
              </fileset>
              <fileset dir="/home/jblack/src/java/jsf_jars">
                <include name="*.jar" />
              </fileset>
              <fileset dir="/home/jblack/src/java/axislibs">
                <include name="*.jar" />
              </fileset>
              <fileset dir="/home/jblack/src/java/testdist">
                <include name="*.jar" />
              </fileset>
            </classpath>
            <batchtest todir="${test.data.dir}">
              <fileset dir="${test.classes.dir}">
                <include name="edu/**/jsf/**/*Test.class"/>
              </fileset>
            </batchtest>
        </junit>
        <delete>
            <fileset dir="${test.html.dir}">
              <include name="**/*"/>
            </fileset>
        </delete>
        <junitreport todir="${test.data.dir}">
          <fileset dir="${test.data.dir}">
            <include name="TEST-*.xml"/>
          </fileset>
          <report format="frames" todir="${test.html.dir}"/>
        </junitreport>
        <echo message="last build failed tests"
            file="${test.last.failed.file}"/>
        <fail if="test.failed">
          Unit tests failed. check log or reports for details
        </fail>
        <!-- Remove test failed file, as these tests succeeded -->
        <delete file="${test.last.failed.file}"/>
    </target>




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message