开发者

[TestNG][Jar] Set Classpath in Manifest (Class-Path) -- classpath is ignored?

I'm trying to run a simple TestNG test case residing within a jar file, which contains the test and manifest:

ex.) Test.jar contains: { META-INF\ META-INF\MANIFEST.MF tests\ tests\Test01.class }

I am trying to run it using the command: java org.testng.TestNG - testjar Test.jar testng.xml

Where a folder contains (all in the same directory): Test.jar testng.xml testng-6.1.1.jar

And Manifest contains (w/ a line-break at the end): Manifest-Version: 1.0 Created-By: Willie Owens Class-Path: testng-6.1.1.jar Test.jar .

And I get a NoClassDefFoundError: org/testng/TestNG. Could开发者_如何学Go not find main class.

If I specify the classpath using -cp after "java" (Ex. java -cp testng-6.1.1.jar;Test.jar org.testng.TestNG -testjar Test.jar testng.xml) it works, but I want this information in the manifest. What am I doing wrong here?

Also, I've tried every variation I could think of when typing in the Class-Path, such as: ./testng-6.1.1.jar .\testng-6.1.1.jar ...etc..

HELP


Executing test-jar is not that complex with testNg please refer [1] for more detail.

lease let me know if you find any pitfalls with it .

[1] http://dharshanaw.blogspot.com/2012/10/how-to-execute-testng-tests-in-side.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜