JBoss-OSGI SVN: r93569 - projects/jboss-osgi/trunk/testsuite/functional.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-15 21:54:20 -0400 (Tue, 15 Sep 2009)
New Revision: 93569
Modified:
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
Log:
Exclude equinox tests that don't work with jboss600
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-09-15 23:15:53 UTC (rev 93568)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-09-16 01:54:20 UTC (rev 93569)
@@ -128,10 +128,12 @@
<excludes>
<exclude>${target.container.excludes}</exclude>
<exclude>org/jboss/test/osgi/capabilities/**</exclude>
+ <exclude>org/jboss/test/osgi/jbosgi36/**</exclude>
<exclude>org/jboss/test/osgi/jbosgi37/**</exclude>
<exclude>org/jboss/test/osgi/jbosgi38/**</exclude>
<exclude>org/jboss/test/osgi/jbosgi39/**</exclude>
<exclude>org/jboss/test/osgi/jbosgi41/**</exclude>
+ <exclude>org/jboss/test/osgi/jbosgi92/**</exclude>
<exclude>org/jboss/test/osgi/jbosgi99/**</exclude>
<exclude>org/jboss/test/osgi/jbosgi108/**</exclude>
<exclude>org/jboss/test/osgi/jbosgi112/**</exclude>
16 years, 10 months
JBoss-OSGI SVN: r93561 - in projects/jboss-osgi/trunk/testsuite: functional and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-15 16:27:35 -0400 (Tue, 15 Sep 2009)
New Revision: 93561
Modified:
projects/jboss-osgi/trunk/testsuite/example/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
Log:
Exclude felix tests that don't work with a security manager
Modified: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-09-15 20:20:39 UTC (rev 93560)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-09-15 20:27:35 UTC (rev 93561)
@@ -197,6 +197,7 @@
<configuration>
<excludes>
<exclude>${target.container.excludes}</exclude>
+ <exclude>org/jboss/test/osgi/example/blueprint/**</exclude>
</excludes>
</configuration>
</plugin>
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-09-15 20:20:39 UTC (rev 93560)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-09-15 20:27:35 UTC (rev 93561)
@@ -166,7 +166,10 @@
<configuration>
<excludes>
<exclude>${target.container.excludes}</exclude>
+ <exclude>org/jboss/test/osgi/capabilities/**</exclude>
+ <exclude>org/jboss/test/osgi/jbosgi38/**</exclude>
<exclude>org/jboss/test/osgi/jbosgi142/**</exclude>
+ <exclude>org/jboss/test/osgi/jbosgi143/**</exclude>
<exclude>org/jboss/test/osgi/jbosgi151/**</exclude>
</excludes>
</configuration>
16 years, 10 months
JBoss-OSGI SVN: r93544 - in projects/jboss-osgi/trunk/reactor/blueprint/testsuite: src/test/resources and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-15 11:47:11 -0400 (Tue, 15 Sep 2009)
New Revision: 93544
Added:
projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/tst.policy
Modified:
projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml
Log:
Fix blueprint testing with remote runtime
Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml 2009-09-15 15:45:51 UTC (rev 93543)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml 2009-09-15 15:47:11 UTC (rev 93544)
@@ -199,6 +199,29 @@
</plugins>
</build>
</profile>
+
+ <!--
+ Name: remote-testing
+ Descr: Setup for remote integration testing
+ -->
+ <profile>
+ <id>remote-testing</id>
+ <activation>
+ <property>
+ <name>target.container</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
Added: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/tst.policy
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/tst.policy (rev 0)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/tst.policy 2009-09-15 15:47:11 UTC (rev 93544)
@@ -0,0 +1,4 @@
+grant {
+ permission java.security.AllPermission;
+};
+
16 years, 10 months
JBoss-OSGI SVN: r93543 - projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-15 11:45:51 -0400 (Tue, 15 Sep 2009)
New Revision: 93543
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
Log:
Fix undeploy issue with remote runtime
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java 2009-09-15 15:38:40 UTC (rev 93542)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java 2009-09-15 15:45:51 UTC (rev 93543)
@@ -132,7 +132,7 @@
}
catch (Exception ex)
{
- log.error("Cannot uninstall: " + location);
+ log.error("Cannot uninstall: " + location, ex);
}
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-09-15 15:38:40 UTC (rev 93542)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-09-15 15:45:51 UTC (rev 93543)
@@ -72,7 +72,7 @@
URL bundleURL = getTestHelper().getTestArchiveURL(location);
BundleDeployment bundleDep = BundleDeploymentFactory.createBundleDeployment(bundleURL);
- invokeDeployerService("deploy", bundleURL);
+ deployInternal(location, true);
String symbolicName = bundleDep.getSymbolicName();
String version = bundleDep.getVersion().toString();
@@ -98,20 +98,43 @@
}
}
- @Override
public void deploy(String location) throws Exception
{
+ deployInternal(location, false);
+ }
+
+ private void deployInternal(String location, boolean isBundle) throws Exception
+ {
URL archiveURL = getTestHelper().getTestArchiveURL(location);
- invokeMainDeployer("deploy", archiveURL);
+ if (isBundle)
+ invokeDeployerService("deploy", archiveURL);
+ else
+ invokeMainDeployer("deploy", archiveURL);
}
-
- @Override
+
public void undeploy(String location) throws Exception
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
- invokeMainDeployer("undeploy", archiveURL);
+ if (isBundleArchive(location))
+ invokeDeployerService("undeploy", archiveURL);
+ else
+ invokeMainDeployer("undeploy", archiveURL);
}
+ private boolean isBundleArchive(String location)
+ {
+ try
+ {
+ URL archiveURL = getTestHelper().getTestArchiveURL(location);
+ BundleDeploymentFactory.createBundleDeployment(archiveURL);
+ return true;
+ }
+ catch (BundleException ex)
+ {
+ return false;
+ }
+ }
+
public OSGiBundle[] getBundles()
{
try
16 years, 10 months
JBoss-OSGI SVN: r93541 - projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-15 10:55:32 -0400 (Tue, 15 Sep 2009)
New Revision: 93541
Modified:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
Log:
[JBCL-116] Potential deadlock in ClassLoaderManager
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-09-15 14:38:01 UTC (rev 93540)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-09-15 14:55:32 UTC (rev 93541)
@@ -25,6 +25,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assume.assumeTrue;
import java.io.BufferedReader;
import java.io.InputStreamReader;
@@ -49,6 +50,7 @@
public class HttpServiceTestCase
{
private static OSGiRuntime runtime;
+ private static boolean httpServiceAvailable;
@BeforeClass
public static void setUpClass() throws Exception
@@ -65,7 +67,15 @@
sref = runtime.getServiceReference(HttpService.class.getName());
}
+ if (sref == null && new OSGiTestHelper().isFrameworkJBossMC())
+ {
+ System.out.println("FIXME [JBCL-116] Potential deadlock in ClassLoaderManager");
+ httpServiceAvailable = false;
+ return;
+ }
+
assertNotNull("HttpService not null", sref);
+ httpServiceAvailable = true;
OSGiBundle bundle = runtime.installBundle("example-http.jar");
bundle.start();
@@ -80,6 +90,8 @@
@Test
public void testServletAccess() throws Exception
{
+ assumeTrue(httpServiceAvailable);
+
URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=plain");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
assertEquals("Hello from Servlet", br.readLine());
@@ -88,6 +100,8 @@
@Test
public void testServletInitProps() throws Exception
{
+ assumeTrue(httpServiceAvailable);
+
URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=initProp");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
assertEquals("initProp=SomeValue", br.readLine());
@@ -96,6 +110,8 @@
@Test
public void testServletBundleContext() throws Exception
{
+ assumeTrue(httpServiceAvailable);
+
URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=context");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
assertEquals("example-http", br.readLine());
@@ -104,6 +120,8 @@
@Test
public void testServletStartLevel() throws Exception
{
+ assumeTrue(httpServiceAvailable);
+
URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=startLevel");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
assertEquals("startLevel=1", br.readLine());
@@ -112,6 +130,8 @@
@Test
public void testResourceAccess() throws Exception
{
+ assumeTrue(httpServiceAvailable);
+
URL url = new URL("http://" + runtime.getServerHost() + ":8090/file/message.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
assertEquals("Hello from Resource", br.readLine());
16 years, 10 months
JBoss-OSGI SVN: r93540 - in projects/jboss-osgi/trunk: testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99 and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-15 10:38:01 -0400 (Tue, 15 Sep 2009)
New Revision: 93540
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java
Log:
Move profiles to jboss-osgi-parent
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-09-15 14:37:29 UTC (rev 93539)
+++ projects/jboss-osgi/trunk/pom.xml 2009-09-15 14:38:01 UTC (rev 93540)
@@ -253,6 +253,130 @@
</build>
</profile>
+ <!--
+ Name: embedded-testing
+ Descr: Setup for embedded integration testing
+ -->
+ <profile>
+ <id>embedded-testing</id>
+ <activation>
+ <property>
+ <name>!target.container</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.argline.parent>-Djava.security.manager.disabled</surefire.argline.parent>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${surefire.argline.parent}</argLine>
+ <systemProperties>
+ <property>
+ <name>java.protocol.handler.pkgs</name>
+ <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
+ </property>
+ <property>
+ <name>jndi.server.port</name>
+ <value>1199</value>
+ </property>
+ <property>
+ <name>log4j.output.dir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ <property>
+ <name>jboss.osgi.framework.properties</name>
+ <value>${jboss.osgi.framework.properties}</value>
+ </property>
+ <property>
+ <name>org.jboss.osgi.husky.Invoker</name>
+ <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
+ </property>
+ <property>
+ <name>test.archive.directory</name>
+ <value>${project.build.directory}/test-libs</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: remote-testing
+ Descr: Setup for remote integration testing
+ -->
+ <profile>
+ <id>remote-testing</id>
+ <activation>
+ <property>
+ <name>target.container</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.argline.parent>-Djava.security.manager -Djava.security.policy=${project.build.directory}/test-classes/tst.policy</surefire.argline.parent>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${surefire.argline.parent}</argLine>
+ <systemProperties>
+ <property>
+ <name>java.protocol.handler.pkgs</name>
+ <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
+ </property>
+ <property>
+ <name>jboss.bind.address</name>
+ <value>${jboss.bind.address}</value>
+ </property>
+ <property>
+ <name>jndi.server.port</name>
+ <value>1099</value>
+ </property>
+ <property>
+ <name>log4j.output.dir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ <property>
+ <name>org.apache.xerces.xni.parser.XMLParserConfiguration</name>
+ <value>org.apache.xerces.parsers.XIncludeAwareParserConfiguration</value>
+ </property>
+ <property>
+ <name>jboss.osgi.framework.properties</name>
+ <value>${jboss.osgi.framework.properties}</value>
+ </property>
+ <property>
+ <name>org.jboss.osgi.husky.Invoker</name>
+ <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
+ </property>
+ <property>
+ <name>org.jboss.osgi.husky.runtime.connector.host</name>
+ <value>${jboss.bind.address}</value>
+ </property>
+ <property>
+ <name>org.jboss.osgi.husky.runtime.connector.port</name>
+ <value>5401</value>
+ </property>
+ <property>
+ <name>target.container</name>
+ <value>${target.container}</value>
+ </property>
+ <property>
+ <name>test.archive.directory</name>
+ <value>${project.build.directory}/test-libs</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
</profiles>
</project>
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java 2009-09-15 14:37:29 UTC (rev 93539)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java 2009-09-15 14:38:01 UTC (rev 93540)
@@ -24,7 +24,6 @@
//$Id: OSGI39TestCase.java 87103 2009-04-09 22:18:31Z thomas.diesler(a)jboss.com $
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
@@ -64,7 +63,7 @@
public void testInstallOnly() throws Exception
{
OSGiBundle bundleA = runtime.installBundle("jbosgi99-bundleA.jar");
- assertTrue("Bundle installed", bundleA.getState() == Bundle.INSTALLED || bundleA.getState() == Bundle.RESOLVED);
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
bundleA.start();
assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
16 years, 10 months
JBoss-OSGI SVN: r93539 - in projects/jboss-osgi/projects/runtime/microcontainer/trunk: src/main/java/org/jboss/osgi/plugins/deployers/bundle and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-15 10:37:29 -0400 (Tue, 15 Sep 2009)
New Revision: 93539
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiDeployersWrapper.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
Log:
Only resolve bundles that are marked as autoStart
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml 2009-09-15 14:36:06 UTC (rev 93538)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml 2009-09-15 14:37:29 UTC (rev 93539)
@@ -10,13 +10,13 @@
<!-- ====================================================================== -->
<!-- $Id$ -->
-
+
<!--
Set these VM properties in your IDE debugger
-Dlog4j.output.dir=${workspace_loc:jboss-osgi-runtime-microcontainer/target}
-->
-
+
<project 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -151,7 +151,7 @@
<artifactId>jboss-osgi-deployers</artifactId>
<version>${version.jboss.osgi.runtime.deployers}</version>
</dependency>
-
+
<!-- OSGi Dependencies -->
<dependency>
<groupId>org.osgi</groupId>
@@ -163,7 +163,7 @@
<artifactId>org.osgi.compendium</artifactId>
<version>${version.osgi}</version>
</dependency>
-
+
<!-- Test dependencies -->
<dependency>
<groupId>org.jboss.test</groupId>
@@ -181,7 +181,7 @@
</exclusion>
</exclusions>
</dependency>
-
+
<!-- Test bundles dependencies -->
<dependency>
<groupId>org.apache.felix</groupId>
@@ -351,6 +351,25 @@
<downloadSources>true</downloadSources>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <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>
+ <property>
+ <name>test.archive.directory</name>
+ <value>${project.build.directory}/test-libs</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
</plugins>
</build>
@@ -376,5 +395,5 @@
</snapshots>
</repository>
</repositories>
-
+
</project>
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiDeployersWrapper.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiDeployersWrapper.java 2009-09-15 14:36:06 UTC (rev 93538)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiDeployersWrapper.java 2009-09-15 14:37:29 UTC (rev 93539)
@@ -21,6 +21,8 @@
*/
package org.jboss.osgi.plugins.deployers.bundle;
+import static org.jboss.osgi.spi.Constants.PROPERTY_AUTO_START;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -126,7 +128,14 @@
{
DeploymentUnit unit = context.getDeploymentUnit();
OSGiBundleState bundle = unit.getAttachment(OSGiBundleState.class);
- if (bundle != null && bundle.getState() == Bundle.INSTALLED)
+ if (bundle == null)
+ continue;
+
+ Boolean autoStart = (Boolean)unit.getAttachment(PROPERTY_AUTO_START);
+ if (autoStart == null)
+ autoStart = Boolean.TRUE;
+
+ if (autoStart == true && bundle.getState() == Bundle.INSTALLED)
{
unresolvedBundles.add(0, bundle);
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-09-15 14:36:06 UTC (rev 93538)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-09-15 14:37:29 UTC (rev 93539)
@@ -21,6 +21,8 @@
*/
package org.jboss.osgi.plugins.facade.bundle;
+import static org.jboss.osgi.spi.Constants.PROPERTY_AUTO_START;
+
import java.io.IOException;
import java.net.URL;
import java.security.AccessController;
@@ -48,6 +50,7 @@
import org.jboss.dependency.spi.ControllerState;
import org.jboss.deployers.client.spi.DeployerClient;
import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.attachments.MutableAttachments;
import org.jboss.deployers.spi.deployer.DeploymentStage;
import org.jboss.deployers.spi.deployer.DeploymentStages;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -399,6 +402,9 @@
try
{
VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(file);
+ MutableAttachments att = (MutableAttachments)deployment.getPredeterminedManagedObjects();
+ att.addAttachment(PROPERTY_AUTO_START, Boolean.FALSE);
+
deployerClient.deploy(deployment);
try
{
16 years, 10 months
JBoss-OSGI SVN: r93538 - projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-15 10:36:06 -0400 (Tue, 15 Sep 2009)
New Revision: 93538
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java
Log:
Only resolve bundles that are marked as autoStart
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-09-15 14:34:53 UTC (rev 93537)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-09-15 14:36:06 UTC (rev 93538)
@@ -24,7 +24,9 @@
//$Id$
import java.net.URL;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -68,7 +70,9 @@
{
DeploymentRegistryService registry = getDeploymentRegistry();
+ List<Bundle> resolvableBundles = new ArrayList<Bundle>();
Map<BundleDeployment, Bundle> bundleMap = new HashMap<BundleDeployment, Bundle>();
+
for (BundleDeployment dep : depArr)
{
try
@@ -78,7 +82,10 @@
log.log(LogService.LOG_INFO, "Installed: " + bundle);
registerManagedBundle(bundle);
+
bundleMap.put(dep, bundle);
+ if (dep.isAutoStart())
+ resolvableBundles.add(bundle);
registry.registerBundleDeployment(dep);
}
@@ -90,10 +97,12 @@
// Resolve the installed bundles through the PackageAdmin
ServiceReference packageAdminRef = context.getServiceReference(PackageAdmin.class.getName());
- if (packageAdminRef != null)
+ if (packageAdminRef != null && resolvableBundles.isEmpty() == false)
{
PackageAdmin packageAdmin = (PackageAdmin)context.getService(packageAdminRef);
- packageAdmin.resolveBundles(null);
+ Bundle[] resolvableBundleArr = new Bundle[resolvableBundles.size()];
+ resolvableBundles.toArray(resolvableBundleArr);
+ packageAdmin.resolveBundles(resolvableBundleArr);
}
// Start the installed bundles
16 years, 10 months
JBoss-OSGI SVN: r93537 - projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-15 10:34:53 -0400 (Tue, 15 Sep 2009)
New Revision: 93537
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
Log:
Cleanup remote deployment
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-09-15 14:33:56 UTC (rev 93536)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-09-15 14:34:53 UTC (rev 93537)
@@ -176,7 +176,7 @@
protected void invokeDeployerService(String method, URL archiveURL) throws Exception
{
ObjectName oname = new ObjectName("jboss.osgi:service=DeployerService");
- getMBeanServer().invoke(oname, method, new Object[] { archiveURL }, new String[] { "java.net.URL" });
+ getMBeanServer().invoke(oname, method, new Object[] { archiveURL }, new String[] { URL.class.getName() });
}
public InitialContext getInitialContext() throws NamingException
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-09-15 14:33:56 UTC (rev 93536)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-09-15 14:34:53 UTC (rev 93537)
@@ -44,9 +44,9 @@
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.spi.util.BundleDeployment;
import org.jboss.osgi.spi.util.BundleDeploymentFactory;
import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
import org.osgi.framework.InvalidSyntaxException;
/**
@@ -67,11 +67,15 @@
public OSGiBundle installBundle(String location) throws BundleException
{
- String symbolicName = getManifestEntry(location, Constants.BUNDLE_SYMBOLICNAME);
- String version = getManifestEntry(location, Constants.BUNDLE_VERSION);
try
{
- deploy(location);
+ URL bundleURL = getTestHelper().getTestArchiveURL(location);
+ BundleDeployment bundleDep = BundleDeploymentFactory.createBundleDeployment(bundleURL);
+
+ invokeDeployerService("deploy", bundleURL);
+
+ String symbolicName = bundleDep.getSymbolicName();
+ String version = bundleDep.getVersion().toString();
ManagedBundleMBean bundleMBean = getRemoteFramework().getBundle(symbolicName, version);
RemoteBundle bundle = new RemoteBundle(this, bundleMBean, location);
return registerBundle(location, bundle);
@@ -98,38 +102,16 @@
public void deploy(String location) throws Exception
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
-
- if (isBundleArchive(location))
- invokeDeployerService("deploy", archiveURL);
- else
- invokeMainDeployer("deploy", archiveURL);
+ invokeMainDeployer("deploy", archiveURL);
}
@Override
public void undeploy(String location) throws Exception
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
-
- if (isBundleArchive(location))
- invokeDeployerService("undeploy", archiveURL);
- else
- invokeMainDeployer("undeploy", archiveURL);
+ invokeMainDeployer("undeploy", archiveURL);
}
- private boolean isBundleArchive(String location)
- {
- try
- {
- URL archiveURL = getTestHelper().getTestArchiveURL(location);
- BundleDeploymentFactory.createBundleDeployment(archiveURL);
- return true;
- }
- catch (BundleException ex)
- {
- return false;
- }
- }
-
public OSGiBundle[] getBundles()
{
try
@@ -289,6 +271,6 @@
private void invokeMainDeployer(String method, URL archiveURL) throws Exception
{
ObjectName oname = new ObjectName("jboss.system:service=MainDeployer");
- getMBeanServer().invoke(oname, method, new Object[] { archiveURL }, new String[] { "java.net.URL" });
+ getMBeanServer().invoke(oname, method, new Object[] { archiveURL }, new String[] { URL.class.getName() });
}
}
16 years, 10 months
JBoss-OSGI SVN: r93536 - projects/jboss-osgi/projects/parent/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-15 10:33:56 -0400 (Tue, 15 Sep 2009)
New Revision: 93536
Modified:
projects/jboss-osgi/projects/parent/trunk/pom.xml
Log:
Move profiles to jboss-osgi-parent
Modified: projects/jboss-osgi/projects/parent/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/parent/trunk/pom.xml 2009-09-15 14:16:38 UTC (rev 93535)
+++ projects/jboss-osgi/projects/parent/trunk/pom.xml 2009-09-15 14:33:56 UTC (rev 93536)
@@ -17,7 +17,6 @@
<version.aqute.bnd>0.0.323</version.aqute.bnd>
<version.jboss.logging>2.0.5.GA</version.jboss.logging>
<version.junit>4.6</version.junit>
- <surefire.argline.parent>-Djava.security.manager -Djava.security.policy=${project.build.directory}/test-classes/tst.policy</surefire.argline.parent>
</properties>
<!-- DependencyManagement -->
@@ -246,123 +245,6 @@
</properties>
</profile>
- <!--
- Name: embedded-testing
- Descr: Setup for embedded integration testing
- -->
- <profile>
- <id>embedded-testing</id>
- <activation>
- <property>
- <name>!target.container</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemProperties>
- <property>
- <name>java.protocol.handler.pkgs</name>
- <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
- </property>
- <property>
- <name>jndi.server.port</name>
- <value>1199</value>
- </property>
- <property>
- <name>log4j.output.dir</name>
- <value>${project.build.directory}</value>
- </property>
- <property>
- <name>jboss.osgi.framework.properties</name>
- <value>${jboss.osgi.framework.properties}</value>
- </property>
- <property>
- <name>org.jboss.osgi.husky.Invoker</name>
- <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
- </property>
- <property>
- <name>test.archive.directory</name>
- <value>${project.build.directory}/test-libs</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!--
- Name: remote-testing
- Descr: Setup for remote integration testing
- -->
- <profile>
- <id>remote-testing</id>
- <activation>
- <property>
- <name>target.container</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>${surefire.argline.parent}</argLine>
- <systemProperties>
- <property>
- <name>java.protocol.handler.pkgs</name>
- <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
- </property>
- <property>
- <name>jboss.bind.address</name>
- <value>${jboss.bind.address}</value>
- </property>
- <property>
- <name>jndi.server.port</name>
- <value>1099</value>
- </property>
- <property>
- <name>log4j.output.dir</name>
- <value>${project.build.directory}</value>
- </property>
- <property>
- <name>org.apache.xerces.xni.parser.XMLParserConfiguration</name>
- <value>org.apache.xerces.parsers.XIncludeAwareParserConfiguration</value>
- </property>
- <property>
- <name>jboss.osgi.framework.properties</name>
- <value>${jboss.osgi.framework.properties}</value>
- </property>
- <property>
- <name>org.jboss.osgi.husky.Invoker</name>
- <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
- </property>
- <property>
- <name>org.jboss.osgi.husky.runtime.connector.host</name>
- <value>${jboss.bind.address}</value>
- </property>
- <property>
- <name>org.jboss.osgi.husky.runtime.connector.port</name>
- <value>5401</value>
- </property>
- <property>
- <name>target.container</name>
- <value>${target.container}</value>
- </property>
- <property>
- <name>test.archive.directory</name>
- <value>${project.build.directory}/test-libs</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
</profiles>
</project>
16 years, 10 months