ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Help me with Junit + Ant
Date Tue, 08 Jul 2003 16:49:06 GMT
That class should be in the optional.jar.
Is it included there?


Jan

> -----Urspr√ľngliche Nachricht-----
> Von: Aloizio Pereira da Silva [mailto:aloizio@dcc.ufmg.br]
> Gesendet am: Dienstag, 8. Juli 2003 18:46
> An: Ant Users List; jacqui@groxis.com
> Betreff: RE: Help me with Junit + Ant
> 
> Hi  
> 
> Everything are Ok. (optional.jar and Junit.jar)
> 
> The following mensage appears:
> 
> 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.TesteControleR
> elacaoEntidadesAIM
>     [junit]
> java.lang.NoClassDefFoundError: 
> org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner
>     [junit] Exception in thread "main"
> 
> BUILD FAILED
> file:M:/Aloizio/JAVADOC/synergia_checkstyle/build.xml:216: Test
> teste.siace.remessaanual.administracao.contr
> ole.TesteControleRelacaoEntidadesAIM failed
> 
> Total time: 2 seconds
> 
> 
>             *****************************************************
>             *         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     *
>             
> *****************************************************         
>                  
> 
> On Tue, 8 Jul 2003, Jacqui Guerrero wrote:
> 
> > Go into your ant/lib directory and make sure you have: an 
> optional.jar file
> > there.  Also, you will also need to: 1) add the junit.jar 
> you are using  2)
> > include ANT's classpath in the classpath used for your junit task.
> > 
> > <classpath>
> > 	<path refid="test.classpath" />
> > 	<!-- include ANT's classpath -->
> > 	<pathelement path="${java.class.path}"/>
> > </classpath>
> > 
> > -----Original Message-----
> > From: Aloizio Pereira da Silva [mailto:aloizio@dcc.ufmg.br]
> > Sent: Tuesday, July 08, 2003 9:22 AM
> > To: Ant Users List; jacqui@groxis.com
> > Subject: RE: Help me with Junit + Ant
> > 
> > 
> > > In looking at the no class def error:
> > >
> > > java.lang.NoClassDefFoundError:  
> siace/teste/junit/framework/TestCase
> > >
> > > it looks like you wrote your own TestCase class?  Do you 
> have this class
> > > included in your classpath?
> > 
> > No. I did not write my own TestCase class.
> > 
> > 
> > 
> > > Also, look in your ant etc directory and check to make 
> sure you have the
> > > .xsl stylesheets there.
> > 
> > Yes. I have.
> > 
> > The code generates xml files and the report html, but every 
> classes show
> > error like this below:
> > 
> >    [junit]
> > java.lang.NoClassDefFoundError:
> > org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner
> >    [junit] Exception in thread "main"
> >    [junit] TEST
> > 
> teste.siace.remessaanual.prestacao.demonstrativo.controle.Test
> eControleDeduc
> > aoGastosPessoal
> > ntidade FAILED
> >    [junit] Running
> > 
> teste.siace.remessaanual.prestacao.demonstrativo.controle.Test
> eControleDeduc
> > aoGastosPess
> > alEntidade2000
> >    [junit]
> > java.lang.NoClassDefFoundError:
> > org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner
> >    [junit] Exception in thread "main"
> >    [junit] TEST
> > 
> teste.siace.remessaanual.prestacao.demonstrativo.controle.Test
> eControleDeduc
> > aoGastosPessoal
> > ntidade2000 FAILED
> >    [junit] Running
> > 
> teste.siace.remessaanual.prestacao.demonstrativo.controle.Test
> eControleDeduc
> > aoGastosPess
> > alEntidade2001
> >    [junit]
> > java.lang.NoClassDefFoundError:
> > org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner
> >    [junit] Exception in thread "main"
> >    [junit] TEST
> > 
> teste.siace.remessaanual.prestacao.demonstrativo.controle.Test
> eControleDeduc
> > aoGastosPessoal
> > ntidade2001 FAILED
> >    [junit] Running
> > 
> teste.siace.remessaanual.prestacao.demonstrativo.controle.Test
> eControleDeduc
> > aoGastosPess
> > alEntidade2002
> >    [junit]
> > java.lang.NoClassDefFoundError:
> > org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner
> >    [junit] Exception in thread "main"
> >    [junit] TEST
> > 
> teste.siace.remessaanual.prestacao.demonstrativo.controle.Test
> eControleDeduc
> > aoGastosPessoal
> > ntidade2002 FAILED
> >    [junit] Running
> > 
> teste.siace.remessaanual.prestacao.demonstrativo.controle.Test
> eControleDeduc
> > aoGastosPess
> > [junitreport] Using Xalan version: Xalan Java 2.2.D11
> > [junitreport] Transform time: 563ms
> > 
> > BUILD SUCCESSFUL
> > Total time: 55 seconds
> > 
> >             *****************************************************
> >             *         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     *
> >             *****************************************************
> > 
> > On Tue, 8 Jul 2003, Jacqui Guerrero wrote:
> > 
> > > In looking at the no class def error:
> > >
> > > java.lang.NoClassDefFoundError:  
> siace/teste/junit/framework/TestCase
> > >
> > > it looks like you wrote your own TestCase class?  Do you 
> have this class
> > > included in your classpath?
> > >
> > > Also, look in your ant etc directory and check to make 
> sure you have the
> > > .xsl stylesheets there.
> > >
> > > Thanks,
> > > Jacqui
> > >
> > > -----Original Message-----
> > > From: Aloizio Pereira da Silva [mailto:aloizio@dcc.ufmg.br]
> > > Sent: Tuesday, July 08, 2003 8:57 AM
> > > 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.TesteControleR
> elacaoEntidade
> > > sAIM
> > >     [junit] Tests run: 5, Failures: 5, Errors: 0, Time 
> elapsed: 0,156 sec
> > >     [junit] TEST
> > >
> > 
> teste.siace.remessaanual.administracao.controle.TesteControleR
> elacaoEntidade
> > > sAIM
> > > FAILED
> > >     [junit] Running
> > >
> > 
> teste.siace.remessaanual.administracao.controle.TesteControleR
> elacaoEntidade
> > > sAIM2000E2001
> > >     [junit] Tests run: 5, Failures: 5, Errors: 0, Time 
> elapsed: 0,031 sec
> > >     [junit] TEST
> > >
> > 
> teste.siace.remessaanual.administracao.controle.TesteControleR
> elacaoEntidade
> > > sAIM2000E2001
> > > FAILED
> > >     [junit] Running
> > >
> > 
> teste.siace.remessaanual.administracao.controle.TesteControleR
> elacaoEntidade
> > > sAIM2002
> > >     [junit] Tests run: 5, Failures: 5, Errors: 0, Time 
> elapsed: 0,031 sec
> > >     [junit] TEST
> > >
> > 
> teste.siace.remessaanual.administracao.controle.TesteControleR
> elacaoEntidade
> > > sAIM2002
> > > 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(DelegatingMeth
> odAccessorImpl
> > > .java:25)
> > >         at java.lang.reflect.Method.invoke(Method.java:324)
> > >         at
> > >
> > 
> org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClas
> sLoader.java:1
> > > 002)
> > >         at
> > >
> > 
> org.apache.tools.ant.AntClassLoader.findClassInComponents(AntC
> lassLoader.jav
> > > a:1064)
> > >         at
> > > 
> org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.j
> ava: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
> > >
> > >
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > 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
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message