Ant not picking up the Junit File with Junit Target -
i'm using junit ant target running junits. when run junit file separately junit ran properly. when tried ant script junit test case not executed. showed me error as,
running x.simpletest [junit] testsuite: x.simpletest [junit] tests run: 1, failures: 0, errors: 1, time elapsed: 0 sec [junit] tests run: 1, failures: 0, errors: 1, time elapsed: 0 sec [junit] caused error [junit] x.simpletest [junit] java.lang.classnotfoundexception: x.simpletest [junit] @ java.lang.classloader.loadclass(classloader.java:252) [junit] @ java.lang.classloader.loadclassinternal(classloader.java:320) [junit] @ java.lang.class.forname0(native method) [junit] @ java.lang.class.forname(class.java:247) [junit] @ org.eclipse.ant.internal.launching.remote.eclipsedefaultexecutor.executetargets(eclipsedefaultexecutor.java:32) [junit] @ org.eclipse.ant.internal.launching.remote.internalantrunner.run(internalantrunner.java:424) [junit] @ org.eclipse.ant.internal.launching.remote.internalantrunner.main(internalantrunner.java:138) [junit] test x.simpletest failed
but class in classpath. please me in debugging in this.
my build file is,
<property file="build.properties" /> <path id="libirary"> <fileset dir="${lib}"> <include name="**.*jar" /> </fileset> </path> <path id="applicationclasspath"> <path id="classpath1" refid="libirary" /> <pathelement id="classpath2" location="${build.classes.dir}" /> </path> <path id="application.classpath"> <pathelement path="${java.class.path}" /> </path> <path id="class.path"> <fileset dir="${build.classes.dir}" /> </path> <property name="classpath" refid="applicationclasspath" /> <target name="clean"> <delete dir="${build.classes.dir}" /> <delete dir="${build.dir}" /> <delete dir="${dist.dir}" /> </target> <target name="init" depends="clean"> <mkdir dir="${build.classes.dir}" /> <mkdir dir="${dist.dir}" /> </target> <target name="compile" depends="init"> <javac encoding="iso-8859-1" destdir="${build.classes.dir}" srcdir="${src.dir}" debug="true" verbose="false"> <classpath> <path refid="libirary" /> </classpath> </javac> </target> <target name="jar" depends="compile"> <jar destfile="${dist.dir}/${jar.filename}.jar"> <fileset dir="${build.classes.dir}" /> <zipfileset dir="${lib}" includes="**/*.jar" /> <manifest> <attribute name="main-class" value="${main.file.name}" /> </manifest> </jar> </target> <target name="junit" depends="compile"> <echo message="classpath= ${classpath}" /> <junit printsummary="yes" description="true" filtertrace="yes" showoutput="yes"> <formatter type="plain" usefile="false" /> <classpath> <path refid="applicationclasspath" /> </classpath> <test name="x.simpletest" filtertrace="true"> </test> </junit> </target>
it resolved now. due classpath errors. thank response.
Comments
Post a Comment