by Otisler » Mon Sep 24, 2007 12:39 pm
Hi, I'm actually still getting some problems, I though I'd fixed it, but its still erroring out.
Let me start from the begininng...
I looked at your examples on running an RCP From ant headless. I modified as little as possible to make it work with my RCP and tests. So I left the directory structure, links, output, everything, the same.
Now after I did this, everything was happy, until I wanted my testing app to reference some classes from my RCP.
When I did this I was getting NoClassDef found errors:
java.lang.NoClassDefFoundError: zbiide/views/SearchView at com.zbiide.autotesting.test.CommonFunctionality.deselectDebugPrinter(CommonFunctionality.java:203) at com.zbiide.autotesting.test.CommonFunctionality.tearDown(CommonFunctionality.java:142) at junit.extensions.UITestCaseCommon.access$101(UITestCaseCommon.java:26) at junit.extensions.UITestCaseCommon$1.run(UITestCaseCommon.java:140) at junit.extensions.core.SequenceRunner$1.run(SequenceRunner.java:69)
And to remedy this, I had to export the packages on my RCP plugin.xml
So I made my testing app depend on my RCP app and then I had to change the RCP app to export the packages (like we talked about in this thread)
After I did this, everything was happy again, when I ran this in eclipse.
When I did run it headless, I was getting errors everywhere saying my RCP app could not be resolved.
So now I had to modify my build.xml file on the testing side. So modifying the target
<target name="@dot" depends="init" unless="@dot" description="Create jar: com.zbiide.autotesting @dot.">
<delete dir="${temp.folder}/@dot.bin"/>
<mkdir dir="${temp.folder}/@dot.bin"/>
<path id="@dot.classpath">
<pathelement path="C:/Program Files/Eclipse/plugins/org.junit_3.8.1/junit.jar"/>
<pathelement path="C:/Program Files/Instantiations/WindowTester_v2.2.1/E-3.2/eclipse/plugins/com.windowtester.runtime_2.2.1/commonRuntime.jar"/>
....
I had to add the following element to the tag to link my test to the RCP
<pathelement path="D:/Software/ZbiIde/bin"/>
Which is the path to the class files of my RCP app
Now, after I add this to the classpath, my tests started running again and I thought it was OK, but when the tests finished, all of them failed out because I was getting NoClassDefFound errors again, (like when i forgot to export the packages) All of them failed because it was in the teardown.
java.lang.NoClassDefFoundError: zbiide/views/SearchView at com.zbiide.autotesting.test.CommonFunctionality.deselectDebugPrinter(CommonFunctionality.java:203) at com.zbiide.autotesting.test.CommonFunctionality.tearDown(CommonFunctionality.java:142) at junit.extensions.UITestCaseCommon.access$101(UITestCaseCommon.java:26) at junit.extensions.UITestCaseCommon$1.run(UITestCaseCommon.java:140) at junit.extensions.core.SequenceRunner$1.run(SequenceRunner.java:69)
And I can't link the testing app by placing the directory in the "plugins" directory of my RCP app because using your example, the two are completely separate (which is actually a lot better for testing)
It seems like the testing app doesn't know that my RCP plugin jar has exported those packages. Is there a different way I have to export that jar now to signify that those packages are exported?
So now I'm stuck here... any thoughts?
thanks