Hi,
I clone the tycho demo application and tried itp02 for pom first dependency.
The demo works well following the instruction on
http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts.
Now I make some modification to the demo. I let PomFirst and ITP02 to be a registered service by its Activator. The IT02Test changed as the following:
public class ITP02Test {
@Test
public void basic() {
ITP02 testee = getITP02();
Assert.assertEquals("maven-bundle-plugin", testee.getMessage());
}
private ITP02 getITP02() {
ServiceReference<ITP02> ref = Activator.getContext().getServiceReference(ITP02.class ) ;
return Activator.getContext().getService(ref );
}
}
When run the test by Maven, I got the following error:
Tests in error:
basic(tycho.demo.itp02.bundle.tests.ITP02Test): A null service reference is not allowed.
I think this is because pomfirst-bundle and tycho.demo.itp02.bundle are not started (not console output from their activators), so the required services are not registered.
I cannot figure out why the two bundles are not started, by analyzing config.ini, the two bundles are listed in osgi.bundles, but without @4:start.
How to solve this issue?
Thanks for your help.
Guofeng