[jboss-cvs] JBossAS SVN: r94593 - in projects/jboss-osgi/projects/bundles/husky/trunk: harness and 8 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Oct 9 08:44:30 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-10-09 08:44:30 -0400 (Fri, 09 Oct 2009)
New Revision: 94593

Added:
   projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/META-INF/
   projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/META-INF/services/
   projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
   projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties
Removed:
   projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-felix.properties
   projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
Modified:
   projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml
   projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java
   projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java
   projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
   projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml
   projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/scripts/assembly-bundles.xml
   projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
   projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java
   projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java
Log:
[JBOSGI-163] Husky invocation before async extender processing

Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml	2009-10-09 12:31:14 UTC (rev 94592)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml	2009-10-09 12:44:30 UTC (rev 94593)
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.jboss.osgi.bundles</groupId>
     <artifactId>jboss-osgi-husky-parent</artifactId>
-    <version>1.0.0</version>
+    <version>1.0.1-SNAPSHOT</version>
   </parent>
 
   <!-- Dependencies -->

Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java	2009-10-09 12:31:14 UTC (rev 94592)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java	2009-10-09 12:44:30 UTC (rev 94593)
@@ -50,7 +50,11 @@
 
    public void addPackageListener(PackageListener listener)
    {
-      listeners.add(listener);
+      synchronized (listeners)
+      {
+         listeners.add(listener);
+         listeners.notifyAll();
+      }
    }
 
    public List<PackageListener> getPackageListeners()
@@ -60,20 +64,45 @@
 
    public void removePackageListener(PackageListener listener)
    {
-      listeners.remove(listener);
+      synchronized (listeners)
+      {
+         listeners.remove(listener);
+      }
    }
-   
+
    public Response process(Request req) throws ClassNotFoundException
    {
       String testClass = req.getClassName();
-      for (PackageListener listener : listeners)
+
+      int timeout = 50;
+      PackageListener listener = null;
+      while (listener == null && 0 < timeout--)
       {
-         if (listener.match(req))
+         synchronized (listeners)
          {
-            return listener.runTests(req);
+            try
+            {
+               for (PackageListener aux : listeners)
+               {
+                  if (aux.match(req))
+                  {
+                     listener = aux;
+                     break;
+                  }
+               }
+               listeners.wait(200);
+            }
+            catch (InterruptedException e)
+            {
+               // ignore
+            }
          }
       }
-      throw new IllegalStateException("Cannot find listener to handle: " + testClass + ", we have " + listeners);
+
+      if (listener == null)
+         throw new IllegalStateException("Cannot find listener to handle: " + testClass + ", we have " + listeners);
+
+      return listener.runTests(req);
    }
 
    protected InputStream process(InputStream reqStream)
@@ -85,7 +114,7 @@
          // Unmarshall the Request
          ObjectInputStream ois = new ObjectInputStream(reqStream);
          request = (Request)ois.readObject();
-         
+
          // Field the request through the abstract connector
          response = process(request);
       }
@@ -100,7 +129,7 @@
          }
          response.addFailure(failure);
       }
-   
+
       // Marshall the Response
       try
       {
@@ -108,7 +137,7 @@
          ObjectOutputStream oos = new ObjectOutputStream(baos);
          oos.writeObject(response);
          oos.close();
-         
+
          return new ByteArrayInputStream(baos.toByteArray());
       }
       catch (IOException ex)

Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java	2009-10-09 12:31:14 UTC (rev 94592)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java	2009-10-09 12:44:30 UTC (rev 94593)
@@ -47,7 +47,7 @@
     * Handles the test request by dispatching to one of the 
     * associated {@link PackageListener}s. 
     *
-    * @throws RuntimeException if no {@link PackageListener} can 
+    * @throws RuntimeException if no {@link PackageListener} can be found
     */
    Response process(Request req) throws ClassNotFoundException;
    

Modified: projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml	2009-10-09 12:31:14 UTC (rev 94592)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml	2009-10-09 12:44:30 UTC (rev 94593)
@@ -22,21 +22,22 @@
   <artifactId>jboss-osgi-husky-parent</artifactId>
   <packaging>pom</packaging>
 
-  <version>1.0.0</version>
+  <version>1.0.1-SNAPSHOT</version>
   
   <!-- Parent -->
   <parent>
     <groupId>org.jboss.osgi</groupId>
     <artifactId>jboss-osgi-parent</artifactId>
-    <version>1.0.1</version>
+    <version>1.0.3-SNAPSHOT</version>
   </parent>
 
   <!-- Properties -->
   <properties>
+    <version.aqute.bnd>0.0.356</version.aqute.bnd>
     <version.apache.felix.log>1.0.0</version.apache.felix.log>
-    <version.jboss.osgi.jmx>1.0.0</version.jboss.osgi.jmx>
-    <version.jboss.osgi.runtime.felix>1.0.0</version.jboss.osgi.runtime.felix>
-    <version.osgi>r4v41</version.osgi>
+    <version.jboss.osgi.jmx>1.0.1</version.jboss.osgi.jmx>
+    <version.jboss.osgi.runtime.felix>2.0.0</version.jboss.osgi.runtime.felix>
+    <version.osgi>r4v42</version.osgi>
   </properties>
   
   <!-- Modules -->
@@ -49,6 +50,11 @@
   <dependencyManagement>
     <dependencies>
       <dependency>
+        <groupId>biz.aQute</groupId>
+        <artifactId>bnd</artifactId>
+        <version>${version.aqute.bnd}</version>
+      </dependency>
+      <dependency>
         <groupId>org.apache.felix</groupId>
         <artifactId>org.apache.felix.log</artifactId>
         <version>${version.apache.felix.log}</version>
@@ -59,7 +65,7 @@
         <version>${version.jboss.osgi.jmx}</version>
       </dependency>
       <dependency>
-        <groupId>org.jboss.osgi</groupId>
+        <groupId>org.jboss.osgi.runtime</groupId>
         <artifactId>jboss-osgi-runtime-felix</artifactId>
         <version>${version.jboss.osgi.runtime.felix}</version>
       </dependency>

Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml	2009-10-09 12:31:14 UTC (rev 94592)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml	2009-10-09 12:44:30 UTC (rev 94593)
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.jboss.osgi.bundles</groupId>
     <artifactId>jboss-osgi-husky-parent</artifactId>
-    <version>1.0.0</version>
+    <version>1.0.1-SNAPSHOT</version>
   </parent>
 
   <!-- Dependencies -->
@@ -36,13 +36,13 @@
       <version>${version}</version>
       <scope>provided</scope>
     </dependency>
-    
+
     <dependency>
       <groupId>biz.aQute</groupId>
       <artifactId>bnd</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.jboss.osgi</groupId>
+      <groupId>org.jboss.osgi.runtime</groupId>
       <artifactId>jboss-osgi-runtime-felix</artifactId>
     </dependency>
     <dependency>
@@ -53,7 +53,7 @@
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.compendium</artifactId>
     </dependency>
-    
+
     <!-- Bundle Dependencies -->
     <dependency>
       <groupId>org.apache.felix</groupId>
@@ -65,6 +65,13 @@
       <artifactId>jboss-osgi-jmx</artifactId>
       <scope>provided</scope>
     </dependency>
+
+    <!-- Test Dependencies -->
+    <dependency>
+      <groupId>org.jboss.logging</groupId>
+      <artifactId>jboss-logging-log4j</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
@@ -108,9 +115,28 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <systemProperties>
+            <property>
+              <name>test.archive.directory</name>
+              <value>${project.build.directory}/test-libs</value>
+            </property>
+            <property>
+              <name>log4j.output.dir</name>
+              <value>${project.build.directory}</value>
+            </property>
+            <property>
+              <name>org.jboss.osgi.husky.Invoker</name>
+              <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
+            </property>
+          </systemProperties>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
-  
+
   <!-- Profiles -->
   <profiles>
 
@@ -161,7 +187,7 @@
         </plugins>
       </build>
     </profile>
-    
+
   </profiles>
-  
+
 </project>

Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/scripts/assembly-bundles.xml	2009-10-09 12:31:14 UTC (rev 94592)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/scripts/assembly-bundles.xml	2009-10-09 12:44:30 UTC (rev 94593)
@@ -16,7 +16,9 @@
       <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
       <includes>
         <include>*:jboss-osgi-common:jar</include>
+        <include>*:jboss-osgi-common-core:jar</include>
         <include>*:jboss-osgi-jmx:jar</include>
+        <include>*:jboss-osgi-jndi:jar</include>
         <include>*:jboss-osgi-husky:jar</include>
         <include>*:org.apache.felix.log:jar</include>
         <include>*:org.osgi.compendium:jar</include>

Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java	2009-10-09 12:31:14 UTC (rev 94592)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java	2009-10-09 12:44:30 UTC (rev 94593)
@@ -54,7 +54,7 @@
    private OSGiRuntime runtime;
 
    @Before
-   public void setUp() throws BundleException
+   public void setUp() throws Exception
    {
       if (context == null)
       {

Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java	2009-10-09 12:31:14 UTC (rev 94592)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java	2009-10-09 12:44:30 UTC (rev 94593)
@@ -54,7 +54,7 @@
    private static int testCount;
    
    @BeforeClass
-   public static void beforeClass() throws BundleException
+   public static void beforeClass() throws Exception
    {
       if (context == null)
       {

Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java	2009-10-09 12:31:14 UTC (rev 94592)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java	2009-10-09 12:44:30 UTC (rev 94593)
@@ -54,7 +54,7 @@
    private static OSGiRuntime runtime;
 
    @BeforeClass
-   public static void beforeClass() throws BundleException
+   public static void beforeClass() throws Exception
    {
       if (context == null)
       {

Copied: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider (from rev 94555, projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider)
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider	                        (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider	2009-10-09 12:44:30 UTC (rev 94593)
@@ -0,0 +1 @@
+org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
\ No newline at end of file

Deleted: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-felix.properties	2009-10-09 12:31:14 UTC (rev 94592)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-felix.properties	2009-10-09 12:44:30 UTC (rev 94593)
@@ -1,40 +0,0 @@
-#
-# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
-# 
-# $Id$
-#
-
-# The OSGiFramework implementation 
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
-
-# Properties to configure the Framework
-org.osgi.framework.storage=${test.archive.directory}/../osgi-store
-org.osgi.framework.storage.clean=onFirstInit
-
-# Husky socket connector properties
-org.jboss.osgi.husky.runtime.connector.host=localhost
-org.jboss.osgi.husky.runtime.connector.port=5401
-
-# Framework bootdelegation
-# org.osgi.framework.bootdelegation=org.osgi.service.log
-
-# Extra System Packages
-org.osgi.framework.system.packages.extra=\
-	org.jboss.logging, \
-  	org.jboss.osgi.spi;version=1.0, \
-  	org.jboss.osgi.spi.capability;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, \
-  	org.osgi.framework;version=1.4
-
-# Bundles that need to be installed with the Framework automatically 
-org.jboss.osgi.spi.framework.autoInstall=\
-	file://${test.archive.directory}/bundles/org.osgi.compendium.jar
-
-# Bundles that need to be started automatically 
-org.jboss.osgi.spi.framework.autoStart=\
-	file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
-	file://${test.archive.directory}/bundles/jboss-osgi-common.jar 

Copied: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties (from rev 94555, projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-felix.properties)
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties	                        (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties	2009-10-09 12:44:30 UTC (rev 94593)
@@ -0,0 +1,40 @@
+#
+# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
+# 
+# $Id$
+#
+
+# The OSGiFramework implementation 
+org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
+
+# Properties to configure the Framework
+org.osgi.framework.storage=${test.archive.directory}/../osgi-store
+org.osgi.framework.storage.clean=onFirstInit
+
+# Husky socket connector properties
+org.jboss.osgi.husky.runtime.connector.host=localhost
+org.jboss.osgi.husky.runtime.connector.port=5401
+
+# Framework bootdelegation
+# org.osgi.framework.bootdelegation=org.osgi.service.log
+
+# Extra System Packages
+org.osgi.framework.system.packages.extra=\
+	org.jboss.logging, \
+  	org.jboss.osgi.spi;version=1.0, \
+  	org.jboss.osgi.spi.capability;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, \
+  	org.osgi.framework;version=1.4
+
+# Bundles that need to be installed with the Framework automatically 
+org.jboss.osgi.spi.framework.autoInstall=\
+	file://${test.archive.directory}/bundles/org.osgi.compendium.jar
+
+# Bundles that need to be started automatically 
+org.jboss.osgi.spi.framework.autoStart=\
+	file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
+	file://${test.archive.directory}/bundles/jboss-osgi-common.jar 

Deleted: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider	2009-10-09 12:31:14 UTC (rev 94592)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/org.jboss.osgi.spi.framework.OSGiBootstrapProvider	2009-10-09 12:44:30 UTC (rev 94593)
@@ -1 +0,0 @@
-org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
\ No newline at end of file




More information about the jboss-cvs-commits mailing list