aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwr...@apache.org
Subject svn commit: r1381199 - in /aries/trunk/subsystem: subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/RootSubsystemTest.java
Date Wed, 05 Sep 2012 14:35:18 GMT
Author: jwross
Date: Wed Sep  5 14:35:18 2012
New Revision: 1381199

URL: http://svn.apache.org/viewvc?rev=1381199&view=rev
Log:
ARIES-918: Extraneous root region bundles are no longer started as part of starting the root
subsystem. New test added.

Modified:
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
    aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/RootSubsystemTest.java

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java?rev=1381199&r1=1381198&r2=1381199&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
(original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
Wed Sep  5 14:35:18 2012
@@ -236,6 +236,8 @@ public class StartAction extends Abstrac
 	}
 	
 	private void startBundleResource(Resource resource, Coordination coordination) throws BundleException
{
+		if (target.isRoot())
+			return;
 		final Bundle bundle = ((BundleRevision)resource).getBundle();
 		if ((bundle.getState() & (Bundle.STARTING | Bundle.ACTIVE)) != 0)
 			return;

Modified: aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/RootSubsystemTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/RootSubsystemTest.java?rev=1381199&r1=1381198&r2=1381199&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/RootSubsystemTest.java
(original)
+++ aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/RootSubsystemTest.java
Wed Sep  5 14:35:18 2012
@@ -15,6 +15,10 @@ package org.apache.aries.subsystem.itest
 
 import static org.junit.Assert.assertEquals;
 
+import java.io.File;
+import java.io.IOException;
+
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
@@ -26,9 +30,33 @@ import org.osgi.service.subsystem.Subsys
 
 @RunWith(JUnit4TestRunner.class)
 public class RootSubsystemTest extends SubsystemTest {
+	private static final String BUNDLE_A = "bundle.a";
+	
+	private static boolean createdTestFiles;
+	@Before
+	public static void createTestFiles() throws Exception {
+		if (createdTestFiles)
+			return;
+		createBundleA();
+		createdTestFiles = true;
+	}
+	
+	private static void createBundleA() throws IOException {
+		createBundle(BUNDLE_A);
+	}
+	
 	// TODO Test root subsystem headers.
 	
 	@Test
+	public void testDoNotStartExtraneousRootRegionBundles() throws Exception {
+		bundleContext.installBundle(new File(BUNDLE_A).toURI().toURL().toString());
+		getSubsystemCoreBundle().stop();
+		getSubsystemCoreBundle().start();
+		Bundle bundleA = findBundleBySymbolicName(BUNDLE_A);
+		assertEquals("Extraneous root region bundle should not be started", Bundle.INSTALLED, bundleA.getState());
+	}
+	
+	@Test
 	public void testId() {
 		assertEquals("Wrong root ID", getRootSubsystem().getSubsystemId(), 0);
 	}



Mime
View raw message