Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Setting OSGi Framework System Properties during Testing Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Setting OSGi Framework System Properties during Testing

    Hi,

    I'm trying to set the following property for use by my OSGi integration tests

    Code:
    org.osgi.framework.system.packages.extra=sun.io
    I'm using the default Equinox OSGi environment during testing and the only way I've been able to figure out how to set this property is by adding it as a VM arg. This works ok for Maven because I can set it up in Surefire like this

    Code:
    ....
    <properties>
    	<osgi.test.system.packages.extras>sun.io</osgi.test.system.packages.extras>
    </properties>
    ...
    <plugin>
    	<groupId>org.apache.maven.plugins</groupId>
    	<artifactId>maven-surefire-plugin</artifactId>
    	<configuration>
    		<systemProperties>
    			<property>
    				<name>org.osgi.framework.system.packages.extra</name>
    				<value>${osgi.test.system.packages.extras}</value>
    			</property>
    		</systemProperties>
    	</configuration>
    </plugin>
    ....
    but then my tests don't work correctly in Eclipse unless I configure a Run Configuration with a VM arg.

    I was curious if its possible to configure some settings file that Equinox will read on start up (I tried putting config.ini on the classpath as a wild guess) or some configuration in AbstractConfigurableBundleCreatorTests?

    I tried setting property (through System.setProperty(...)) in the onSetup method of AbstractConfigurableBundleCreatorTests but I didn't get any results as I think this is too late since Equinox seems to already be started by that point.

    Any help?

    Thanks!

  • #2
    Take a look at AbstractConfigurableOsgiTests#createPlatform() method - you can override that to do additional things (such as configuring other properties). Additionally, you can take a look at the sources to see the various hooks one can use during testing.

    Comment

    Working...
    X