[jboss-osgi-commits] JBoss-OSGI SVN: r94434 - in projects/jboss-osgi/trunk: reactor/blueprint/testsuite/scripts and 5 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Tue Oct 6 16:22:37 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-10-06 16:22:37 -0400 (Tue, 06 Oct 2009)
New Revision: 94434

Added:
   projects/jboss-osgi/trunk/reactor/blueprint/testsuite/scripts/assembly-compendium-felix.xml
   projects/jboss-osgi/trunk/reactor/blueprint/testsuite/scripts/assembly-compendium.xml
   projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
Modified:
   projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml
   projects/jboss-osgi/trunk/reactor/blueprint/testsuite/scripts/assembly-bundles.xml
   projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
   projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
Log:
Use jbossmc framework as default for blueprint.
Allow grace periode for BP container to become available.

Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml	2009-10-06 18:59:39 UTC (rev 94433)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml	2009-10-06 20:22:37 UTC (rev 94434)
@@ -53,13 +53,6 @@
       <scope>provided</scope>
     </dependency>
     
-    <!-- OSGi Framework -->
-    <dependency>
-      <groupId>org.jboss.osgi.runtime</groupId>
-      <artifactId>jboss-osgi-runtime-felix</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    
     <!-- Bundle Dependencies --> 
     <dependency>
       <groupId>org.apache.felix</groupId>
@@ -152,6 +145,7 @@
 
   <!-- Profiles -->
   <profiles>
+  
     <!--
       Name: framework-equinox
       Descr: Setup for Equinox framework integration testing
@@ -177,6 +171,51 @@
     </profile>
 
     <!--
+      Name: framework-felix
+      Descr: Setup for Equinox framework integration testing
+    -->
+    <profile>
+      <id>framework-felix</id>
+      <activation>
+        <property>
+          <name>framework</name>
+          <value>felix</value>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.osgi.runtime</groupId>
+          <artifactId>jboss-osgi-runtime-felix</artifactId>
+          <scope>provided</scope>
+        </dependency>
+      </dependencies>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>compendium</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-compendium-felix.xml</descriptor>
+                  </descriptors>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+         </plugins>
+      </build>
+    </profile>
+
+    <!--
       Name: framework-jbossmc
       Descr: Setup for JBossMC framework integration testing
     -->
@@ -188,17 +227,77 @@
           <value>jbossmc</value>
         </property>
       </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.osgi.runtime</groupId>
+          <artifactId>jboss-osgi-framework</artifactId>
+          <scope>provided</scope>
+        </dependency>
+      </dependencies>
       <build>
         <plugins>
           <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <configuration>
-              <skipTests>true</skipTests>
-            </configuration>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>compendium</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-compendium.xml</descriptor>
+                  </descriptors>
+                </configuration>
+              </execution>
+            </executions>
           </plugin>
-        </plugins>
+         </plugins>
       </build>
     </profile>
+    <profile>
+      <id>framework-default</id>
+      <activation>
+        <property>
+          <name>!framework</name>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.osgi.runtime</groupId>
+          <artifactId>jboss-osgi-framework</artifactId>
+          <scope>provided</scope>
+        </dependency>
+      </dependencies>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>compendium</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-compendium.xml</descriptor>
+                  </descriptors>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+         </plugins>
+      </build>
+    </profile>
 
     <!--
       Name: remote-testing 

Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/scripts/assembly-bundles.xml	2009-10-06 18:59:39 UTC (rev 94433)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/scripts/assembly-bundles.xml	2009-10-06 20:22:37 UTC (rev 94434)
@@ -1,7 +1,6 @@
 <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
 
-  <id>deploy-artifacts</id>
   <formats>
     <format>dir</format>
   </formats>
@@ -26,7 +25,6 @@
         <include>*:jboss-osgi-microcontainer:jar</include>
         <include>*:jboss-osgi-xml-binding:jar</include>
         <include>*:org.apache.felix.log:jar</include>
-        <include>org.apache.felix:org.osgi.compendium:jar</include>
       </includes>
       <useStrictFiltering>true</useStrictFiltering>
       <scope>provided</scope>

Added: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/scripts/assembly-compendium-felix.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/scripts/assembly-compendium-felix.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/scripts/assembly-compendium-felix.xml	2009-10-06 20:22:37 UTC (rev 94434)
@@ -0,0 +1,25 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+
+  <formats>
+    <format>dir</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <!-- Dependency Sets -->
+  <dependencySets>
+  
+    <!-- bundles -->
+    <dependencySet>
+      <outputDirectory>bundles</outputDirectory>
+      <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+      <includes>
+        <include>org.apache.felix:org.osgi.compendium:jar</include>
+      </includes>
+      <useStrictFiltering>false</useStrictFiltering>
+      <scope>provided</scope>
+      <unpack>false</unpack>
+    </dependencySet>
+    
+  </dependencySets>
+</assembly>

Added: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/scripts/assembly-compendium.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/scripts/assembly-compendium.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/scripts/assembly-compendium.xml	2009-10-06 20:22:37 UTC (rev 94434)
@@ -0,0 +1,25 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+
+  <formats>
+    <format>dir</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <!-- Dependency Sets -->
+  <dependencySets>
+  
+    <!-- bundles -->
+    <dependencySet>
+      <outputDirectory>bundles</outputDirectory>
+      <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+      <includes>
+        <include>org.osgi:org.osgi.compendium:jar</include>
+      </includes>
+      <useStrictFiltering>false</useStrictFiltering>
+      <scope>provided</scope>
+      <unpack>false</unpack>
+    </dependencySet>
+    
+  </dependencySets>
+</assembly>

Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java	2009-10-06 18:59:39 UTC (rev 94433)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java	2009-10-06 20:22:37 UTC (rev 94434)
@@ -268,11 +268,19 @@
       assertEquals("InterfaceName", MBeanServer.class.getName(), interfaceName);
    }
 
-   private BlueprintContainer getBlueprintContainer()
+   private BlueprintContainer getBlueprintContainer() throws Exception
    {
-      ServiceReference sref = context.getServiceReference(BlueprintContainer.class.getName());
-      assertNotNull("BlueprintContainer service not null", sref);
+      // 10sec for processing of STARTING event
+      int timeout = 50;
       
+      ServiceReference sref = null;
+      while (sref == null && 0 < timeout--)
+      {
+         sref = context.getServiceReference(BlueprintContainer.class.getName());
+         Thread.sleep(200);
+      }
+      assertNotNull("BlueprintContainer not null", sref);
+      
       BlueprintContainer bpContainer = (BlueprintContainer)context.getService(sref);
       return bpContainer;
    }

Added: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/META-INF/jboss-osgi-bootstrap.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/META-INF/jboss-osgi-bootstrap.xml	2009-10-06 20:22:37 UTC (rev 94434)
@@ -0,0 +1,190 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <!-- 
+  ********************************
+  *                              *  
+  *  OSGi Framework              *
+  *                              *
+  ********************************
+  -->
+  
+  <bean name="OSGiBundleManager" class="org.jboss.osgi.framework.bundle.OSGiBundleManager">
+    <constructor>
+      <parameter><inject bean="jboss.kernel:service=Kernel" /></parameter>
+      <parameter><inject bean="MainDeployer" /></parameter>
+    </constructor>
+    <property name="properties">
+      <map keyClass="java.lang.String" valueClass="java.lang.String">
+        <entry><key>org.osgi.framework.storage</key><value>${log4j.output.dir}/osgi-store</value></entry>
+        <entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
+        <entry><key>org.osgi.framework.system.packages.extra</key><value>
+          <!-- [JBOSGI-145]  JAXB classes are loaded from the system classpath -->
+          com.sun.xml.internal.bind.v2,
+          
+          org.jboss.beans.metadata.plugins;version=2.0,
+          org.jboss.beans.metadata.plugins.builder;version=2.0,
+          org.jboss.beans.metadata.spi;version=2.0,
+          org.jboss.beans.metadata.spi.builder;version=2.0,
+          org.jboss.dependency.spi;version=2.0,
+          org.jboss.kernel.spi.dependency;version=2.0,
+          org.jboss.logging;version=2.0,
+          
+          org.jboss.osgi.spi;version=1.0,
+          org.jboss.osgi.spi.capability;version=1.0,
+          org.jboss.osgi.spi.framework;version=1.0,
+          org.jboss.osgi.spi.logging;version=1.0,
+          org.jboss.osgi.spi.management;version=1.0,
+          org.jboss.osgi.spi.service;version=1.0,
+          org.jboss.osgi.spi.testing;version=1.0,
+          org.jboss.osgi.spi.util;version=1.0
+        </value></entry>
+      </map>
+    </property>
+    <incallback method="addPlugin" />
+    <uncallback method="removePlugin" />
+  </bean>
+  
+  <!-- 
+  ********************************
+  *                              *  
+  *  OSGi Framework Plugins      *
+  *                              *
+  ********************************
+  -->
+  
+  <bean name="OSGiAutoInstallPlugin" class="org.jboss.osgi.framework.plugins.internal.AutoInstallPluginImpl">
+    <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+    <property name="autoInstall">
+     <list elementClass="java.net.URL">
+      <value>${test.archive.directory}/bundles/org.osgi.compendium.jar</value>
+     </list>
+    </property>
+    <property name="autoStart">
+     <list elementClass="java.net.URL">
+      <value>${test.archive.directory}/bundles/org.apache.felix.log.jar</value>
+      <value>${test.archive.directory}/bundles/jboss-osgi-common.jar</value>
+     </list>
+    </property>
+  </bean>
+  <bean name="OSGiFrameworkEventsPlugin" class="org.jboss.osgi.framework.plugins.internal.FrameworkEventsPluginImpl">
+    <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+    <property name="synchronous">true</property>
+  </bean>
+  <bean name="OSGiStoragePlugin" class="org.jboss.osgi.framework.plugins.internal.BundleStoragePluginImpl">
+    <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+  </bean>
+  <bean name="OSGiSystemPackages" class="org.jboss.osgi.framework.plugins.internal.SystemPackagesPluginImpl">
+    <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+  </bean>
+  
+  <!-- 
+  ********************************
+  *                              *  
+  *  OSGi Service Plugins        *
+  *                              *
+  ********************************
+  -->
+  
+  <bean name="MicrocontainerService" class="org.jboss.osgi.framework.service.internal.MicrocontainerServiceImpl">
+    <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+  </bean>
+  <bean name="StartLevelService" class="org.jboss.osgi.framework.service.internal.StartLevelImpl">
+    <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+  </bean>
+  <bean name="PackageAdminService" class="org.jboss.osgi.framework.service.internal.PackageAdminImpl">
+    <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+  </bean>
+  
+  <!--
+  ********************************
+  *                              *  
+  *  OSGi Deployment             *
+  *                              *
+  ********************************
+  -->
+  
+  <!-- The MainDeployer -->
+  <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+    <property name="structuralDeployers"><inject bean="StructuralDeployers" /></property>
+    <property name="deployers"><inject bean="Deployers" /></property>
+  </bean>
+
+  <!-- The holder for deployers that determine structure -->
+  <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+    <property name="structureBuilder">
+      <!-- The consolidator of the structure information -->
+      <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder" />
+    </property>
+    <!-- Accept any implementor of structure deployer -->
+    <incallback method="addDeployer" />
+    <uncallback method="removeDeployer" />
+  </bean>
+
+  <!-- The holder for deployers that do real deployment -->
+  <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+    <constructor><parameter><inject bean="jboss.kernel:service=KernelController" /></parameter></constructor>
+    <!-- Accept any implementor of deployer -->
+    <incallback method="addDeployer" />
+    <uncallback method="removeDeployer" />
+  </bean>
+
+  <!-- Bundle Structure -->
+  <bean name="BundleStructure" class="org.jboss.osgi.deployer.BundleStructureDeployer" />
+  
+  <!-- JAR & File Structure (needed for negative testing) -->
+  <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure" />
+  <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure" />
+
+  <!-- POJO Deployment -->
+  <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer" />
+  <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer" />
+  <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+    <constructor>
+      <parameter class="org.jboss.dependency.spi.Controller"><inject bean="jboss.kernel:service=KernelController" /></parameter>
+    </constructor>
+  </bean>
+
+  <!-- OSGI Deployment -->
+  <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
+  <bean name="OSGiBundleStateDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateDeployer">
+    <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+  </bean>
+  <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
+
+  <!--
+  ********************************
+  *                              *  
+  *  OSGi Classloading           *
+  *                              *
+  ********************************
+  -->
+  
+  <bean name="OSGiClassLoaderSystem" class="org.jboss.osgi.framework.classloading.OSGiClassLoaderSystem" />
+  <bean name="OSGiClassLoaderDomain" class="org.jboss.osgi.framework.classloading.OSGiClassLoaderDomain" >
+    <constructor><parameter>OSGiClassLoaderDomain</parameter></constructor>
+    <property name="classLoaderSystem"><inject bean="OSGiClassLoaderSystem"/></property>
+    <property name="bundleManager"><inject bean="OSGiBundleManager" /></property>
+  </bean>
+  <bean name="OSGiBundleClassLoadingDeployer" class="org.jboss.osgi.framework.classloading.OSGiBundleClassLoadingDeployer">
+    <property name="domain"><inject bean="OSGiClassLoaderDomain"/></property>
+  </bean>
+   
+  <bean name="ClassLoading" class="org.jboss.classloading.spi.dependency.ClassLoading">
+    <incallback method="addModule" state="Configured" />
+    <uncallback method="removeModule" state="Configured" />
+  </bean>
+  <bean name="ClassLoadingDefaultDeployer" class="org.jboss.deployers.plugins.classloading.ClassLoadingDefaultDeployer">
+    <property name="defaultMetaData">
+      <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY" import-all="true" />
+    </property>
+  </bean>
+  <bean name="ClassLoaderClassPathDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer" />
+  <bean name="ClassLoaderDescribeDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderDescribeDeployer">
+    <property name="classLoading"><inject bean="ClassLoading" /></property>
+  </bean>
+  <bean name="ClassLoaderDeployer" class="org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer">
+    <property name="classLoading"><inject bean="ClassLoading" /></property>
+    <property name="system"><inject bean="OSGiClassLoaderSystem" /></property>
+  </bean>
+
+</deployment>

Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider	2009-10-06 18:59:39 UTC (rev 94433)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider	2009-10-06 20:22:37 UTC (rev 94434)
@@ -1 +1,3 @@
-org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
\ No newline at end of file
+org.jboss.osgi.framework.launch.OSGiFrameworkBootstrapProvider  # The MC Framework bootstrap provider
+org.jboss.osgi.equinox.EquinoxBootstrapProvider                 # The Equinox bootstrap provider  
+org.jboss.osgi.felix.FelixBootstrapProvider                     # The Felix bootstrap provider
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java	2009-10-06 18:59:39 UTC (rev 94433)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java	2009-10-06 20:22:37 UTC (rev 94434)
@@ -105,10 +105,7 @@
       
       assumeNotNull(context);
       
-      ServiceReference sref = context.getServiceReference(BlueprintContainer.class.getName());
-      assertNotNull("BlueprintContainer service not null", sref);
-      
-      BlueprintContainer bpContainer = (BlueprintContainer)context.getService(sref);
+      BlueprintContainer bpContainer = getBlueprintContainer();
       assertNotNull("BlueprintContainer available", bpContainer);
    }
 
@@ -143,4 +140,21 @@
       BeanA beanA = service.getBeanA();
       assertNotNull("BeanA not null", beanA);
    }
+
+   private BlueprintContainer getBlueprintContainer() throws Exception
+   {
+      // 10sec for processing of STARTING event
+      int timeout = 50;
+      
+      ServiceReference sref = null;
+      while (sref == null && 0 < timeout--)
+      {
+         sref = context.getServiceReference(BlueprintContainer.class.getName());
+         Thread.sleep(200);
+      }
+      assertNotNull("BlueprintContainer not null", sref);
+      
+      BlueprintContainer bpContainer = (BlueprintContainer)context.getService(sref);
+      return bpContainer;
+   }
 }
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml	2009-10-06 18:59:39 UTC (rev 94433)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml	2009-10-06 20:22:37 UTC (rev 94434)
@@ -68,7 +68,6 @@
   </bean>
   <bean name="OSGiFrameworkEventsPlugin" class="org.jboss.osgi.framework.plugins.internal.FrameworkEventsPluginImpl">
     <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
-    <property name="synchronous">true</property>
   </bean>
   <bean name="OSGiStoragePlugin" class="org.jboss.osgi.framework.plugins.internal.BundleStoragePluginImpl">
     <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>



More information about the jboss-osgi-commits mailing list