[jboss-cvs] JBossAS SVN: r85158 - in projects/jboss-osgi/trunk: runtime/spi/src/main/java/org/jboss/osgi/spi/junit and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 3 06:32:43 EST 2009


Author: thomas.diesler at jboss.com
Date: 2009-03-03 06:32:42 -0500 (Tue, 03 Mar 2009)
New Revision: 85158

Added:
   projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38DeployerTestCase.java
Modified:
   projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/internal/MicrocontainerBootstrapProvider.java
   projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
   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/OSGiTest.java
Log:
Fix bootstrap issue. Add OSGI38DeployerTestCase

Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/internal/MicrocontainerBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/internal/MicrocontainerBootstrapProvider.java	2009-03-03 11:22:30 UTC (rev 85157)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/internal/MicrocontainerBootstrapProvider.java	2009-03-03 11:32:42 UTC (rev 85158)
@@ -43,6 +43,7 @@
 public class MicrocontainerBootstrapProvider extends AbstractInstanceProvider implements OSGiBootstrapProvider
 {
    private EmbeddedBeansDeployer deployer = new EmbeddedBeansDeployer();
+   private boolean bootstraped;
    private boolean configured;
 
    public OSGiFramework getFramework()
@@ -85,8 +86,11 @@
    {
       Object retObj = null;
 
-      if (configured == false)
+      if (bootstraped == false)
+      {
          bootstrapKernel();
+         bootstraped = true;
+      }
 
       if (KernelConstants.KERNEL_NAME.equals(name))
       {

Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java	2009-03-03 11:22:30 UTC (rev 85157)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java	2009-03-03 11:32:42 UTC (rev 85158)
@@ -24,10 +24,9 @@
 // $Id$
 
 import java.net.URL;
+
 import javax.management.MBeanServerConnection;
 
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-
 /**
  * An integration test case
  * 
@@ -37,7 +36,6 @@
 public abstract class IntegrationTest extends OSGiTest
 {
    private IntegrationTestHelper delegate;
-   private OSGiBootstrapProvider bootProvider;
 
    private IntegrationTestHelper getDelegate()
    {
@@ -48,52 +46,42 @@
       return delegate;
    }
 
-   public OSGiBootstrapProvider getBootstrapProvider()
+   protected boolean isRemoteIntegration()
    {
-      return bootProvider;
-   }
-
-   public void setBootstrapProvider(OSGiBootstrapProvider configProvider)
-   {
-      this.bootProvider = configProvider;
-   }
-
-   public boolean isRemoteIntegration()
-   {
       return IntegrationTestHelper.isRemoteIntegration();
    }
 
-   public boolean isTargetJBoss50()
+   protected boolean isTargetJBoss50()
    {
       return getDelegate().isTargetJBoss50();
    }
 
-   public void deploy(String archive) throws Exception
+   protected void deploy(String archive) throws Exception
    {
       getDelegate().deploy(archive);
    }
 
-   public void deploy(URL archive) throws Exception
+   protected void deploy(URL archive) throws Exception
    {
       getDelegate().deploy(archive);
    }
 
-   public void undeploy(String archive) throws Exception
+   protected void undeploy(String archive) throws Exception
    {
       getDelegate().undeploy(archive);
    }
 
-   public void undeploy(URL archive) throws Exception
+   protected void undeploy(URL archive) throws Exception
    {
       getDelegate().undeploy(archive);
    }
 
-   public MBeanServerConnection getServer()
+   protected MBeanServerConnection getServer()
    {
       return getDelegate().getServer();
    }
 
-   public String getServerHost()
+   protected String getServerHost()
    {
       return getDelegate().getServerHost();
    }

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-03-03 11:22:30 UTC (rev 85157)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java	2009-03-03 11:32:42 UTC (rev 85158)
@@ -30,8 +30,6 @@
 import javax.naming.NamingException;
 
 import org.jboss.deployers.client.spi.DeployerClient;
-import org.jboss.deployers.client.spi.main.MainDeployer;
-import org.jboss.osgi.spi.framework.NamedInstanceProvider;
 import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
 
 /**
@@ -43,12 +41,12 @@
 public class IntegrationTestHelper extends OSGiTestHelper
 {
    private static MBeanServerConnection server;
-   private OSGiBootstrapProvider configProvider;
+   private OSGiBootstrapProvider bootProvider;
    private String integrationTarget;
 
-   public IntegrationTestHelper(OSGiBootstrapProvider configProvider)
+   public IntegrationTestHelper(OSGiBootstrapProvider bootProvider)
    {
-      this.configProvider = configProvider;
+      this.bootProvider = bootProvider;
    }
 
    public void deploy(String archive) throws Exception
@@ -130,8 +128,7 @@
       }
       else
       {
-         NamedInstanceProvider attProvider = (NamedInstanceProvider)configProvider;
-         DeployerClient deployer = (DeployerClient)attProvider.getInstance("MainDeployer");
+         DeployerClient deployer = (DeployerClient)bootProvider.getInstance("MainDeployer");
          return new EmbeddedArchiveDeployer(deployer);
       }
    }
@@ -140,7 +137,7 @@
    {
       return System.getProperty("jboss.bind.address") != null;
    }
-   
+
    public String getServerHost()
    {
       return System.getProperty("jboss.bind.address", "localhost");

Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java	2009-03-03 11:22:30 UTC (rev 85157)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java	2009-03-03 11:32:42 UTC (rev 85158)
@@ -52,12 +52,12 @@
       VFS.init();
    }
 
-   public OSGiBootstrapProvider createBootstrapProvider()
+   protected OSGiBootstrapProvider createBootstrapProvider()
    {
       return OSGiBootstrap.getBootstrapProvider();
    }
 
-   public OSGiBootstrapProvider getBootstrapProvider()
+   protected OSGiBootstrapProvider getBootstrapProvider()
    {
       if (bootProvider == null)
       {
@@ -66,7 +66,7 @@
       return bootProvider;
    }
 
-   public void setBootstrapProvider(OSGiBootstrapProvider configProvider)
+   protected void setBootstrapProvider(OSGiBootstrapProvider configProvider)
    {
       this.bootProvider = configProvider;
    }
@@ -107,12 +107,12 @@
       return delegate.getResourceFile(resource);
    }
 
-   public File getTestArchiveFile(String archive)
+   protected File getTestArchiveFile(String archive)
    {
       return delegate.getTestArchiveFile(archive);
    }
 
-   public URL getTestArchiveURL(String archive) throws MalformedURLException
+   protected URL getTestArchiveURL(String archive) throws MalformedURLException
    {
       return delegate.getTestArchiveFile(archive).toURI().toURL();
    }

Added: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38DeployerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38DeployerTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38DeployerTestCase.java	2009-03-03 11:32:42 UTC (rev 85158)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.jbosgi38;
+
+//$Id$
+
+import org.jboss.osgi.spi.junit.IntegrationTest;
+
+/**
+ * [JBOSGI-38] Investigate bundle install/start behaviour with random deployment order
+ * 
+ * https://jira.jboss.org/jira/browse/OSGI-38
+ * 
+ * Bundle A depends on bundle B, both share bundle X.
+ * 
+ * A ---> B 
+ * A ---> X <--- B
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 02-Mar-2009
+ */
+public class OSGI38DeployerTestCase extends IntegrationTest
+{
+   /*
+    * Install/Start the common bundle
+    */
+   public void testInstallStartX() throws Exception
+   {
+      deploy("jbosgi38-bundleX.jar");
+      undeploy("jbosgi38-bundleX.jar");
+   }
+
+   /*
+    * Install X, B
+    */
+   public void testInstallXBeforeB() throws Exception
+   {
+   }
+
+   /*
+    * Install X, B, A
+    */
+   public void testInstallBBeforeA() throws Exception
+   {
+   }
+
+   /*
+    * Install B, X
+    */
+   public void testInstallBBeforeX() throws Exception
+   {
+   }
+
+   /*
+    * Install A, B, X
+    */
+   public void testInstallABeforeB() throws Exception
+   {
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38DeployerTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the jboss-cvs-commits mailing list