mil.dod.th.ose.integration/src/mil/dod/th/ose/controller/integration/config/TestXmlConfigurations.java
@Test
    public final void testOSGiNonFactoryConfiguration() throws IOException
    {
        int exampleConfigTestValue = 50;
        String exampleConfigTestValueString = "config-value";
        
        ConfigurationAdmin configAdmin = IntegrationTestRunner.getService(ConfigurationAdmin.class);
        assertThat(configAdmin, is(notNullValue()));
        
        Configuration exampleConfig = configAdmin.getConfiguration(ExampleClass.CONFIG_PID); 
        
        // check that the configuration is not bound to the mil.dod.th.ose.config.loading.jar
        Bundle configLoaderBundle = BundleTestUtils.getBundleBySymName("mil.dod.th.ose.config.loading");
        assertThat(configLoaderBundle, is(notNullValue()));
        String configLoaderBundleLocation = configLoaderBundle.getLocation();        
        assertThat(exampleConfig.getBundleLocation(), is(not(equalTo(configLoaderBundleLocation))));
                
        Dictionary<String,Object> properties = exampleConfig.getProperties();        
        assertThat(properties, is(notNullValue()));
        assertThat(properties.isEmpty(), is(false));        
        
        assertThat(properties, dictionaryHasEntry(ExampleClassConfig.CONFIG_PROP_EXAMPLE_CONFIG_VALUE, 
                (Object)exampleConfigTestValue));  
        assertThat(properties, dictionaryHasEntry(ExampleClassConfig.CONFIG_PROP_EXAMPLE_CONFIG_VALUE_STRING, 
                (Object)exampleConfigTestValueString));  
    }
/*
     * Tests that an OSGi non-factory configuration can be set from the configs.xml.
     */
Tests that an OSGi non-factory configuration can be set from the configs.xml.
Tests that an OSGi non - factory configuration can be set from the configs . xml .
@Test
    public final void testOSGiNonFactoryConfiguration() throws IOException
    {
        int exampleConfigTestValue = 50;
        String exampleConfigTestValueString = "config-value";
        ConfigurationAdmin configAdmin = IntegrationTestRunner.getService(ConfigurationAdmin.class);
        assertThat(configAdmin, is(notNullValue()));
        Configuration exampleConfig = configAdmin.getConfiguration(ExampleClass.CONFIG_PID); 
        Bundle configLoaderBundle = BundleTestUtils.getBundleBySymName("mil.dod.th.ose.config.loading");
        assertThat(configLoaderBundle, is(notNullValue()));
        String configLoaderBundleLocation = configLoaderBundle.getLocation();        
        assertThat(exampleConfig.getBundleLocation(), is(not(equalTo(configLoaderBundleLocation))));
        Dictionary<String,Object> properties = exampleConfig.getProperties();        
        assertThat(properties, is(notNullValue()));
        assertThat(properties.isEmpty(), is(false));        
        assertThat(properties, dictionaryHasEntry(ExampleClassConfig.CONFIG_PROP_EXAMPLE_CONFIG_VALUE, 
                (Object)exampleConfigTestValue));  
        assertThat(properties, dictionaryHasEntry(ExampleClassConfig.CONFIG_PROP_EXAMPLE_CONFIG_VALUE_STRING, 
                (Object)exampleConfigTestValueString));  
    }
@ Test public final void testOSGiNonFactoryConfiguration ( ) throws IOException { int exampleConfigTestValue = 50 ; String exampleConfigTestValueString = "config-value" ; ConfigurationAdmin configAdmin = IntegrationTestRunner . getService ( ConfigurationAdmin . class ) ; assertThat ( configAdmin , is ( notNullValue ( ) ) ) ; Configuration exampleConfig = configAdmin . getConfiguration ( ExampleClass . CONFIG_PID ) ; Bundle configLoaderBundle = BundleTestUtils . getBundleBySymName ( "mil.dod.th.ose.config.loading" ) ; assertThat ( configLoaderBundle , is ( notNullValue ( ) ) ) ; String configLoaderBundleLocation = configLoaderBundle . getLocation ( ) ; assertThat ( exampleConfig . getBundleLocation ( ) , is ( not ( equalTo ( configLoaderBundleLocation ) ) ) ) ; Dictionary < String , Object > properties = exampleConfig . getProperties ( ) ; assertThat ( properties , is ( notNullValue ( ) ) ) ; assertThat ( properties . isEmpty ( ) , is ( false ) ) ; assertThat ( properties , dictionaryHasEntry ( ExampleClassConfig . CONFIG_PROP_EXAMPLE_CONFIG_VALUE , ( Object ) exampleConfigTestValue ) ) ; assertThat ( properties , dictionaryHasEntry ( ExampleClassConfig . CONFIG_PROP_EXAMPLE_CONFIG_VALUE_STRING , ( Object ) exampleConfigTestValueString ) ) ; }
Tests that an OSGi non-factory configuration can be set from the configs.xml.
Tests that an OSGi non - factory configuration can be set from the configs . xml .
// check that the configuration is not bound to the mil.dod.th.ose.config.loading.jar