test.qa-functional.cp.extra (or run.cp.extra) not loading JAR at runtime for module functional tests

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

test.qa-functional.cp.extra (or run.cp.extra) not loading JAR at runtime for module functional tests

I wish to do functional testing on a module-suite. I've get NBModuleSuite, JellyTools and Jemmy all working, and have the qa-functional directories all set up. The tests run okay to do basic stuff, HOWEVER:

I wish to use an external non-module test-library JAR to perform verification point checks.

How do I get a non-module external test-library JAR to be loaded when starting functional tests in a Netbeans Module-suite?
Basically, how does "test.qa-functional.cp.extra=" work?

- When I add a jar file (ObjectTestData.jar) so as to include its capabilities into the test-case methods, the jar/classes are not loaded for runtime. For compile time I've set "test.qa-functional.cp.extra" in project.propereties with success for compile only:

--- test.qa-functional.cp.extra=test/qa-functional/aids/tt_objecttestdata.jar
----- this setting allows the compile for verification point, but at runtime the classes for ObjectTestData are not loaded so test-cases fail. (See Testcase exception below)

Search efforts
Looking through netbeans-forums, general web-search and netbeans.org it suggests that test.qa-functional.cp.extra should load the extras.

I saw a reference to project.xml needing some settings but there is no documentation I can find.

Other info/alternatives tried
1) I've used "test.qa-functional.run.cp.extra=test/qa-functional/aids/tt_objecttestdata.jar" to,  but still fails

2) I moved the test cases to unit test directories, and it too has the same problem (test.unit.cp.extra, test.unit.run.cp.extra settings used instead)

3) I've access to the ObjectTestData source code and copied it to qa-functional directories. This works as the classes are compiled in to build/test/classes.
----- however, the src code is not open-source so may not be included in the module-suite test source code

4) Created a library module with the JAR wrapped, however it is packaged with the module-suite (At 6MB for the library JAR and pnly needed for testing is not a solution.

Testcase exception
Testcase: prepareLaunchIde(packg.testcases.SingleSE): Caused an ERROR
java.lang.NoClassDefFoundError: org/jtestdb/objecttestdata/ObjectTestData
        at packg.testcases.SingleSE.prepareLaunchIde(SingleSE.java:85)
        at org.netbeans.jellytools.JellyTestCase.runTest(JellyTestCase.java:179)
        at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:102)
        at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:478)
        at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:404)
        at java.lang.Thread.run(Thread.java:748)
        at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:224)
        at org.netbeans.ModuleManager$SystemClassLoader.loadClass(ModuleManager.java:779)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Caused by: java.lang.ClassNotFoundException: org.jtestdb.objecttestdata.ObjectTestData
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:222)