geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r766263 - in /geronimo/sandbox/blueprint: blueprint-api/pom.xml blueprint-bundle/ blueprint-bundle/pom.xml itests/pom.xml itests/src/test/java/org/apache/felix/blueprint/itests/Test.java pom.xml
Date Sat, 18 Apr 2009 08:00:00 GMT
Author: gnodet
Date: Sat Apr 18 08:00:00 2009
New Revision: 766263

URL: http://svn.apache.org/viewvc?rev=766263&view=rev
Log:
Add a bundle containing all the needed dependencies (is asm really required?)

Added:
    geronimo/sandbox/blueprint/blueprint-bundle/   (with props)
    geronimo/sandbox/blueprint/blueprint-bundle/pom.xml
Modified:
    geronimo/sandbox/blueprint/blueprint-api/pom.xml
    geronimo/sandbox/blueprint/itests/pom.xml
    geronimo/sandbox/blueprint/itests/src/test/java/org/apache/felix/blueprint/itests/Test.java
    geronimo/sandbox/blueprint/pom.xml

Modified: geronimo/sandbox/blueprint/blueprint-api/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-api/pom.xml?rev=766263&r1=766262&r2=766263&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-api/pom.xml (original)
+++ geronimo/sandbox/blueprint/blueprint-api/pom.xml Sat Apr 18 08:00:00 2009
@@ -34,6 +34,7 @@
                 <configuration>
                     <instructions>
                         <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+                        <Export-Package>org.osgi.service.blueprint*;version="1.0"</Export-Package>
                     </instructions>
                 </configuration>
                 <executions>

Propchange: geronimo/sandbox/blueprint/blueprint-bundle/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Apr 18 08:00:00 2009
@@ -0,0 +1,2 @@
+*.iml
+target

Added: geronimo/sandbox/blueprint/blueprint-bundle/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-bundle/pom.xml?rev=766263&view=auto
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-bundle/pom.xml (added)
+++ geronimo/sandbox/blueprint/blueprint-bundle/pom.xml Sat Apr 18 08:00:00 2009
@@ -0,0 +1,58 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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.
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>blueprint</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>blueprint-bundle</artifactId>
+    <packaging>bundle</packaging>
+    <name>Blueprint Bundle</name>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+                        <Bundle-Activator>org.apache.felix.blueprint.Activator</Bundle-Activator>
+                        <Export-Package>
+                            org.osgi.service.blueprint*;version="1.0",
+                            org.apache.felix.blueprint*;version="${pom.version}"
+                        </Export-Package>
+                        <Private-Package>
+                            org.apache.xbean*
+                        </Private-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.blueprint</artifactId>
+            <version>${version}</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+</project>

Modified: geronimo/sandbox/blueprint/itests/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/itests/pom.xml?rev=766263&r1=766262&r2=766263&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/itests/pom.xml (original)
+++ geronimo/sandbox/blueprint/itests/pom.xml Sat Apr 18 08:00:00 2009
@@ -36,7 +36,13 @@
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.blueprint</artifactId>
+            <artifactId>blueprint-bundle</artifactId>
+            <version>${pom.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>sample</artifactId>
             <version>${pom.version}</version>
             <scope>test</scope>
         </dependency>

Modified: geronimo/sandbox/blueprint/itests/src/test/java/org/apache/felix/blueprint/itests/Test.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/itests/src/test/java/org/apache/felix/blueprint/itests/Test.java?rev=766263&r1=766262&r2=766263&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/itests/src/test/java/org/apache/felix/blueprint/itests/Test.java
(original)
+++ geronimo/sandbox/blueprint/itests/src/test/java/org/apache/felix/blueprint/itests/Test.java
Sat Apr 18 08:00:00 2009
@@ -18,11 +18,20 @@
  */
 package org.apache.felix.blueprint.itests;
 
+import java.net.URLDecoder;
+
 import org.apache.servicemix.kernel.testing.support.AbstractIntegrationTest;
+import org.osgi.framework.Bundle;
+import org.springframework.core.io.Resource;
+import org.springframework.util.Assert;
 
 public class Test extends AbstractIntegrationTest {
 
     public void test() throws Exception {
+        Resource res = locateBundle(getBundle("org.apache.felix", "sample"));
+        Bundle bundle = installBundle(res);
+        assertNotNull(bundle);
+        bundle.start();
     }
 
     /**
@@ -53,10 +62,27 @@
 	 */
 	protected String[] getTestBundlesNames() {
         return new String[] {
-                getBundle("org.apache.xbean", "xbean-reflect"),
-                getBundle("org.apache.felix", "blueprint-api"),
-                getBundle("org.apache.felix", "org.apache.felix.blueprint"),
+                getBundle("org.apache.felix", "blueprint-bundle"),
 		};
 	}
 
+    private Bundle installBundle(Resource location) throws Exception {
+        Assert.notNull(bundleContext);
+        Assert.notNull(location);
+        if (logger.isDebugEnabled())
+            logger.debug("Installing bundle from location " + location.getDescription());
+
+        String bundleLocation;
+
+        try {
+            bundleLocation = URLDecoder.decode(location.getURL().toExternalForm(), "UTF-8");
+        }
+        catch (Exception ex) {
+            // the URL cannot be created, fall back to the description
+            bundleLocation = location.getDescription();
+        }
+
+        return bundleContext.installBundle(bundleLocation, location.getInputStream());
+    }
+
 }

Modified: geronimo/sandbox/blueprint/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/pom.xml?rev=766263&r1=766262&r2=766263&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/pom.xml (original)
+++ geronimo/sandbox/blueprint/pom.xml Sat Apr 18 08:00:00 2009
@@ -66,6 +66,7 @@
     <modules>
         <module>blueprint-api</module>
         <module>org.apache.felix.blueprint</module>
+        <module>blueprint-bundle</module>
         <module>sample</module>
         <module>itests</module>
     </modules>



Mime
View raw message