Hey Everyone,
I am working on an assignment that I have to test using Junit.
Junit is installed on my machine I believe, because when I type
it spits out many directories that have junit in it.
However, I am supposed to be working with the version 4.5 from
I found the installation instructions, however I am having a hard time following them.
Below are the installation steps for installing JUnit:
1. unzip the junit4.6.zip file
2. add junit-4.6.jar to the CLASSPATH. For example: set classpath=%classpath%;INSTALL_DIR\junit-4.6.jar;INSTALL_DIR
3. test the installation by running java org.junit.runner.JUnitCore org.junit.tests.AllTests.
Notice: that the tests are not contained in the junit-4.6.jar but in the installation directory directly. Therefore make sure that the installation directory is on the class path
Important: don't install junit-4.6.jar into the extension directory of your JDK installation. If you do so the test class on the files system will not be found.
I downloaded and extracted the zip file to my home directory and tried
Code:
export JUNIT=/home/joost/Downloads/Junit/junit4.5
however, when I try to compile something using javac it still tells me
Code:
TestPointT.java:7: package org.junit does not exist
import org.junit.*;
^
TestPointT.java:8: package org.junit does not exist
import static org.junit.Assert.*;
^
I was told that I need to edit the ".cshrc" file, but I think that this is for a different shell isn't it? I use bash, so would I need to edit .bashrc?
EDIT:
I tried adding the line
set classpath=%classpath%;/home/joost/Downloads/Junit/junit4.5\junit-4.5.jar;/home/joost/Downloads/Junit
to my bashrc file, but that didn't help.
I still get the following error
Code:
javac -g TestEdgeT.java
TestEdgeT.java:7: package org.junit does not exist
import org.junit.*;
^
TestEdgeT.java:8: package org.junit does not exist
import static org.junit.Assert.*;
^
2 errors
make: *** [TestEdgeT.class] Error 1
Thanks - cc7
Bookmarks