aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwr...@apache.org
Subject svn commit: r1444202 - in /aries/trunk/subsystem: subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/
Date Fri, 08 Feb 2013 19:38:14 GMT
Author: jwross
Date: Fri Feb  8 19:38:14 2013
New Revision: 1444202

URL: http://svn.apache.org/r1444202
Log:
Fixed issue where the last used subsystem ID was not being correctly tracked for persisted
subsystems.

Modified:
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Subsystems.java
    aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/FeatureTest.java
    aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/SubsystemTest.java

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Subsystems.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Subsystems.java?rev=1444202&r1=1444201&r2=1444202&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Subsystems.java
(original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Subsystems.java
Fri Feb  8 19:38:14 2013
@@ -25,6 +25,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.aries.subsystem.core.archive.DeploymentManifest;
 import org.apache.aries.subsystem.core.internal.BundleResourceInstaller.BundleConstituent;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -146,6 +147,10 @@ public class Subsystems {
 						addSubsystem(s);
 					}
 					root = getSubsystemById(0);
+					SubsystemIdentifier.setLastId(
+							Long.parseLong(
+									root.getDeploymentManifest().getHeaders().get(
+											DeploymentManifest.ARIESSUBSYSTEM_LASTID).getValue()));
 					graph = new SubsystemGraph(root);
 					ResourceInstaller.newInstance(coordination, root, root).install();
 					populateRootSubsystem(root, coordination);

Modified: aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/FeatureTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/FeatureTest.java?rev=1444202&r1=1444201&r2=1444202&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/FeatureTest.java
(original)
+++ aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/FeatureTest.java
Fri Feb  8 19:38:14 2013
@@ -112,6 +112,7 @@ public class FeatureTest extends Subsyst
 			assertFeature3(feature3Before);
 			Bundle bundle = getSubsystemCoreBundle();
 			bundle.stop();
+			resetLastId();
 			bundle.start();
 			Subsystem root = getRootSubsystem();
 			assertChildren(1, root);

Modified: aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/SubsystemTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/SubsystemTest.java?rev=1444202&r1=1444201&r2=1444202&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/SubsystemTest.java
(original)
+++ aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/SubsystemTest.java
Fri Feb  8 19:38:14 2013
@@ -370,13 +370,19 @@ public abstract class SubsystemTest exte
 		assertTrue("Subsystem ID was not a positive integer: " + id, id > 0);
 	}
 	
-	protected void assertLastId(long id) throws SecurityException, NoSuchFieldException, IllegalArgumentException,
IllegalAccessException {
+	protected void assertLastId(long id) throws Exception {
 		Subsystem root = getRootSubsystem();
 		Field lastId = SubsystemIdentifier.class.getDeclaredField("lastId");
 		lastId.setAccessible(true);
 		assertEquals("Wrong lastId", id, lastId.getLong(root));
 	}
 	
+	protected void resetLastId() throws Exception {
+		Field lastId = SubsystemIdentifier.class.getDeclaredField("lastId");
+		lastId.setAccessible(true);
+		lastId.setInt(SubsystemIdentifier.class, 0);
+	}
+	
 	protected void assertLocation(String expected, String actual) {
 		assertTrue("Wrong location: " + actual, actual.indexOf(expected) != -1);
 	}



Mime
View raw message