Problems calling PDE Plugin JUnit4 test

8 views
Skip to first unread message

Niklaus Giger

unread,
Feb 23, 2011, 2:15:48 AM2/23/11
to us...@buildr.apache.org, build...@googlegroups.com

Hi

buildr & buildr4osgi begin to rock for me! Thanks to everybody who worked hard for this really nice build tool!

I was unable however to run Eclipse "PDE Unit Test" under buildr/buildr4osgi.

Did anybody solve this problem and would be willing to share his/her experience?

So far I managed to set up a CI site for www.elexis.ch under http://ngiger.dyndns.org/jenkins/job/Elexis-Buildr/

The pure JUnit4 tests are no problem.

Most of our unit test however depend on PDE plugin junit tests. I therefore started my small personal project into extending java/tests.rb for it.

I am however unable to launch the pde test. Eclipse calls the PDE test like this:

java

-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:60541

-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx512m

-Dch.elexis.username=007 -Dch.elexis.password=topsecret

-Delexis-run-mode=RunFromScratch -Dfile.encoding=UTF-8

-classpath /usr/lib/eclipse/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar org.eclipse.equinox.launcher.Main

-os linux -ws gtk -arch x86_64 -nl de_CH

-consoleLog -version 3 -port 32998

-testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader

-loaderpluginname org.eclipse.jdt.junit4.runtime

-testNameFile /tmp/testNames6228706496704296453.txt

-application org.eclipse.pde.junit.runtime.uitestapplication

-product ch.elexis.ElexisProduct

-testpluginname ch.elexis

<..>

I tried to setup an ant task like this:

searchName = "#{ENV['OSGi']}/plugins/org.eclipse.equinox.launcher_*.jar"

ant.taskdef :name=>'java', :classname=>'org.eclipse.equinox.launcher.Main', :classpath=>Dir.glob(searchName).join(File::PATH_SEPARATOR)

But when I run it, I get the following error:

> Loaded from

> /opt/elexis-all-in-one/helios-SR1/eclipse/plugins/org.eclipse.equinox.laun

> cher_1.1.0.v20100507.jar

> org/eclipse/equinox/launcher/Main$SplashHandler.class Class

> org.eclipse.equinox.launcher.Main$SplashHandler loaded from ant loader

> (parentFirst) No public execute() in class

> org.eclipse.equinox.launcher.Main

> E, [2011-02-18T12:49:10.987000 #18921] ERROR -- : Error instantiating

> 'taskdef' task: org.apache.tools.ant.BuildException: No public execute()

> in class org.eclipse.equinox.launcher.Main Test framework error:

> org.apache.tools.ant.BuildException: No public execute() in class

> org.eclipse.equinox.launcher.Main

> org/apache/tools/ant/TaskAdapter.java:97:in `checkTaskClass'

> org/apache/tools/ant/TaskAdapter.java:113:in `checkProxyClass'

> org/apache/tools/ant/AntTypeDefinition.java:263:in `checkClass'

> org/apache/tools/ant/taskdefs/Definer.java:614:in `addDefinition'

> org/apache/tools/ant/taskdefs/Definer.java:239:in `execute'

> org/apache/tools/ant/UnknownElement.java:291:in `execute'

> sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0'

> sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke'

> sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke'

Could anybody give me a hint howto solve this problem? If yes, I will try to extend the buildrs/tests.rb with the support for this feature and submit a patch.

Best regards

Niklaus Giger

Antoine Toulme

unread,
Feb 23, 2011, 2:55:11 AM2/23/11
to us...@buildr.apache.org, Niklaus Giger, build...@googlegroups.com
By default, we don't support PDE-like unit tests. They are very particular tests, they will only work with an Eclipse launcher indeed.
You could look at the tycho integration test plugin to see how they run it with PDE.
It's probably quite some work, but would be a very nice achievement.

Antoine
Reply all
Reply to author
Forward
0 new messages