[jbosstools-dev] Problem with JUnit test execution with maven

Mickael Istria mistria at redhat.com
Fri May 16 13:26:46 EDT 2014


On 05/16/2014 07:02 PM, Rob Cernich wrote:
> This is a shot in the dark, but you might verify that the plugins 
> providing the model provider are listed as dependencies for the test 
> plugin.  My experience has shown that the test environment only 
> includes hard dependencies, so if you're relying on something that has 
> a soft link (e.g. anything contributed through an extension point), 
> you need to make sure the plugin making the contribution (e.g. 
> implementing the extension point) is included in the dependencies list 
> for your test plugin.  It probably works fine in your dev env because 
> Eclipse is using the entire set of plugins available (i.e. target 
> platform + workspace plugins).
+1
This seems to be what I (or maybe everyone) call a "behavioral" 
dependency: it's not necessary in order to compile or execute code, but 
it is necessary in order to have the test actually testing what's expected.
So you should start by finding out which bundle is required for that 
test to work, and then either add it as a requirement in the MANIFEST.MF 
or configure tycho-surefire-plugin to add the dependency. My preference 
would go for the MANIFEST.MF since it also gives you the guarantee that 
this test would work with any tools respecting OSGi.

In order to debug with tycho-surefire-plugin just add a -DdebugPort=8000 
property to your mvn command-line and then connect to JVM on port 8000 
as a Remote application in Eclipse ( 
https://github.com/jbosstools/jbosstools-devdoc/blob/master/debugging/debug_Tycho_tests.md#connecting-surefire-test-execution-to-eclipse-debugger-allows-to-put-breakpoints-in-maven-tests 
(.

If you want to simulate an environment with PDE tests that looks like 
the one of tycho-surefire-plugin, you should go to the Test 
Configuration and configure your test by unselecting all bundles, then 
selecting only your test bundle, and then clicking the "Add Required 
Plugins" button that would compute a minimal runtime for this test. You 
may need to add some extra stuff (such as org.eclipse.equinox.ds)

HTH
-- 
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets 
<http://twitter.com/mickaelistria>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jbosstools-dev/attachments/20140516/8b422d88/attachment.html 


More information about the jbosstools-dev mailing list