• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

'junit' task problem

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can somebody help me here please, I'm trying to execute a JUnit suite of Test Classes and getting the below Error message. My Classpath is properly set, don't know what the problem here is.
Thanks in advance.
[junit] Running TestArrays
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit] Testsuite: TestArrays
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit] Caused an ERROR
[junit] TestArrays
[junit] java.lang.ClassNotFoundException: TestArrays
[junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
[junit] at java.security.AccessController.doPrivileged(Native Method)
[junit] at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
[junit] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:235)

My build file target script is this:
<target name="JUnitTesting" depends="compileTests">
<junit fork="false" haltonfailure="false" printsummary="true">

<jvmarg value="-classic"/>
<jvmarg value="-enableassertions"/>
<classpath>
<pathelement location="lib/xerces.jar" />
<pathelement location="lib/jakarta-regexp-1.3.jar" />
<pathelement location="lib/junit.jar" />
<pathelement location="lib/ant.jar" />
<pathelement location="lib/optional.jar" />
<pathelement location="lib/activation.jar" />
<pathelement location="lib/xalan.jar" />
<pathelement location="lib/ant-contrib-0.5.jar" />
<!--<pathelement path="${rep_dest}" />-->

</classpath>
<sysproperty key="user.timezone" value="GMT+05:30"/>
<sysproperty key="user.language" value="en"/>
<sysproperty key="user.country" value="US"/>

<formatter type="plain" usefile="false"/>


<batchtest>
<fileset dir="${src}/com/nds/platform/k3/development/java/util">
<include name="**/*Test*.java" />
<!--<filename name="**/*Test*.java"/>-->

</fileset>

</batchtest>

<!--<test name="com.nds.platform.k3.development.java.util.TestArrays" />-->



</junit>

</target>
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think ur TestArray class in not in the classpath ie ur classes dir is not in the classpath tags only jar files can be seen, better of using <path id="class.path"></path> and use as refid in classpath tag.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you find a solution to this?
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic