Created
September 5, 2012 21:13
-
-
Save leadVisionary/3644876 to your computer and use it in GitHub Desktop.
Not like this
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testConfiguration_shouldHaveWrittenTheLaterOne() throws Exception { | |
ServiceReference[] allServiceReferences = ctx.getAllServiceReferences(ConfigurationAdmin.class.getName(), null); | |
for (ServiceReference serviceReference : allServiceReferences) { | |
ConfigurationAdmin service = (ConfigurationAdmin) ctx.getService(serviceReference); | |
try { | |
org.osgi.service.cm.Configuration configuration = service.getConfiguration("tests"); | |
assertEquals("myvalue2", configuration.getProperties().get("mykey")); | |
return; | |
} catch (Exception e) { | |
// continue | |
} | |
} | |
fail(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I like it when the code is both functional and self-critiquing.