Author: fmeschbe
Date: Thu Aug 20 11:23:32 2009
New Revision: 806126

URL: http://svn.apache.org/viewvc?rev=806126&view=rev
Log:
Have to explicitly state the test bundle and not scan the target
folder, otherwise the release plugin build fails to run the
integration tests failing on installing the source jar as a bundle

Modified:
    felix/trunk/configadmin/pom.xml
    
felix/trunk/configadmin/src/test/java/org/apache/felix/cm/integration/ConfigurationTestBase.java

Modified: felix/trunk/configadmin/pom.xml
URL: 
http://svn.apache.org/viewvc/felix/trunk/configadmin/pom.xml?rev=806126&r1=806125&r2=806126&view=diff
==============================================================================
--- felix/trunk/configadmin/pom.xml (original)
+++ felix/trunk/configadmin/pom.xml Thu Aug 20 11:23:32 2009
@@ -145,6 +145,38 @@
                 </configuration>
             </plugin>
 
+            <!-- Provide bundle for integration tests -->
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.3</version>
+                <executions>
+                    <execution>
+                        <id>configadmin-file-create</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <copy 
file="${pom.build.directory}/${pom.build.finalName}.jar" 
tofile="${pom.build.directory}/configadmin.jar" />
+                            </tasks>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>configadmin-file-remove</id>
+                        <phase>post-integration-test</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <delete 
file="${pom.build.directory}/configadmin.jar" />
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
             <!--
                 Exclude Integration tests in (default) unit tests and
                 conversely enable integration tests for integration testing

Modified: 
felix/trunk/configadmin/src/test/java/org/apache/felix/cm/integration/ConfigurationTestBase.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/configadmin/src/test/java/org/apache/felix/cm/integration/ConfigurationTestBase.java?rev=806126&r1=806125&r2=806126&view=diff
==============================================================================
--- 
felix/trunk/configadmin/src/test/java/org/apache/felix/cm/integration/ConfigurationTestBase.java
 (original)
+++ 
felix/trunk/configadmin/src/test/java/org/apache/felix/cm/integration/ConfigurationTestBase.java
 Thu Aug 20 11:23:32 2009
@@ -19,23 +19,20 @@
 package org.apache.felix.cm.integration;
 
 
-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.container.def.PaxRunnerOptions.scanDir;
-import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.withBnd;
-
+import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Dictionary;
 import java.util.Hashtable;
+
 import junit.framework.TestCase;
 
+import org.apache.felix.cm.integration.helper.BaseTestActivator;
 import org.apache.felix.cm.integration.helper.ManagedServiceTestActivator;
 import org.apache.felix.cm.integration.helper.MyTinyBundle;
-import org.apache.felix.cm.integration.helper.BaseTestActivator;
 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.swissbox.tinybundles.core.TinyBundles;
@@ -91,8 +88,11 @@
     @org.ops4j.pax.exam.junit.Configuration
     public static Option[] configuration()
     {
-        return options( provision( scanDir( "target" ).filter( "*.jar" ), 
mavenBundle( "org.ops4j.pax.swissbox",
-            "pax-swissbox-tinybundles", "1.0.0" ) )
+        return CoreOptions.options(
+            CoreOptions.provision(
+                CoreOptions.bundle( new 
File("target/configadmin.jar").toURI().toString() ),
+                CoreOptions.mavenBundle( "org.ops4j.pax.swissbox", 
"pax-swissbox-tinybundles", "1.0.0" )
+            )
 //         , 
PaxRunnerOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=30303"
 )
         // , PaxRunnerOptions.logProfile()
         );
@@ -136,11 +136,15 @@
         throws BundleException
     {
         final String activatorClassName = activatorClass.getName();
-        final InputStream bundleStream = new MyTinyBundle().prepare(
-            withBnd().set( Constants.BUNDLE_SYMBOLICNAME, activatorClassName 
).set( Constants.BUNDLE_VERSION, "0.0.11" )
-                .set( Constants.IMPORT_PACKAGE, 
"org.apache.felix.cm.integration.helper" ).set(
-                    Constants.BUNDLE_ACTIVATOR, activatorClassName ).set( 
BaseTestActivator.HEADER_PID, pid ) ).build(
-            TinyBundles.asStream() );
+        final InputStream bundleStream = new MyTinyBundle()
+            .prepare(
+                TinyBundles.withBnd()
+                .set( Constants.BUNDLE_SYMBOLICNAME, activatorClassName )
+                .set( Constants.BUNDLE_VERSION, "0.0.11" )
+                .set( Constants.IMPORT_PACKAGE, 
"org.apache.felix.cm.integration.helper" )
+                .set( Constants.BUNDLE_ACTIVATOR, activatorClassName )
+                .set( BaseTestActivator.HEADER_PID, pid )
+            ).build( TinyBundles.asStream() );
 
         try
         {


Reply via email to