First steps towards pax-exam automated incontainer tests. PAX_EXAM_MOCKITO_ISSUE
authorErik Brakkee <erik@brakkee.org>
Tue, 16 Aug 2011 20:30:03 +0000 (22:30 +0200)
committerErik Brakkee <erik@brakkee.org>
Tue, 16 Aug 2011 20:30:03 +0000 (22:30 +0200)
integrationtest/pom.xml [new file with mode: 0644]
integrationtest/src/test/java/org/wamblee/xmlrouter/integrationtest/XmlRouterIntegrationTest.java [new file with mode: 0644]
pom.xml

diff --git a/integrationtest/pom.xml b/integrationtest/pom.xml
new file mode 100644 (file)
index 0000000..83f9459
--- /dev/null
@@ -0,0 +1,120 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+    <parent>
+        <groupId>org.wamblee.xmlrouter</groupId>
+        <artifactId>xmlrouter-root</artifactId>
+        <version>0.1.0-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>xmlrouter-integrationtest</artifactId>
+    <packaging>jar</packaging>
+    <name>/xmlrouter/integrationtest</name>
+    <url>http://wamblee.org</url>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.wamblee.xmlrouter</groupId>
+            <artifactId>xmlrouter-common</artifactId>
+            <version>0.1.0-SNAPSHOT</version>
+        </dependency>
+               <dependency>
+            <groupId>org.wamblee.xmlrouter</groupId>
+            <artifactId>xmlrouter-config</artifactId>
+            <version>0.1.0-SNAPSHOT</version>
+        </dependency>
+               <dependency>
+            <groupId>org.wamblee.xmlrouter</groupId>
+            <artifactId>xmlrouter-listener</artifactId>
+            <version>0.1.0-SNAPSHOT</version>
+        </dependency>
+               <dependency>
+            <groupId>org.wamblee.xmlrouter</groupId>
+            <artifactId>xmlrouter-publish</artifactId>
+            <version>0.1.0-SNAPSHOT</version>
+        </dependency>
+               <dependency>
+            <groupId>org.wamblee.xmlrouter</groupId>
+            <artifactId>xmlrouter-subscribe</artifactId>
+            <version>0.1.0-SNAPSHOT</version>
+        </dependency>
+       
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+        </dependency>        
+        
+        <!-- OSGI -->
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <version>4.2.0</version>
+        </dependency>
+        
+        <!-- Pax exam -->
+        <!-- both runner and native -->
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit4</artifactId>
+        </dependency>
+        
+        <!-- both runner and native -->
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-link-mvn</artifactId>
+        </dependency>
+        
+        <!-- only native -->
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-native</artifactId>
+        </dependency>
+        
+        <!-- only native -->
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-aether</artifactId>
+        </dependency>
+        
+        <!-- only native -->
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework</artifactId>
+        </dependency>
+        
+        
+    </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${pom.groupId}.${pom.artifactId}</Bundle-SymbolicName>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    
+    <distributionManagement>
+        <site>
+            <id>xmlrouter-site</id>
+            <url>file:${distrib}/cache</url>
+        </site>
+    </distributionManagement>
+
+</project>
diff --git a/integrationtest/src/test/java/org/wamblee/xmlrouter/integrationtest/XmlRouterIntegrationTest.java b/integrationtest/src/test/java/org/wamblee/xmlrouter/integrationtest/XmlRouterIntegrationTest.java
new file mode 100644 (file)
index 0000000..cfd3625
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2005-2011 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.wamblee.xmlrouter.integrationtest;
+
+import static org.ops4j.pax.exam.CoreOptions.*;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.osgi.framework.BundleContext;
+
+@RunWith(JUnit4TestRunner.class)
+public class XmlRouterIntegrationTest {
+
+    @Configuration()
+    public Option[] config() {
+        return options(junitBundles(),
+        // mockito 1.7
+        // wrappedBundle(mavenBundle().groupId("org.mockito")
+        // .artifactId("mockito-all").version("1.7")),
+        // mockito 1.8.5
+            mavenBundle().groupId("org.mockito").artifactId("mockito-all")
+                .version("1.8.5"), //
+            felix());
+    }
+
+    @Test
+    public void test1(BundleContext aContext) {
+        System.out.println("=== Got context " + aContext);
+
+    }
+
+}
diff --git a/pom.xml b/pom.xml
index 10df9a9dc03d008a839a31a4155196fa100aa5aa..37c993a0fdccfbdb0d660897ddfb4311bb21d2a2 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,9 @@
 
     <properties>
         <wamblee.utils.version>0.5</wamblee.utils.version>
+        <pax.exam.version>2.2.0</pax.exam.version>
+        <pax.runner.version>1.7.4</pax.runner.version>
+        <pax.url.version>1.3.4</pax.url.version>
     </properties>
 
     <modules>
@@ -42,6 +45,7 @@
         <module>subscribe</module>
         <module>router</module>
         <module>listener</module>
+        <module>integrationtest</module>
     </modules>
 
     <!-- need to exclude test at release because test depends on an artifact
                 <version>1.8.0</version>
                 <scope>test</scope>
             </dependency>
+            
+            <!-- OSGI -->
+            <dependency>
+                <groupId>org.osgi</groupId>
+                <artifactId>org.osgi.core</artifactId>
+                <version>4.2.0</version>
+            </dependency>
+            <dependency>
+                <groupId>org.osgi</groupId>
+                <artifactId>org.osgi.compendium</artifactId>
+                <version>4.2.0</version>
+            </dependency>
+            
+            <!-- Pax exam -->
+            <!-- only runner -->
+            <dependency>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>pax-exam-container-paxrunner</artifactId>
+                <version>${pax.exam.version}</version>
+                <scope>test</scope>
+            </dependency>
+            
+            <!-- only runner -->
+            <dependency>
+                <groupId>org.ops4j.pax.runner</groupId>
+                <artifactId>pax-runner-no-jcl</artifactId>
+                <version>${pax.runner.version}</version>
+                <scope>test</scope>
+            </dependency>
+            
+            <!-- both runner and native -->
+            <dependency>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>pax-exam-junit4</artifactId>
+                <version>${pax.exam.version}</version>
+                <scope>test</scope>
+            </dependency>
+            
+            <!-- both runner and native -->
+            <dependency>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>pax-exam-link-mvn</artifactId>
+                <version>${pax.exam.version}</version>
+                <scope>test</scope>
+            </dependency>
+            
+            <!-- only native -->
+            <dependency>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>pax-exam-container-native</artifactId>
+                <version>${pax.exam.version}</version>
+                <scope>test</scope>
+            </dependency>
+            
+            <!-- only native -->
+            <dependency>
+                <groupId>org.ops4j.pax.url</groupId>
+                <artifactId>pax-url-aether</artifactId>
+                <version>${pax.url.version}</version>
+                <scope>test</scope>
+            </dependency>
+            
+            <!-- only native -->
+            <dependency>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>org.apache.felix.framework</artifactId>
+                <version>3.2.2</version>
+                <scope>test</scope>
+            </dependency>
+
 
         </dependencies>
 
 
     <build>
         <plugins>
+            <plugin>
+                <groupId>org.apache.servicemix.tooling</groupId>
+                <artifactId>depends-maven-plugin</artifactId>
+                <version>1.2</version>
+                <executions>
+                    <execution>
+                        <id>generate-depends-file</id>
+                        <goals>
+                            <goal>generate-depends-file</goal>
+                        </goals>
+                    </execution>
+                </executions>
+
+            </plugin>
+
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-release-plugin</artifactId>