Discussion:
problems with Compendium bundles at tycho-surefire
(too old to reply)
Cristiano Gavião
2012-01-30 18:42:46 UTC
Permalink
Hi Igor,

I've improved my tests and added compendium bundles (Log, DS and CM) as
dependencies and add them to a proper start level to tycho-surefire
plugin [1] and [2].

At Tycho-Surefire, only org.eclipse.equinox.ds test statement is
passing, the same is not happen with others compendium bundles...

please, could you point me what am I doing wrong this time ? :(

This log shows me that a lot of bundles that are declared in test
dependencies are not being referenced and not being loaded. but there
are one specific bundle (market below) that is not declared being
[INFO] Adding repository (cached)
http://download.eclipse.org/tools/orbit/downloads/drops/S20120123151124/repository/
[DEBUG] Added p2 repository Orbit
(http://download.eclipse.org/tools/orbit/downloads/drops/S20120123151124/repository/)
[INFO] Adding repository (cached)
http://download.eclipse.org/releases/indigo
[DEBUG] Added p2 repository Eclipse
(http://download.eclipse.org/releases/indigo)
[DEBUG] Registered artifact repository
[DEBUG] Added 0 locally built units to the target platform
[DEBUG] Using test framework org.junit4
[DEBUG]
reference:file:/Users/cvgaviao/Development/C4Biz_Projects/OsgiUtilities/com.c4biz.osgiutils.assertions/target/com.c4biz.osgiutils.assertions-0.0.1-SNAPSHOT.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.junit/4.8.2.v4_8_2_v20110321-1705/org.junit-4.8.2.v4_8_2_v20110321-1705.jar
[DEBUG]
[DEBUG]
*[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/osgi.enterprise/4.2.0.v201108120515/osgi.enterprise-4.2.0.v201108120515.jar
*[DEBUG]
reference:file:/Users/cvgaviao/Development/C4Biz_Projects/OsgiUtilities/com.c4biz.osgiutils.configuration.manager.test.conf/target/com.c4biz.osgiutils.configuration.manager.test.conf-0.0.1-SNAPSHOT.jar
[DEBUG]
reference:file:/Users/cvgaviao/Development/C4Biz_Projects/OsgiUtilities/com.c4biz.osgiutils.tests
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest/1.1.0.v20090501071000/org.hamcrest-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.core.contenttype/3.4.100.v20110423-0524/org.eclipse.core.contenttype-3.4.100.v20110423-0524.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.preferences/3.4.1.R37x_v20110725/org.eclipse.equinox.preferences-3.4.1.R37x_v20110725.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.registry/3.5.101.R37x_v20110810-1611/org.eclipse.equinox.registry-3.5.101.R37x_v20110810-1611.jar
[DEBUG]
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.core.jobs/3.5.100.v20110404/org.eclipse.core.jobs-3.5.100.v20110404.jar
[DEBUG]
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.core.runtime.compatibility.auth/3.2.200.v20110110/org.eclipse.core.runtime.compatibility.auth-3.2.200.v20110110.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.app/1.3.100.v20110321/org.eclipse.equinox.app-1.3.100.v20110321.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.util/1.0.300.v20110502/org.eclipse.equinox.util-1.0.300.v20110502.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest.core/1.1.0.v20090501071000/org.hamcrest.core-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest.library/1.1.0.v20090501071000/org.hamcrest.library-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest.integration/1.1.0.v20090501071000/org.hamcrest.integration-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest.text/1.1.0.v20090501071000/org.hamcrest.text-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.2.0.v20110502/org.eclipse.equinox.launcher-1.2.0.v20110502.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/org/eclipse/tycho/org.eclipse.tycho.surefire.osgibooter/0.14.0-SNAPSHOT/org.eclipse.tycho.surefire.osgibooter-0.14.0-SNAPSHOT.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/org/eclipse/tycho/org.eclipse.tycho.surefire.junit4/0.14.0-SNAPSHOT/org.eclipse.tycho.surefire.junit4-0.14.0-SNAPSHOT.jar
[1] plugin configuration
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<includes>
<include>**/*Test.class</include>
</includes>
<failIfNoTests>false</failIfNoTests>
<showEclipseLog>true</showEclipseLog>
<!-- <argLine>${ui.test.vmargs}</argLine> -->
<bundleStartLevel>
<bundle>
<id>org.eclipse.osgi</id>
<level>-1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.common</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.ds</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.cm</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.log</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.osgi.services</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>com.c4biz.osgiutils.configuration.manager</id>
<level>2</level>
<autoStart>true</autoStart>
</bundle>
</bundleStartLevel>
<dependencies>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.core.runtime</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.core.jobs</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.osgi</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.common</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.event</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.osgi.services</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.osgi.util</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.cm</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.app</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.registry</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.ds</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.log</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.preferences</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.util</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.weaving.hook</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>javax.xml</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.app</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.transforms.hook</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest.core</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest.integration</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest.library</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest.text</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.junit</artifactId>
<version>0.0.0</version>
</dependency>
<!-- Plugins -->
<dependency>
<type>eclipse-plugin</type>
<artifactId>com.c4biz.osgiutils.assertions</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>com.c4biz.osgiutils.tests</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>com.c4biz.osgiutils.configuration.manager</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>com.c4biz.osgiutils.configuration.manager.test.conf</artifactId>
<version>0.0.0</version>
</dependency>
</dependencies>
<excludes>
<!-- test mojo matches TestProject be default and treats it as
PojoTest -->
<!-- <exclude>**/Test*.class</exclude> -->
</excludes>
<useUIHarness>false</useUIHarness>
<useUIThread>false</useUIThread>
</configuration>
</plugin>
[2] my test
@Test
public void ensureConfigurationServiceIsRegistered() {
// assert com.c4biz.osgiutils.assertions is ok
BundleAssert.assertBundleAvailable("Assertions bundle is not
available",
"com.c4biz.osgiutils.assertions");
// assert org.eclipse.equinox.ds is ok
BundleAssert.assertBundleAvailable("DS bundle is not available",
"org.eclipse.equinox.ds");
// assert org.eclipse.osgi.services is ok
BundleAssert.assertBundleAvailable("Services bundle is not
available",
"org.eclipse.osgi.services");
// assert org.eclipse.equinox.log is ok
BundleAssert.assertBundleAvailable("Log bundle is not available",
"org.eclipse.equinox.log");
Igor Fedorenko
2012-01-30 19:02:17 UTC
Permalink
Out of curiosity, why do you have that many <dependency> elements under
tycho-surefire-plugin configuration? Tycho is expected to determine
all/most test runtime dependencies based on test bundle manifest, so
listing them explicitly should not be necessary.

--
Regards,
Igor
Post by Cristiano Gavião
Hi Igor,
I've improved my tests and added compendium bundles (Log, DS and CM) as
dependencies and add them to a proper start level to tycho-surefire
plugin [1] and [2].
At Tycho-Surefire, only org.eclipse.equinox.ds test statement is
passing, the same is not happen with others compendium bundles...
please, could you point me what am I doing wrong this time ? :(
This log shows me that a lot of bundles that are declared in test
dependencies are not being referenced and not being loaded. but there
are one specific bundle (market below) that is not declared being
[INFO] Adding repository (cached)
http://download.eclipse.org/tools/orbit/downloads/drops/S20120123151124/repository/
[DEBUG] Added p2 repository Orbit
(http://download.eclipse.org/tools/orbit/downloads/drops/S20120123151124/repository/)
[INFO] Adding repository (cached)
http://download.eclipse.org/releases/indigo
[DEBUG] Added p2 repository Eclipse
(http://download.eclipse.org/releases/indigo)
[DEBUG] Registered artifact repository
[DEBUG] Added 0 locally built units to the target platform
[DEBUG] Using test framework org.junit4
[DEBUG]
reference:file:/Users/cvgaviao/Development/C4Biz_Projects/OsgiUtilities/com.c4biz.osgiutils.assertions/target/com.c4biz.osgiutils.assertions-0.0.1-SNAPSHOT.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.junit/4.8.2.v4_8_2_v20110321-1705/org.junit-4.8.2.v4_8_2_v20110321-1705.jar
[DEBUG]
[DEBUG]
*[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/osgi.enterprise/4.2.0.v201108120515/osgi.enterprise-4.2.0.v201108120515.jar
*[DEBUG]
reference:file:/Users/cvgaviao/Development/C4Biz_Projects/OsgiUtilities/com.c4biz.osgiutils.configuration.manager.test.conf/target/com.c4biz.osgiutils.configuration.manager.test.conf-0.0.1-SNAPSHOT.jar
[DEBUG]
reference:file:/Users/cvgaviao/Development/C4Biz_Projects/OsgiUtilities/com.c4biz.osgiutils.tests
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest/1.1.0.v20090501071000/org.hamcrest-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.core.contenttype/3.4.100.v20110423-0524/org.eclipse.core.contenttype-3.4.100.v20110423-0524.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.preferences/3.4.1.R37x_v20110725/org.eclipse.equinox.preferences-3.4.1.R37x_v20110725.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.registry/3.5.101.R37x_v20110810-1611/org.eclipse.equinox.registry-3.5.101.R37x_v20110810-1611.jar
[DEBUG]
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.core.jobs/3.5.100.v20110404/org.eclipse.core.jobs-3.5.100.v20110404.jar
[DEBUG]
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.core.runtime.compatibility.auth/3.2.200.v20110110/org.eclipse.core.runtime.compatibility.auth-3.2.200.v20110110.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.app/1.3.100.v20110321/org.eclipse.equinox.app-1.3.100.v20110321.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.util/1.0.300.v20110502/org.eclipse.equinox.util-1.0.300.v20110502.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest.core/1.1.0.v20090501071000/org.hamcrest.core-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest.library/1.1.0.v20090501071000/org.hamcrest.library-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest.integration/1.1.0.v20090501071000/org.hamcrest.integration-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest.text/1.1.0.v20090501071000/org.hamcrest.text-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.2.0.v20110502/org.eclipse.equinox.launcher-1.2.0.v20110502.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/org/eclipse/tycho/org.eclipse.tycho.surefire.osgibooter/0.14.0-SNAPSHOT/org.eclipse.tycho.surefire.osgibooter-0.14.0-SNAPSHOT.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/org/eclipse/tycho/org.eclipse.tycho.surefire.junit4/0.14.0-SNAPSHOT/org.eclipse.tycho.surefire.junit4-0.14.0-SNAPSHOT.jar
[1] plugin configuration
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<includes>
<include>**/*Test.class</include>
</includes>
<failIfNoTests>false</failIfNoTests>
<showEclipseLog>true</showEclipseLog>
<!-- <argLine>${ui.test.vmargs}</argLine> -->
<bundleStartLevel>
<bundle>
<id>org.eclipse.osgi</id>
<level>-1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.common</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.ds</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.cm</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.log</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.osgi.services</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>com.c4biz.osgiutils.configuration.manager</id>
<level>2</level>
<autoStart>true</autoStart>
</bundle>
</bundleStartLevel>
<dependencies>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.core.runtime</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.core.jobs</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.osgi</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.common</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.event</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.osgi.services</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.osgi.util</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.cm</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.app</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.registry</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.ds</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.log</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.preferences</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.util</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.weaving.hook</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>javax.xml</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.app</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.transforms.hook</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest.core</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest.integration</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest.library</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest.text</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.junit</artifactId>
<version>0.0.0</version>
</dependency>
<!-- Plugins -->
<dependency>
<type>eclipse-plugin</type>
<artifactId>com.c4biz.osgiutils.assertions</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>com.c4biz.osgiutils.tests</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>com.c4biz.osgiutils.configuration.manager</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>com.c4biz.osgiutils.configuration.manager.test.conf</artifactId>
<version>0.0.0</version>
</dependency>
</dependencies>
<excludes>
<!-- test mojo matches TestProject be default and treats it as
PojoTest -->
<!-- <exclude>**/Test*.class</exclude> -->
</excludes>
<useUIHarness>false</useUIHarness>
<useUIThread>false</useUIThread>
</configuration>
</plugin>
[2] my test
@Test
public void ensureConfigurationServiceIsRegistered() {
// assert com.c4biz.osgiutils.assertions is ok
BundleAssert.assertBundleAvailable("Assertions bundle is not available",
"com.c4biz.osgiutils.assertions");
// assert org.eclipse.equinox.ds is ok
BundleAssert.assertBundleAvailable("DS bundle is not available",
"org.eclipse.equinox.ds");
// assert org.eclipse.osgi.services is ok
BundleAssert.assertBundleAvailable("Services bundle is not available",
"org.eclipse.osgi.services");
// assert org.eclipse.equinox.log is ok
BundleAssert.assertBundleAvailable("Log bundle is not available",
"org.eclipse.equinox.log");
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Cristiano Gavião
2012-01-30 19:06:00 UTC
Permalink
:)

I've included only a few at the beginning but as it was not working the
first thing that come in my heamindd was: missing dependencies...

So I just copy all bundles listed in my working jdt junit tests to the pom..
Post by Igor Fedorenko
Out of curiosity, why do you have that many <dependency> elements under
tycho-surefire-plugin configuration? Tycho is expected to determine
all/most test runtime dependencies based on test bundle manifest, so
listing them explicitly should not be necessary.
--
Regards,
Igor
Post by Cristiano Gavião
Hi Igor,
I've improved my tests and added compendium bundles (Log, DS and CM) as
dependencies and add them to a proper start level to tycho-surefire
plugin [1] and [2].
At Tycho-Surefire, only org.eclipse.equinox.ds test statement is
passing, the same is not happen with others compendium bundles...
please, could you point me what am I doing wrong this time ? :(
This log shows me that a lot of bundles that are declared in test
dependencies are not being referenced and not being loaded. but there
are one specific bundle (market below) that is not declared being
[INFO] Adding repository (cached)
http://download.eclipse.org/tools/orbit/downloads/drops/S20120123151124/repository/
[DEBUG] Added p2 repository Orbit
(http://download.eclipse.org/tools/orbit/downloads/drops/S20120123151124/repository/)
[INFO] Adding repository (cached)
http://download.eclipse.org/releases/indigo
[DEBUG] Added p2 repository Eclipse
(http://download.eclipse.org/releases/indigo)
[DEBUG] Registered artifact repository
[DEBUG] Added 0 locally built units to the target platform
[DEBUG] Using test framework org.junit4
[DEBUG]
reference:file:/Users/cvgaviao/Development/C4Biz_Projects/OsgiUtilities/com.c4biz.osgiutils.assertions/target/com.c4biz.osgiutils.assertions-0.0.1-SNAPSHOT.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.junit/4.8.2.v4_8_2_v20110321-1705/org.junit-4.8.2.v4_8_2_v20110321-1705.jar
[DEBUG]
[DEBUG]
*[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/osgi.enterprise/4.2.0.v201108120515/osgi.enterprise-4.2.0.v201108120515.jar
*[DEBUG]
reference:file:/Users/cvgaviao/Development/C4Biz_Projects/OsgiUtilities/com.c4biz.osgiutils.configuration.manager.test.conf/target/com.c4biz.osgiutils.configuration.manager.test.conf-0.0.1-SNAPSHOT.jar
[DEBUG]
reference:file:/Users/cvgaviao/Development/C4Biz_Projects/OsgiUtilities/com.c4biz.osgiutils.tests
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest/1.1.0.v20090501071000/org.hamcrest-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.core.contenttype/3.4.100.v20110423-0524/org.eclipse.core.contenttype-3.4.100.v20110423-0524.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.preferences/3.4.1.R37x_v20110725/org.eclipse.equinox.preferences-3.4.1.R37x_v20110725.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.registry/3.5.101.R37x_v20110810-1611/org.eclipse.equinox.registry-3.5.101.R37x_v20110810-1611.jar
[DEBUG]
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.core.jobs/3.5.100.v20110404/org.eclipse.core.jobs-3.5.100.v20110404.jar
[DEBUG]
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.core.runtime.compatibility.auth/3.2.200.v20110110/org.eclipse.core.runtime.compatibility.auth-3.2.200.v20110110.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.app/1.3.100.v20110321/org.eclipse.equinox.app-1.3.100.v20110321.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.util/1.0.300.v20110502/org.eclipse.equinox.util-1.0.300.v20110502.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest.core/1.1.0.v20090501071000/org.hamcrest.core-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest.library/1.1.0.v20090501071000/org.hamcrest.library-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest.integration/1.1.0.v20090501071000/org.hamcrest.integration-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.hamcrest.text/1.1.0.v20090501071000/org.hamcrest.text-1.1.0.v20090501071000.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.2.0.v20110502/org.eclipse.equinox.launcher-1.2.0.v20110502.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/org/eclipse/tycho/org.eclipse.tycho.surefire.osgibooter/0.14.0-SNAPSHOT/org.eclipse.tycho.surefire.osgibooter-0.14.0-SNAPSHOT.jar
[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/org/eclipse/tycho/org.eclipse.tycho.surefire.junit4/0.14.0-SNAPSHOT/org.eclipse.tycho.surefire.junit4-0.14.0-SNAPSHOT.jar
[1] plugin configuration
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<includes>
<include>**/*Test.class</include>
</includes>
<failIfNoTests>false</failIfNoTests>
<showEclipseLog>true</showEclipseLog>
<!-- <argLine>${ui.test.vmargs}</argLine> -->
<bundleStartLevel>
<bundle>
<id>org.eclipse.osgi</id>
<level>-1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.common</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.ds</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.cm</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.log</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.osgi.services</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>com.c4biz.osgiutils.configuration.manager</id>
<level>2</level>
<autoStart>true</autoStart>
</bundle>
</bundleStartLevel>
<dependencies>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.core.runtime</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.core.jobs</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.osgi</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.common</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.event</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.osgi.services</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.osgi.util</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.cm</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.app</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.registry</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.ds</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.log</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.preferences</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.util</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.weaving.hook</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>javax.xml</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.app</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.transforms.hook</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest.core</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest.integration</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest.library</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest.text</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.hamcrest</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.junit</artifactId>
<version>0.0.0</version>
</dependency>
<!-- Plugins -->
<dependency>
<type>eclipse-plugin</type>
<artifactId>com.c4biz.osgiutils.assertions</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>com.c4biz.osgiutils.tests</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>com.c4biz.osgiutils.configuration.manager</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>com.c4biz.osgiutils.configuration.manager.test.conf</artifactId>
<version>0.0.0</version>
</dependency>
</dependencies>
<excludes>
<!-- test mojo matches TestProject be default and treats it as
PojoTest -->
<!-- <exclude>**/Test*.class</exclude> -->
</excludes>
<useUIHarness>false</useUIHarness>
<useUIThread>false</useUIThread>
</configuration>
</plugin>
[2] my test
@Test
public void ensureConfigurationServiceIsRegistered() {
// assert com.c4biz.osgiutils.assertions is ok
BundleAssert.assertBundleAvailable("Assertions bundle is not
available",
"com.c4biz.osgiutils.assertions");
// assert org.eclipse.equinox.ds is ok
BundleAssert.assertBundleAvailable("DS bundle is not available",
"org.eclipse.equinox.ds");
// assert org.eclipse.osgi.services is ok
BundleAssert.assertBundleAvailable("Services bundle is not available",
"org.eclipse.osgi.services");
// assert org.eclipse.equinox.log is ok
BundleAssert.assertBundleAvailable("Log bundle is not available",
"org.eclipse.equinox.log");
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Cristiano Gavião
2012-01-30 19:26:20 UTC
Permalink
Post by Igor Fedorenko
Tycho is expected to determine
all/most test runtime dependencies based on test bundle manifest, so
listing them explicitly should not be necessary.
hummm.. could be this the key of the problem...

It is not common to have a Require-Bundle pointing to Compendium bundles
(org.eclipse.equinox.cm or org.eclipse.equinox.log)... we just use the
package-import (org.osgi.service.cm and org.osgi.service.log)...

And it seems that Tycho is not respecting the declared bundles at the
surefire plugin and using the osgi.enterprise-4.2.0.v201108120515.jar
that it founds in Orbit p2 repository (that I think is exporting the
same packages).

WDYT ?
Igor Fedorenko
2012-01-30 20:39:01 UTC
Permalink
I am not sure I understand. Do you have multiple providers of the same
package? Using org.eclipse.equinox.log as an example, can you explain
where this package is expected to come from and what do you think Tycho
does instead?

--
Regards,
Igor
Post by Cristiano Gavião
Post by Igor Fedorenko
Tycho is expected to determine
all/most test runtime dependencies based on test bundle manifest, so
listing them explicitly should not be necessary.
hummm.. could be this the key of the problem...
It is not common to have a Require-Bundle pointing to Compendium bundles
(org.eclipse.equinox.cm or org.eclipse.equinox.log)... we just use the
package-import (org.osgi.service.cm and org.osgi.service.log)...
And it seems that Tycho is not respecting the declared bundles at the
surefire plugin and using the osgi.enterprise-4.2.0.v201108120515.jar
that it founds in Orbit p2 repository (that I think is exporting the
same packages).
WDYT ?
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Cristiano Gavião
2012-01-30 23:21:59 UTC
Permalink
Ok, let me try to explain...

in my bundles I have : *Import-package: org.osgi.service.log,
org.osgi.service.cm
*
the first normally is supposed to be resolved by org.eclipse.osgi
besides the fact that org.eclipse.osgi.services bundle export it too.
org.osgi.service.cm is supposed to be resolved by
org.eclipse.osgi.services bundle.

Both are API bundles, and to be able to use them, at the target platform
of the running container, I must include and start the implementation
bundles: org.eclipse.equinox.log and org.eclipse.equinox.cm.

What I've observed is that these bundles, declared in tycho-surefire at
POM, is not being resolved:

<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.log</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.cm</artifactId>
<version>0.0.0</version>
</dependency>

But instead, just because I'm using the Orbit repository, it is being
resolved by this bundle:

*[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/osgi.enterprise/4.2.0.v201108120515/osgi.enterprise-4.2.0.v201108120515.jar*

If you look in my first email at debug info, none of the declared
bundles is being installed at the equinox running the tests.

hope you have understand now :)

BTW, I did what you have suggested in your first response, removed all
instalable-units from POM and declared themas Required-Bundle in the
test manifest and it works.


cheers,

Cristiano
Post by Igor Fedorenko
I am not sure I understand. Do you have multiple providers of the same
package? Using org.eclipse.equinox.log as an example, can you explain
where this package is expected to come from and what do you think Tycho
does instead?
--
Regards,
Igor
Post by Cristiano Gavião
Post by Igor Fedorenko
Tycho is expected to determine
all/most test runtime dependencies based on test bundle manifest, so
listing them explicitly should not be necessary.
hummm.. could be this the key of the problem...
It is not common to have a Require-Bundle pointing to Compendium bundles
(org.eclipse.equinox.cm or org.eclipse.equinox.log)... we just use the
package-import (org.osgi.service.cm and org.osgi.service.log)...
And it seems that Tycho is not respecting the declared bundles at the
surefire plugin and using the osgi.enterprise-4.2.0.v201108120515.jar
that it founds in Orbit p2 repository (that I think is exporting the
same packages).
WDYT ?
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Igor Fedorenko
2012-01-31 02:35:07 UTC
Permalink
dependency type should be 'p2-installable-unit'. I've attached complete
working example that shows how to force equinox.log bundle into test
runtime.

--
Regards,
Igor
Post by Cristiano Gavião
Ok, let me try to explain...
in my bundles I have : *Import-package: org.osgi.service.log,
org.osgi.service.cm
*
the first normally is supposed to be resolved by org.eclipse.osgi
besides the fact that org.eclipse.osgi.services bundle export it too.
org.osgi.service.cm is supposed to be resolved by
org.eclipse.osgi.services bundle.
Both are API bundles, and to be able to use them, at the target platform
of the running container, I must include and start the implementation
bundles: org.eclipse.equinox.log and org.eclipse.equinox.cm.
What I've observed is that these bundles, declared in tycho-surefire at
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.log</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.cm</artifactId>
<version>0.0.0</version>
</dependency>
But instead, just because I'm using the Orbit repository, it is being
*[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/osgi.enterprise/4.2.0.v201108120515/osgi.enterprise-4.2.0.v201108120515.jar*
If you look in my first email at debug info, none of the declared
bundles is being installed at the equinox running the tests.
hope you have understand now :)
BTW, I did what you have suggested in your first response, removed all
instalable-units from POM and declared themas Required-Bundle in the
test manifest and it works.
cheers,
Cristiano
Post by Igor Fedorenko
I am not sure I understand. Do you have multiple providers of the same
package? Using org.eclipse.equinox.log as an example, can you explain
where this package is expected to come from and what do you think Tycho
does instead?
--
Regards,
Igor
Post by Cristiano Gavião
Post by Igor Fedorenko
Tycho is expected to determine
all/most test runtime dependencies based on test bundle manifest, so
listing them explicitly should not be necessary.
hummm.. could be this the key of the problem...
It is not common to have a Require-Bundle pointing to Compendium bundles
(org.eclipse.equinox.cm or org.eclipse.equinox.log)... we just use the
package-import (org.osgi.service.cm and org.osgi.service.log)...
And it seems that Tycho is not respecting the declared bundles at the
surefire plugin and using the osgi.enterprise-4.2.0.v201108120515.jar
that it founds in Orbit p2 repository (that I think is exporting the
same packages).
WDYT ?
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Cristiano Gavião
2012-01-31 12:05:01 UTC
Permalink
Oh my... I did it again ! :( I really need a new glass !

and the worst part is that I'm already using 'p2-installable-unit' in a
SWTBot test...

sorry for the inconvenience, Igor.

and thanks,

Cristiano
Post by Igor Fedorenko
dependency type should be 'p2-installable-unit'. I've attached complete
working example that shows how to force equinox.log bundle into test
runtime.
--
Regards,
Igor
Post by Cristiano Gavião
Ok, let me try to explain...
in my bundles I have : *Import-package: org.osgi.service.log,
org.osgi.service.cm
*
the first normally is supposed to be resolved by org.eclipse.osgi
besides the fact that org.eclipse.osgi.services bundle export it too.
org.osgi.service.cm is supposed to be resolved by
org.eclipse.osgi.services bundle.
Both are API bundles, and to be able to use them, at the target platform
of the running container, I must include and start the implementation
bundles: org.eclipse.equinox.log and org.eclipse.equinox.cm.
What I've observed is that these bundles, declared in tycho-surefire at
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.log</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>instalable-unit</type>
<artifactId>org.eclipse.equinox.cm</artifactId>
<version>0.0.0</version>
</dependency>
But instead, just because I'm using the Orbit repository, it is being
*[DEBUG]
reference:file:/Users/cvgaviao/.m2/repository/p2/osgi/bundle/osgi.enterprise/4.2.0.v201108120515/osgi.enterprise-4.2.0.v201108120515.jar*
If you look in my first email at debug info, none of the declared
bundles is being installed at the equinox running the tests.
hope you have understand now :)
BTW, I did what you have suggested in your first response, removed all
instalable-units from POM and declared themas Required-Bundle in the
test manifest and it works.
cheers,
Cristiano
Post by Igor Fedorenko
I am not sure I understand. Do you have multiple providers of the same
package? Using org.eclipse.equinox.log as an example, can you explain
where this package is expected to come from and what do you think Tycho
does instead?
--
Regards,
Igor
Post by Cristiano Gavião
Post by Igor Fedorenko
Tycho is expected to determine
all/most test runtime dependencies based on test bundle manifest, so
listing them explicitly should not be necessary.
hummm.. could be this the key of the problem...
It is not common to have a Require-Bundle pointing to Compendium bundles
(org.eclipse.equinox.cm or org.eclipse.equinox.log)... we just use the
package-import (org.osgi.service.cm and org.osgi.service.log)...
And it seems that Tycho is not respecting the declared bundles at the
surefire plugin and using the osgi.enterprise-4.2.0.v201108120515.jar
that it founds in Orbit p2 repository (that I think is exporting the
same packages).
WDYT ?
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Loading...