1

I am using AIX machine to run few JUnit tests. These tests work fine in eclipse using JUnit for Windows and Linux platforms. I am trying to run these tests using JUnit command line and I am getting following error

# java org.junit.runner.JUnitCore testName
JUnit version 4.8.1
Could not find class: testName

Time: 0.012

OK (0 tests)

File is present at that location as testName.java. I have set my environment variables in /etc/profile file. These are my environment variables.

export CLASSPATH=/usr/junit/junit-4.8.1.jar:/usr/junit/

export PATH=$PATH=$PATH:/usr/junit/junit-4.8.1.jar:/usr/junit/

On AIX machine when I try to test JUnit using following code, it gives me same failure.

# java org.junit.runner.JUnitCore org.junit.tests.AllTests
JUnit version 4.8.1
Could not find class: org.junit.tests.AllTests

Time: 0.012

OK (0 tests)

AllTests class was not present in default location provided on JUnit website http://junit.sourceforge.net/doc/faq/faq.htm#tests_1

# find / -name "*AllTests*"
/usr/junit/org/junit/runners/AllTests.class

What could be wrong?

4

1 回答 1

0
org.junit.tests.AllTests

在错误的地方,它在这里

/usr/junit/org/junit/runners/AllTests.class

它应该是

/usr/junit/org/junit/tests/AllTests.class
于 2013-01-03T20:53:12.370 回答