aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mnutt...@apache.org
Subject svn commit: r1360809 - /aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/DynamicImportTest.java
Date Thu, 12 Jul 2012 16:46:51 GMT
Author: mnuttall
Date: Thu Jul 12 16:46:51 2012
New Revision: 1360809

URL: http://svn.apache.org/viewvc?rev=1360809&view=rev
Log:
Aries-868: Ensure dummy WeavingHook service unregistered

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

Modified: aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/DynamicImportTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/DynamicImportTest.java?rev=1360809&r1=1360808&r2=1360809&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/DynamicImportTest.java
(original)
+++ aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/DynamicImportTest.java
Thu Jul 12 16:46:51 2012
@@ -79,19 +79,20 @@ public class DynamicImportTest extends S
 		Dictionary<String, String> props = new Hashtable<String, String>();
 		props.put("osgi.woven.packages", "some.woven.package, org.apache.aries.subsystem.itests.hello.api");
 		ServiceRegistration<?> sr = bundleContext.registerService(WeavingHook.class, new
TokenWeaver(), props);
+		try { 
+			Subsystem subsystem = installSubsystemFromFile ("dynamicImport.esa");
+			startSubsystem(subsystem);
 		
-		Subsystem subsystem = installSubsystemFromFile ("dynamicImport.esa");
-		startSubsystem(subsystem);
-		
-		BundleContext bc = subsystem.getBundleContext();
-		Hello h = getOsgiService(bc, Hello.class, null, DEFAULT_TIMEOUT);
-		String message = h.saySomething();
-		assertEquals ("Wrong message back", "Hello, this is something", message); // DynamicImportHelloImpl.java
-		
-		stopSubsystem(subsystem);
-		uninstallSubsystem(subsystem);
-		sr.unregister();
+			BundleContext bc = subsystem.getBundleContext();
+			Hello h = getOsgiService(bc, Hello.class, null, DEFAULT_TIMEOUT);
+			String message = h.saySomething();
+			assertEquals ("Wrong message back", "Hello, this is something", message); // DynamicImportHelloImpl.java
 		
+			stopSubsystem(subsystem);
+			uninstallSubsystem(subsystem);
+		} finally { 
+			sr.unregister();
+		}
 	}
 	
 	@Configuration



Mime
View raw message