ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <anto...@antbuild.com>
Subject Re: problem getting junit task to find classes
Date Wed, 30 Jul 2003 12:59:35 GMT
Make a further test.
Define your classpath in the top of your build.xml with
<path id="test.classpath">
....
</path>

And try to find with the available task the class which junit cannot find.

Otherwise I do not have a clue.

Antoine


"James Black" <jblack@ieee.org> schrieb im Newsbeitrag
news:3F27BE25.7090301@ieee.org...
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:/h
ome/jblack/.netbeans/3.4/modules/jspdebug.jar:/home/jblack/.netbeans/3.4/mod
ules/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:/hom
e/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/.netbea
ns/3.4/modules/comboswitcher.jar:/home/jblack/.netbeans/3.4/modules/ext/jemm
y.jar:/home/jblack/.netbeans/3.4/modules/ext/jelly2-nb.jar:/home/jblack/.net
beans/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:/hom
e/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/jbl
ack/src/java/jsf_jars/commons-digester.jar:/home/jblack/src/java/jsf_jars/co
mmons-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:/ho
me/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/axisli
bs/axis.jar:/home/jblack/src/java/axislibs/commons-discovery.jar:/home/jblac
k/src/java/axislibs/commons-logging.jar:/home/jblack/src/java/axislibs/jaxrp
c.jar:/home/jblack/src/java/axislibs/log4j-1.2.8.jar:/home/jblack/src/java/a
xislibs/saaj.jar:/home/jblack/src/java/axislibs/wsdl4j.jar:/home/jblack/src/
java/axislibs/activation.jar:/home/jblack/src/java/axislibs/mail.jar:/home/j
black/src/java/axislibs/mailapi.jar:/home/jblack/src/java/axislibs/xmlsec.ja
r:/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/axislib
s/mysql_uncomp.jar:/home/jblack/src/java/axislibs/smtp.jar:/home/jblack/src/
java/testdist/acompaxis.jar:/home/jblack/src/java/testdist/graphics.jar:/hom
e/jblack/src/java/testdist/epicclient.jar:/home/jblack/src/java/testdist/epi
cserver.jar:/home/jblack/src/java/testdist/epic.jar:/home/jblack/src/java/te
stdist/numericalmethods.jar:/home/jblack/src/java/testdist/epictest.jar:/hom
e/jblack/src/java/testdist/graphicstest.jar:/home/jblack/src/java/testdist/l
mscommon.jar:/home/jblack/src/java/testdist/axistest.jar:/home/jblack/src/ja
va/testdist/epicjsft
est.jar:/home/jblack/src/java/testdist/AmazonWebServices.jar:/home/jblack/sr
c/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.SummaryJUnitResultFo
rmatter'
    [junit] 'showoutput=true'
    [junit]
'formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultForm
atter'
    [junit]
'formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormat
ter,/opt/home/jblack/src/java/testdir/data/TEST-edu.usf.acomp.jsf.nams.JSFCo
llegesTest.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(JSFDepartm
entsTest.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(JUnitTestRu
nner.java:325)
    [junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestR
unner.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