[jboss-osgi-commits] JBoss-OSGI SVN: r87351 - in projects/jboss-osgi/trunk: bundle/common and 11 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Wed Apr 15 10:25:32 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-04-15 10:25:32 -0400 (Wed, 15 Apr 2009)
New Revision: 87351

Added:
   projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml
Modified:
   projects/jboss-osgi/trunk/bundle/common/pom.xml
   projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
   projects/jboss-osgi/trunk/bundle/webconsole/pom.xml
   projects/jboss-osgi/trunk/pom.xml
   projects/jboss-osgi/trunk/runtime/felix/pom.xml
   projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml
   projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
   projects/jboss-osgi/trunk/testsuite/pom.xml
   projects/jboss-osgi/trunk/testsuite/scripts/assembly-bundles.xml
   projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java
   projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
   projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
Log:
[JBOSGI-37] Verify local framework

Modified: projects/jboss-osgi/trunk/bundle/common/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/pom.xml	2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/bundle/common/pom.xml	2009-04-15 14:25:32 UTC (rev 87351)
@@ -37,7 +37,7 @@
         <extensions>true</extensions>
         <configuration>
           <instructions>
-            <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+            <Bundle-SymbolicName>org.jboss.osgi.common</Bundle-SymbolicName>
             <Export-Package>
               org.jboss.osgi.common,
               org.jboss.osgi.common.log

Modified: projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/pom.xml	2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/bundle/remotelog/pom.xml	2009-04-15 14:25:32 UTC (rev 87351)
@@ -72,7 +72,7 @@
         <extensions>true</extensions>
         <configuration>
           <instructions>
-            <Bundle-SymbolicName>org.jboss.osgi.service.remote.log</Bundle-SymbolicName>
+            <Bundle-SymbolicName>org.jboss.osgi.service.remotelog</Bundle-SymbolicName>
             <Bundle-Activator>org.jboss.osgi.service.remotelog.RemoteLogActivator</Bundle-Activator>
             <Export-Package>org.jboss.osgi.service.remotelog;version=${version}</Export-Package>
             <Import-Package>

Modified: projects/jboss-osgi/trunk/bundle/webconsole/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/webconsole/pom.xml	2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/bundle/webconsole/pom.xml	2009-04-15 14:25:32 UTC (rev 87351)
@@ -107,8 +107,7 @@
         <extensions>true</extensions>
         <configuration>
           <instructions>
-            <Bundle-Vendor>JBoss, a division of RedHat</Bundle-Vendor>
-            <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+            <Bundle-SymbolicName>org.jboss.osgi.service.webconsole</Bundle-SymbolicName>
             <Bundle-Activator>org.jboss.osgi.service.webconsole.internal.WebConsoleActivator</Bundle-Activator>
             <Export-Package>
               org.apache.felix.webconsole;version=${version.felix.webconsole},

Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml	2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/pom.xml	2009-04-15 14:25:32 UTC (rev 87351)
@@ -19,8 +19,10 @@
   <description>JBossOSGi</description>
 
   <scm>
-    <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk/</connection>
-    <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk/</developerConnection>
+    <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk/
+    </connection>
+    <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk/
+    </developerConnection>
     <url>http://fisheye.jboss.com/qsearch/JBossOSGi/</url>
   </scm>
 
@@ -288,6 +290,17 @@
           <autoVersionSubmodules>true</autoVersionSubmodules>
         </configuration>
       </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <systemProperties>
+            <property>
+              <name>test.archive.directory</name>
+              <value>${project.build.directory}/test-libs</value>
+            </property>
+          </systemProperties>
+        </configuration>
+      </plugin>
     </plugins>
 
     <!-- PluginManagement -->

Modified: projects/jboss-osgi/trunk/runtime/felix/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/pom.xml	2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/runtime/felix/pom.xml	2009-04-15 14:25:32 UTC (rev 87351)
@@ -34,6 +34,24 @@
       <groupId>org.apache.felix</groupId>
       <artifactId>org.osgi.compendium</artifactId>
     </dependency>
+    
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.log</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-common</artifactId>
+      <version>${version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-logging</artifactId>
+      <version>${version}</version>
+      <scope>provided</scope>
+    </dependency>
 
     <!-- Test Dependencies -->
     <dependency>
@@ -61,6 +79,21 @@
         <artifactId>maven-assembly-plugin</artifactId>
         <executions>
           <execution>
+            <id>bundles</id>
+            <phase>test-compile</phase>
+            <goals>
+              <goal>directory-single</goal>
+            </goals>
+            <configuration>
+              <finalName>test-libs</finalName>
+              <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+              <appendAssemblyId>false</appendAssemblyId>
+              <descriptors>
+                <descriptor>scripts/assembly-bundles.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
+          <execution>
             <phase>package</phase>
             <goals>
               <goal>single</goal>

Added: projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml	2009-04-15 14:25:32 UTC (rev 87351)
@@ -0,0 +1,28 @@
+<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+
+  <id>deploy-artifacts</id>
+  <formats>
+    <format>dir</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <!-- Dependency Sets -->
+  <dependencySets>
+  
+    <!-- bundle -->
+    <dependencySet>
+      <outputDirectory>bundles</outputDirectory>
+      <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+      <includes>
+        <include>*:org.apache.felix.log:jar</include>
+        <include>*:jboss-osgi-common:jar</include>
+        <include>*:jboss-osgi-logging:jar</include>
+      </includes>
+      <useStrictFiltering>true</useStrictFiltering>
+      <scope>provided</scope>
+      <unpack>false</unpack>
+    </dependencySet>
+    
+  </dependencySets>
+</assembly>


Property changes on: projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml	2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml	2009-04-15 14:25:32 UTC (rev 87351)
@@ -36,6 +36,13 @@
     <entry><key>org.jboss.osgi.service.remote.log.port</key><value>5400</value></entry>
    </map>
   </property>
+  <property name="autoStart">
+   <list elementClass="java.net.URI">
+    <value>file://${test.archive.directory}/bundles/org.apache.felix.log.jar</value>
+    <value>file://${test.archive.directory}/bundles/jboss-osgi-common.jar</value>
+    <value>file://${test.archive.directory}/bundles/jboss-osgi-logging.jar</value>
+   </list>
+  </property>
  </bean>
 
 </deployment>

Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java	2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java	2009-04-15 14:25:32 UTC (rev 87351)
@@ -100,6 +100,7 @@
    
    protected void stopRemoteLogging() throws Exception
    {
+      // Undeploy the RemoteLogListener from the remote OSGiFramework.
       undeployBundle("bundles/jboss-osgi-remotelog.jar");
    }
    

Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml	2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml	2009-04-15 14:25:32 UTC (rev 87351)
@@ -60,6 +60,12 @@
     </dependency>
     <dependency>
       <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-logging</artifactId>
+      <version>${version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
       <artifactId>jboss-osgi-remotelog</artifactId>
       <version>${version}</version>
       <scope>provided</scope>
@@ -71,6 +77,11 @@
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <!-- Build -->
@@ -86,10 +97,10 @@
         <artifactId>maven-assembly-plugin</artifactId>
         <executions>
           <execution>
-            <id>thirdparty-bundles</id>
+            <id>bundles</id>
             <phase>test-compile</phase>
             <goals>
-              <goal>single</goal>
+              <goal>directory-single</goal>
             </goals>
             <configuration>
               <finalName>test-libs</finalName>

Modified: projects/jboss-osgi/trunk/testsuite/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/scripts/assembly-bundles.xml	2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/testsuite/scripts/assembly-bundles.xml	2009-04-15 14:25:32 UTC (rev 87351)
@@ -16,8 +16,8 @@
       <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
       <includes>
         <include>*:org.apache.felix.log:jar</include>
-        <include>*:org.osgi.compendium:jar</include>
         <include>*:jboss-osgi-common:jar</include>
+        <include>*:jboss-osgi-logging:jar</include>
         <include>*:jboss-osgi-remotelog:jar</include>
       </includes>
       <useStrictFiltering>true</useStrictFiltering>

Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java	2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java	2009-04-15 14:25:32 UTC (rev 87351)
@@ -23,7 +23,13 @@
 
 //$Id$
 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.osgi.spi.framework.OSGiFramework;
 import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
 
 /**
  * [JBOSGI-37] Prevent creation of deployment unit for nested jars
@@ -35,7 +41,32 @@
  */
 public class OSGI37TestCase extends OSGiTest
 {
-   public void testServiceA() throws Exception
+   private BundleContext sysContext;
+   
+   @Override
+   protected void setUp() throws Exception
    {
+      super.setUp();
+      
+      OSGiFramework framework = getBootstrapProvider().getFramework();
+      sysContext = framework.getSystemBundleContext();
    }
+
+   public void testNestedBundle() throws Exception
+   {
+      Bundle bundleA = installBundle(sysContext, "jbosgi37-bundleA.jar", true);
+      
+      assertEquals("Bundle started", Bundle.ACTIVE, bundleA.getState());
+      
+      List<String> relevant = new ArrayList<String>();
+      for (Bundle bundle : sysContext.getBundles())
+      {
+         String symbolicName = bundle.getSymbolicName();
+         if (symbolicName.startsWith("jbosgi37"))
+            relevant.add(symbolicName);
+      }
+
+      assertEquals("No Sub Bundle", 1, relevant.size());
+      assertEquals("jbosgi37-bundleA", relevant.get(0));
+   }
 }
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java	2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java	2009-04-15 14:25:32 UTC (rev 87351)
@@ -23,17 +23,23 @@
 
 //$Id$
 
+import org.jboss.osgi.common.log.LogServiceTracker;
 import org.jboss.test.osgi.jbosgi37.subA.PojoA;
 import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
 
 /**
  * ServiceA has a dependecy on PojoA
  */
 public class ServiceA
 {
+   private LogService log;
+   
    ServiceA(BundleContext context)
    {
+      log = new LogServiceTracker(context);
+      
       PojoA pojo = new PojoA(context.getBundle().getSymbolicName());
-      System.out.println(pojo);
+      log.log(LogService.LOG_INFO, "Bundle-SymbolicName: " + pojo);
    }
 }

Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java	2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java	2009-04-15 14:25:32 UTC (rev 87351)
@@ -23,17 +23,23 @@
 
 //$Id$
 
+import org.jboss.osgi.common.log.LogServiceTracker;
 import org.jboss.test.osgi.jbosgi37.subB.PojoB;
 import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
 
 /**
  * ServiceB has a dependecy on PojoB
  */
 public class ServiceB
 {
+   private LogService log;
+   
    ServiceB(BundleContext context)
    {
+      log = new LogServiceTracker(context);
+      
       PojoB pojo = new PojoB(context.getBundle().getSymbolicName());
-      System.out.println(pojo);
+      log.log(LogService.LOG_INFO, "Bundle-SymbolicName: " + pojo);
    }
 }




More information about the jboss-osgi-commits mailing list