ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Hatton" <khat...@axiomsystems.com>
Subject RE: Help me with Junit + Ant
Date Tue, 08 Jul 2003 16:04:25 GMT
Try adding fork="yes" to your <junit> tag.
It often helps.

Keith


-----Original Message-----
From: Aloizio Pereira da Silva [mailto:aloizio@dcc.ufmg.br]
Sent: 08 July 2003 16:57
To: user@ant.apache.org
Subject: Help me with Junit + Ant


I am trying to run my unit test in the project, but it does not work. I
have two directories. The first has the project classes (.class) and the
second has the the project tests classes (.class). In this last directory
I have one classe named Testador.class which is responsible for call all
the test class. I use the above code:
 
 
 
   <target name="executarTestes"  description="executa testes de unidade
para um projeto especifico">
     <echo>executando teste de unidade</echo>
    <junit printsummary="true"  haltonfailure="false">
      <classpath refid="test.classpath" />
      <classpath location="C:/Local/JBuilder4/lib/Synergia/JUnit.jar" />  
      <classpath location="build/lib/siace.jar" />  
      <classpath location="build/testcases" />  
      <classpath location="build/classes" />
       <formatter type="xml" />
      <!-- <test name="teste.siace.remessaanual.Testador"/> -->
     <batchtest>
            <fileset
dir="${build}/testcases" includes="**/Teste*.class" />
      </batchtest> 
    </junit>
 
    <junitreport>
      <fileset dir=".">
        <include name="TEST-*.xml"/>
      </fileset>
      <report format="noframes" styledir="${ant15.dir}/etc"/>
    </junitreport>
 
   </target>

But it is displayed the following message:
 
M:\Aloizio\JAVADOC\synergia_checkstyle>ant executarTestes
Buildfile: build.xml
  [taskdef] Could not load definitions from resource
checkstyletask.properties. It could not be found.
 
executarTestes:
     [echo] executando teste de unidade
    [junit] Running
teste.siace.remessaanual.administracao.controle.TesteControleRelacaoEntidadesAIM
    [junit] Tests run: 5, Failures: 5, Errors: 0, Time elapsed: 0,156 sec
    [junit] TEST
teste.siace.remessaanual.administracao.controle.TesteControleRelacaoEntidadesAIM
FAILED
    [junit] Running
teste.siace.remessaanual.administracao.controle.TesteControleRelacaoEntidadesAIM2000E2001
    [junit] Tests run: 5, Failures: 5, Errors: 0, Time elapsed: 0,031 sec
    [junit] TEST
teste.siace.remessaanual.administracao.controle.TesteControleRelacaoEntidadesAIM2000E2001
FAILED
    [junit] Running
teste.siace.remessaanual.administracao.controle.TesteControleRelacaoEntidadesAIM2002
    [junit] Tests run: 5, Failures: 5, Errors: 0, Time elapsed: 0,031 sec
    [junit] TEST
teste.siace.remessaanual.administracao.controle.TesteControleRelacaoEntidadesAIM2002
FAILED
 

BUILD FAILED
java.lang.NoClassDefFoundError: siace/teste/junit/framework/TestCase
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
        at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:1002)
        at
org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1064)
        at
org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1036)
        at
org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:931)
 
Could someone help me?

            *****************************************************
            *         Federal University of Minas Gerais        *
            *          Department of Computer Science          *
            *         Master Degree in Computer Science         *
            *                                                   *
            *                 Aloizio Silva                     *
            *         http://www.dcc.ufmg.br/~aloizio          *
            *                                                   *
            *      Mobile Computer and Network Optimization     *
            *****************************************************                        
 


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


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


Mime
View raw message