aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwr...@apache.org
Subject svn commit: r1465730 - /aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/ResolutionTest.java
Date Mon, 08 Apr 2013 19:14:42 GMT
Author: jwross
Date: Mon Apr  8 19:14:42 2013
New Revision: 1465730

URL: http://svn.apache.org/r1465730
Log:
Make no assumptions about the order of directives in a capability string.

Modified:
    aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/ResolutionTest.java

Modified: aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/ResolutionTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/ResolutionTest.java?rev=1465730&r1=1465729&r2=1465730&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/ResolutionTest.java
(original)
+++ aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/ResolutionTest.java
Mon Apr  8 19:14:42 2013
@@ -25,6 +25,8 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.aries.subsystem.core.archive.Clause;
+import org.apache.aries.subsystem.core.archive.RequireCapabilityHeader;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -132,7 +134,12 @@ public class ResolutionTest extends Subs
 			// Make sure the Require-Capability exists for capability a...
 			assertHeaderExists(applicationA, Constants.REQUIRE_CAPABILITY);
 			// ...but not for capability b.
-			assertEquals("Wrong Require-Capability header", "a;resolution:=mandatory;effective:=resolve",
applicationA.getSubsystemHeaders(null).get(Constants.REQUIRE_CAPABILITY));
+			RequireCapabilityHeader header = new RequireCapabilityHeader(applicationA.getSubsystemHeaders(null).get(Constants.REQUIRE_CAPABILITY));
+			assertEquals("Wrong number of clauses", 1, header.getClauses().size());
+			Clause clause = header.getClauses().iterator().next();
+			assertEquals("Wrong path", "a", clause.getPath());
+			assertEquals("Wrong resolution directive", Constants.RESOLUTION_MANDATORY, clause.getDirective(Constants.RESOLUTION_DIRECTIVE).getValue());
+			assertEquals("Wrong effective directive", Constants.EFFECTIVE_RESOLVE, clause.getDirective(Constants.EFFECTIVE_DIRECTIVE).getValue());
 			try {
 				// Make sure the runtime resolution works as well.
 				applicationA.start();



Mime
View raw message