This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Starting JUnit - Testcenter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Starting JUnit - Testcenter" Watch "Starting JUnit - Testcenter" New topic
Author

Starting JUnit - Testcenter

Thomas Markl
Ranch Hand

Joined: Mar 08, 2001
Posts: 192
Hello, I downloaded JUnit from www.junit.org and want to start it. I added it to the class path:

set CLASSPATH=.;c:\Java\SCP2Certification\junit3\junit.jar
Below are the installation steps for installing JUnit:
1. unzip the junit.zip file
2. add junit.jar to the CLASSPATH. For example: set classpath=%classpath%;INSTALL_DIR\junit3\junit.jar
3. test the installation by using either the batch or the graphical TestRunner tool to run the tests that come with this release. All the tests should pass OK.
Notice: that the tests are not contained in the junit.jar but in the installation directory directly. Therefore make sure that the installation directory is on the class path
 for the batch TestRunner type:
java junit.textui.TestRunner junit.samples.AllTests
 for the graphical TestRunner type:
java junit.awtui.TestRunner junit.samples.AllTests
 for the Swing based graphical TestRunner type:
java junit.swingui.TestRunner junit.samples.AllTests
Important: don't install the junit.jar into the extension directory of your JDK installation. If you do so the test class on the files system will not be found.
Junit is installed on path c:\Java\SCP2Certification\junit3.8.1\junit3.8.1\junit.jar and my SDK1.4 is installed on c:\Java\SDK1.4
So junit is not installed as extention of SDK1.4.
When I start programm with java junit.textui.TestRunner junit.samples.AllTests
I get:
java junit.awtui.TestRunner junit.samples.AllTests
java.lang.NoClassDefFoundError: junit/awtui/TestRunner
Exception in thread "main"
mfg
Thomas Markl
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
In your post, your classpath setting doesn't match the location where the JUnit jar file is.
c:\Java\SCP2Certification\junit3.8.1\junit3.8.1\junit.jar
set CLASSPATH=.;c:\Java\SCP2Certification\junit3\junit.jar


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Starting JUnit - Testcenter