Specific MANIFESTs for test jars.
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 4 Jun 2009 16:20:45 +0000 (16:20 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 4 Jun 2009 16:20:45 +0000 (16:20 +0000)
Integration tests for demo.

git-svn-id: https://svn.argeo.org/slc/trunk@2464 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

demo/.classpath
demo/pom.xml
demo/src/test/java/org/argeo/slc/demo/StartStopDemoTest.java [new file with mode: 0644]
runtime/org.argeo.slc.support.equinox/pom.xml
runtime/org.argeo.slc.support.simple/pom.xml

index d0bec0f7611fdaeecb07a8dfbcc32e06ccda11cb..624a6cfe1134b952b68008ae2b62cd10c78a501e 100644 (file)
@@ -1,5 +1,6 @@
 <?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"/>
index 4a02458c2798b8aec3e74ae2ae48c430e6f98a85..e1d8544ab22743445d4b0f8f41d97f3e4d0a0a60 100644 (file)
                                        </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>
diff --git a/demo/src/test/java/org/argeo/slc/demo/StartStopDemoTest.java b/demo/src/test/java/org/argeo/slc/demo/StartStopDemoTest.java
new file mode 100644 (file)
index 0000000..603ac26
--- /dev/null
@@ -0,0 +1,33 @@
+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;
+       }
+
+}
index 6bb2762094842423be1aa38658f003904998e282..5c664c7aee83791941de6419bfc5d27453bf60c1 100644 (file)
                                                <goals>
                                                        <goal>test-jar</goal>
                                                </goals>
+                                               <configuration>
+                                                       <archive>
+                                                               <manifestFile>target/test-classes/META-INF/MANIFEST.MF</manifestFile>
+                                                       </archive>
+                                               </configuration>
                                        </execution>
                                </executions>
                        </plugin>
index 40dc4a0ea95f6a6a22c47a288ad0c3c6115ca7ea..d65ef683a4b374f4907ab60cd3e708c70ccd348b 100644 (file)
                                                <goals>
                                                        <goal>test-jar</goal>
                                                </goals>
+                                               <configuration>
+                                                       <archive>
+                                                               <manifestFile>target/test-classes/META-INF/MANIFEST.MF</manifestFile>
+                                                       </archive>
+                                               </configuration>
                                        </execution>
                                </executions>
                        </plugin>