You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following is the explanation of testng.test.classpath from TestNG document.
If this property is set, TestNG will use it to look for your test classes instead of the class path. This is convenient if you are using the package tag in your XML file and you have a lot of classes in your classpath, most of them not being test classes.
However, it doesn't search the directory specified in testng.test.classpath during runtime. So no test cases are run.
In my test, there are two test classes in package test and testng.xml is as follow.
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="testing">
<test name="suite">
<packages>
<package name="test"/>
</packages>
</test>
</suite>
I was running into the same problem, but I think I figured out how to get it to work.
The key for me was to use the full path in the -Dtestng.test.classpath="<test-classpath>" argument.
Also, in the "Steps to reproduce" above, I think another problem is that you still need the test classpath in the "regular" Java classpath. Try something like this:
Issue
The following is the explanation of
testng.test.classpath
from TestNG document.However, it doesn't search the directory specified in
testng.test.classpath
during runtime. So no test cases are run.In my test, there are two test classes in package
test
andtestng.xml
is as follow.Steps to reproduce
mkdir out
javac src/test/*.java -d out
java -cp $CLASSPATH:out org.testng.TestNG testng.xml
testng.test.classpath
property:java -Dtestng.test.classpath="out/" org.testng.TestNG testng.xml
Observation: Four tests are run in Step 3. However, no tests are run in Step 4.
The text was updated successfully, but these errors were encountered: