felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1298268 - in /felix/trunk/scr: pom.xml src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java src/test/java/org/apache/felix/scr/integration/components/MyTinyBundle.java
Date Thu, 08 Mar 2012 04:37:56 GMT
Author: fmeschbe
Date: Thu Mar  8 04:37:56 2012
New Revision: 1298268

URL: http://svn.apache.org/viewvc?rev=1298268&view=rev
Log:
FELIX-3371 Apply patch FELIX-3371-3.diff to update to newer pax-exam (patch provided by David
Jencks, thanks alot)

Removed:
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/MyTinyBundle.java
Modified:
    felix/trunk/scr/pom.xml
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java

Modified: felix/trunk/scr/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scr/pom.xml?rev=1298268&r1=1298267&r2=1298268&view=diff
==============================================================================
--- felix/trunk/scr/pom.xml (original)
+++ felix/trunk/scr/pom.xml Thu Mar  8 04:37:56 2012
@@ -21,7 +21,7 @@
         <groupId>org.apache.felix</groupId>
         <artifactId>felix-parent</artifactId>
         <version>2.1</version>
-        <relativePath>../pom/pom.xml</relativePath>
+        <relativePath/>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <packaging>bundle</packaging>
@@ -113,33 +113,92 @@
         
         <!-- Integration Testing with Pax Exam -->
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.6</version>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-forked</artifactId>
+            <version>2.4.0.RC1</version>
             <scope>test</scope>
         </dependency>
+
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam</artifactId>
-            <version>0.6.0</version>
+            <artifactId>pax-exam-junit4</artifactId>
+            <version>2.4.0.RC1</version>
             <scope>test</scope>
         </dependency>
+    
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-junit</artifactId>
-            <version>0.6.0</version>
+            <artifactId>pax-exam-link-mvn</artifactId>
+            <version>2.4.0.RC1</version>
+            <scope>test</scope>
+        </dependency>
+    
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-aether</artifactId>
+            <version>1.4.0.RC1</version>
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-container-default</artifactId>
-            <version>0.6.0</version>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-wrap</artifactId>
+            <version>1.4.0.RC1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-api</artifactId>
+            <version>1.6.3</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-service</artifactId>
+            <version>1.6.3</version>
+            <scope>test</scope>
+        </dependency>
+    
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <version>0.9.29</version>
+            <scope>test</scope>
+        </dependency>
+    
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>0.9.29</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-atinject_1.0_spec</artifactId>
+            <version>1.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit</groupId>
+            <artifactId>com.springsource.org.junit</artifactId>
+            <version>4.9.0</version>
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.ops4j.pax.swissbox</groupId>
-            <artifactId>pax-swissbox-tinybundles</artifactId>
-            <version>1.1.0</version>
+            <groupId>org.ops4j.base</groupId>
+            <artifactId>ops4j-base-lang</artifactId>
+            <version>1.2.3</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.base</groupId>
+            <artifactId>ops4j-base-net</artifactId>
+            <version>1.2.3</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.tinybundles</groupId>
+            <artifactId>tinybundles</artifactId>
+            <version>1.0.0</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
@@ -149,7 +208,7 @@
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
-                <version>2.3.4</version>
+                <version>2.3.7</version>
                 <extensions>true</extensions>
                 <configuration>
                     <instructions>
@@ -295,36 +354,9 @@
                 </configuration>
             </plugin>
 
-            <!--
-                Exclude Integration tests in (default) unit tests and
-                conversely enable integration tests for integration testing
-                only. Helper classes are completely excluded from testing. 
-            -->
+            <!-- plain unit tests -->
             <plugin>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>surefire-it</id>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>test</goal>
-                        </goals>
-                        <configuration>
-                            <systemProperties>
-                                <property>
-                                    <name>project.bundle.file</name>
-                                    <value>${bundle.file.name}</value>
-                                </property>
-                            </systemProperties>
-                            <excludes>
-                                <exclude>**/components/**</exclude>
-                            </excludes>
-                            <includes>
-                                <include>**/integration/*</include>
-                            </includes>
-                        </configuration>
-                    </execution>
-                </executions>
                 <configuration>
                     <excludes>
                         <exclude>**/integration/**</exclude>
@@ -334,6 +366,33 @@
                     </excludes>
                 </configuration>
             </plugin>
+            <!-- integration tests run with pax-exam -->
+            <plugin>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <version>2.12</version>
+                <executions>
+                  <execution>
+                    <goals>
+                      <goal>integration-test</goal>
+                      <goal>verify</goal>
+                    </goals>
+                  </execution>
+                </executions>
+                <configuration>
+                    <systemProperties>
+                        <property>
+                            <name>project.bundle.file</name>
+                            <value>${bundle.file.name}</value>
+                        </property>
+                    </systemProperties>
+                    <excludes>
+                        <exclude>**/components/**</exclude>
+                    </excludes>
+                    <includes>
+                        <include>**/integration/*</include>
+                    </includes>
+                </configuration>
+            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
@@ -374,17 +433,40 @@
                 </plugins>
             </build>
         </profile>
+
+        <profile>
+            <id>felix</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.apache.felix.framework</artifactId>
+                    <version>4.0.2</version>
+                    <scope>test</scope>
+                </dependency>
+            </dependencies>
+        </profile>
+        <profile>
+            <id>equinox</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.eclipse</groupId>
+                    <artifactId>osgi</artifactId>
+                    <version>3.7.1.R37x_v20110808-1106</version>
+                    <scope>test</scope>
+                </dependency>
+            </dependencies>
+        </profile>
     </profiles>
         
-    <!-- repositories for Pax Exam and BND tool -->
     <repositories>
-    	<repository>
-    		<id>ops4j</id>
-    		<name>ops4j</name>
-    		<url>http://repository.ops4j.org/maven2</url>
-    		<snapshots>
-    			<enabled>false</enabled>
-    		</snapshots>
-    	</repository>
+        <!-- springsource junit wrapping -->
+        <repository>
+            <id>com.springsource.repository.bundles.external</id>
+            <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
+            <url>http://repository.springsource.com/maven/bundles/external</url>
+        </repository>
     </repositories>
 </project>

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java?rev=1298268&r1=1298267&r2=1298268&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
(original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
Thu Mar  8 04:37:56 2012
@@ -19,11 +19,13 @@
 package org.apache.felix.scr.integration;
 
 
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.CoreOptions.provision;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.withBnd;
+import static org.ops4j.pax.tinybundles.core.TinyBundles.bundle;
+import static org.ops4j.pax.tinybundles.core.TinyBundles.withBnd;
 
 import java.io.File;
 import java.io.IOException;
@@ -31,19 +33,20 @@ import java.io.InputStream;
 import java.lang.reflect.Field;
 import java.util.Dictionary;
 import java.util.Hashtable;
+
+import javax.inject.Inject;
 import junit.framework.TestCase;
 
 import org.apache.felix.scr.Component;
 import org.apache.felix.scr.ScrService;
-import org.apache.felix.scr.integration.components.MyTinyBundle;
 import org.junit.After;
 import org.junit.Before;
 import org.ops4j.pax.exam.CoreOptions;
-import org.ops4j.pax.exam.Inject;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.OptionUtils;
-import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
+import org.ops4j.pax.exam.TestProbeBuilder;
 import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.ProbeBuilder;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
@@ -91,6 +94,11 @@ public abstract class ComponentTestBase
         theConfig.put( PROP_NAME, PROP_NAME );
     }
 
+    @ProbeBuilder
+    public TestProbeBuilder extendProbe(TestProbeBuilder builder) {
+        builder.setHeader("Export-Package", "org.apache.felix.scr.integration.components,org.apache.felix.scr.integration.components.activatesignature");
+        return builder;
+    }
 
     @Configuration
     public static Option[] configuration()
@@ -106,12 +114,14 @@ public abstract class ComponentTestBase
         final Option[] base = options(
             provision(
                 CoreOptions.bundle( bundleFile.toURI().toString() ),
-                mavenBundle( "org.ops4j.pax.swissbox", "pax-swissbox-tinybundles", "1.1.0"
),
+                mavenBundle( "org.ops4j.pax.tinybundles", "tinybundles", "1.0.0" ),
                 mavenBundle( "org.apache.felix", "org.apache.felix.configadmin", "1.0.10"
)
              ),
+             junitBundles(),
              systemProperty( "ds.factory.enabled" ).value( "true" )
+
         );
-        final Option vmOption = ( paxRunnerVmOption != null ) ? PaxRunnerOptions.vmOption(
paxRunnerVmOption ) : null;
+        final Option vmOption = ( paxRunnerVmOption != null ) ? CoreOptions.vmOption( paxRunnerVmOption
) : null;
         return OptionUtils.combine( base, vmOption );
     }
 
@@ -319,17 +329,15 @@ public abstract class ComponentTestBase
 
     protected Bundle installBundle( final String descriptorFile ) throws BundleException
     {
-        final InputStream bundleStream = new MyTinyBundle()
-            .add( "OSGI-INF/components.xml", getClass().getResource( descriptorFile ) )
-            .prepare(
-                withBnd()
-                .set( Constants.BUNDLE_SYMBOLICNAME, "simplecomponent" )
-                .set( Constants.BUNDLE_VERSION, "0.0.11" )
-                .set( Constants.IMPORT_PACKAGE,
-                    "org.apache.felix.scr.integration.components,org.apache.felix.scr.integration.components.activatesignature"
)
-                .set( "Service-Component", "OSGI-INF/components.xml" )
-            )
-            .build();
+        final InputStream bundleStream = bundle()
+            .add("OSGI-INF/components.xml", getClass().getResource(descriptorFile))
+
+                .set(Constants.BUNDLE_SYMBOLICNAME, "simplecomponent")
+                .set(Constants.BUNDLE_VERSION, "0.0.11")
+                .set(Constants.IMPORT_PACKAGE,
+                        "org.apache.felix.scr.integration.components,org.apache.felix.scr.integration.components.activatesignature")
+                .set("Service-Component", "OSGI-INF/components.xml")
+            .build(withBnd());
 
         try
         {



Mime
View raw message