I've been following the steps of this very helpful guide on installing junit, but I've run into a problem. I've created this trivial test case as instructed:
import junit.framework.TestCase;
public class TestBasic extends TestCase{
public void testTrue(){
assertTrue(true);
}
}
When I try to compile it, this happens:
$ javac TestBasic.java
TestBasic.java:1: error: package junit.framework does not exist
import junit.framework.TestCase;
^
TestBasic.java:3: error: cannot find symbol
public class TestBasic extends TestCase{
^
symbol: class TestCase
TestBasic.java:5: error: cannot find symbol
assertTrue(true);
^
symbol: method assertTrue(boolean)
location: class TestBasic
3 errors
What is the reason for this?
More info:
$ echo $CLASSPATH
:/Users/sahandzarrinkoub/java/junit-X.Y.jar:/Users/sahandzarrinkoub/java/hamcrest-core-XX.YY.jar
Inside .bash_profile:
# Java
export JAVA_HOME=/Library/Java/Home
export JUNIT_HOME="$HOME/java"
export PATH="$PATH:$JUNIT_HOME"
export CLASSPATH="$CLASSPATH:$JUNIT_HOME/junit-X.Y.jar:$JUNIT_HOME/hamcrest-core-XX.YY.jar"
contents of ~/java:
$ cd ~/java
$ ls
TestBasic.java hamcrest-core-1.3.jar junit-4.12.jar