<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</systemProperties>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <includeScope>compile</includeScope>
+ <includeTypes>jar</includeTypes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skipTests>false</skipTests>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<dependencies>
<version>${project.version}</version>
<type>pom</type>
</dependency>
+
+ <!-- TESTS -->
+ <dependency>
+ <groupId>org.argeo.slc.runtime</groupId>
+ <artifactId>org.argeo.slc.support.equinox</artifactId>
+ <version>${project.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.slc.runtime</groupId>
+ <artifactId>org.argeo.slc.osgiboot</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<profiles>
--- /dev/null
+package org.argeo.slc.demo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.argeo.slc.osgi.test.AbstractOsgiRuntimeTestCase;
+import org.argeo.slc.osgiboot.OsgiBoot;
+
+public class StartStopDemoTest extends AbstractOsgiRuntimeTestCase {
+ public void testStartStop() throws Exception {
+ assertBundleApplicationContext("org.argeo.slc.agent");
+ assertStartedBundlesApplicationContext("org.argeo.slc.demo");
+ }
+
+ protected void installBundles() throws Exception {
+ osgiBoot.installUrls(osgiBoot.getBundlesUrls(OsgiBoot.DEFAULT_BASE_URL,
+ "target/dependency;in=*.jar"));
+ osgiBoot.installUrls(osgiBoot.getLocationsUrls(
+ OsgiBoot.DEFAULT_BASE_URL, System
+ .getProperty("java.class.path")));
+ osgiBoot.installUrls(osgiBoot.getBundlesUrls(OsgiBoot.DEFAULT_BASE_URL,
+ "site;in=*"));
+ }
+
+ protected List<String> getBundlesToStart() {
+ List<String> bundlesToStart = new ArrayList<String>();
+ bundlesToStart.add("org.springframework.osgi.extender");
+ bundlesToStart.add("org.argeo.slc.agent");
+ bundlesToStart.add("org.argeo.slc.demo.basic");
+ return bundlesToStart;
+ }
+
+}
<goals>
<goal>test-jar</goal>
</goals>
+ <configuration>
+ <archive>
+ <manifestFile>target/test-classes/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
</execution>
</executions>
</plugin>
<goals>
<goal>test-jar</goal>
</goals>
+ <configuration>
+ <archive>
+ <manifestFile>target/test-classes/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
</execution>
</executions>
</plugin>