Can not test the installation of junit..
hi im janaka
i tried to do the unit testing with JBuilder.
download and install Junit
set the class path.
but according to the readme file, i was unable to test my installation.
these are that instructions.
addjunit-4.1.jar to the CLASSPATH. For example: set classpath=%classpath%;INSTALL_DIR\junit-4.1.jar;INSTALL_DIR
test the installation by running java org.junit.runner.JUnitCore org.junit.tests.AllTests.
the second one can not done.
if anyone can help me
thanks you......
rpjanaka
Junior Poster in Training
69 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
when run use run command on command prompt in windows
- java org.junit.runner.JUnitCore org.junit.tests.AllTests.
the following error will give
Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/runner/JUni
tCore
rpjanaka
Junior Poster in Training
69 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
Sounds like it may be a classpath (probably is) a classpath problem. Please state exactly where you placed the jar and post your complete classpath. It may also be that this package also requires another package that either don't have installed, or is not contained on your class path. Check the documentation and your install for this possibility.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
junit was install into C:\junit4.1 directry and set the class path as "C:\junit4.1\junit-4.1.jar" . but still unable to run the test command
java org.junit.runner.JUnitCore org.junit.tests.AllTests
still it will give the error as
Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/runner/JUni
tCore
rpjanaka
Junior Poster in Training
69 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
im janaka priyadarshana,
when im going to create a test class with "JBuilder" it did not allow to import the junit pacage.
it was indicated an error for the follwing line.
import junit.framework.*;
if anyone know the reason please informe me.
thank you......
rpjanaka
Junior Poster in Training
69 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
And ClassNotFound or NoClassDefFound is always a Classpath problem or it simply does not exist. Check that your JBuilder configuration also contains this jar as a library or external jar.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
And like I said, it is a CLASSPATH (not PATH) problem.
Use "java -cp .: Classname"
On windows you may need to replace ".:" with ".;"
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
oh......i have got success in this problem with windows machien
first set the classpath as follow
classpath
C:\junit4.1\junit-4.1.jar
then please remember to restart your machiene
most probably then you will be able to solve the problem
rpjanaka
Junior Poster in Training
69 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
doesn't matter. As long as junit.jar and the test classes both are on your classpath they'll be found.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
why should we help a thread hijacker who resurrects age old threads rather than starting its own?
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337