mil.dod.th.ose.integration/src/mil/dod/th/ose/controller/integration/config/TestXmlConfigurations2ndRun.java
@Test
    public final void testPhysicalLayerConfiguration() throws IOException
    {
        String testPhysicalLinkName = "xmlConfigPhysicalLink";
        
        CustomCommsService customCommsService = IntegrationTestRunner.getService(CustomCommsService.class);
        assertThat(customCommsService, is(notNullValue()));
        
        String pidToTest = null;
        for (UUID id : customCommsService.getPhysicalLinkUuids())
        {
            String thisName = customCommsService.getPhysicalLinkName(id);
            if (thisName.equals(testPhysicalLinkName))
            {
                pidToTest = customCommsService.getPhysicalLinkPid(id);                        
            }
        }        
        assertThat(pidToTest, is(notNullValue()));
       
        ConfigurationAdmin configAdmin = IntegrationTestRunner.getService(ConfigurationAdmin.class);
        assertThat(configAdmin, is(notNullValue()));
        
        Configuration exampleConfig = configAdmin.getConfiguration(pidToTest);
        
        Dictionary<String,Object> properties = exampleConfig.getProperties();        
        assertThat(properties, is(notNullValue()));
        assertThat(properties.isEmpty(), is(false));        
        assertThat(properties, dictionaryHasEntry(PhysicalLinkAttributes.CONFIG_PROP_READ_TIMEOUT_MS, (Object)500));
        assertThat(properties, dictionaryHasEntry(PhysicalLinkAttributes.CONFIG_PROP_DATA_BITS, (Object)7));      
    }
/*
     * Tests that a Physical Layer can be configured correctly from the configs.xml.
     */
Tests that a Physical Layer can be configured correctly from the configs.xml.
Tests that a Physical Layer can be configured correctly from the configs . xml .
@Test
    public final void testPhysicalLayerConfiguration() throws IOException
    {
        String testPhysicalLinkName = "xmlConfigPhysicalLink";
        CustomCommsService customCommsService = IntegrationTestRunner.getService(CustomCommsService.class);
        assertThat(customCommsService, is(notNullValue()));
        String pidToTest = null;
        for (UUID id : customCommsService.getPhysicalLinkUuids())
        {
            String thisName = customCommsService.getPhysicalLinkName(id);
            if (thisName.equals(testPhysicalLinkName))
            {
                pidToTest = customCommsService.getPhysicalLinkPid(id);                        
            }
        }        
        assertThat(pidToTest, is(notNullValue()));
        ConfigurationAdmin configAdmin = IntegrationTestRunner.getService(ConfigurationAdmin.class);
        assertThat(configAdmin, is(notNullValue()));
        Configuration exampleConfig = configAdmin.getConfiguration(pidToTest);
        Dictionary<String,Object> properties = exampleConfig.getProperties();        
        assertThat(properties, is(notNullValue()));
        assertThat(properties.isEmpty(), is(false));        
        assertThat(properties, dictionaryHasEntry(PhysicalLinkAttributes.CONFIG_PROP_READ_TIMEOUT_MS, (Object)500));
        assertThat(properties, dictionaryHasEntry(PhysicalLinkAttributes.CONFIG_PROP_DATA_BITS, (Object)7));      
    }
@ Test public final void testPhysicalLayerConfiguration ( ) throws IOException { String testPhysicalLinkName = "xmlConfigPhysicalLink" ; CustomCommsService customCommsService = IntegrationTestRunner . getService ( CustomCommsService . class ) ; assertThat ( customCommsService , is ( notNullValue ( ) ) ) ; String pidToTest = null ; for ( UUID id : customCommsService . getPhysicalLinkUuids ( ) ) { String thisName = customCommsService . getPhysicalLinkName ( id ) ; if ( thisName . equals ( testPhysicalLinkName ) ) { pidToTest = customCommsService . getPhysicalLinkPid ( id ) ; } } assertThat ( pidToTest , is ( notNullValue ( ) ) ) ; ConfigurationAdmin configAdmin = IntegrationTestRunner . getService ( ConfigurationAdmin . class ) ; assertThat ( configAdmin , is ( notNullValue ( ) ) ) ; Configuration exampleConfig = configAdmin . getConfiguration ( pidToTest ) ; Dictionary < String , Object > properties = exampleConfig . getProperties ( ) ; assertThat ( properties , is ( notNullValue ( ) ) ) ; assertThat ( properties . isEmpty ( ) , is ( false ) ) ; assertThat ( properties , dictionaryHasEntry ( PhysicalLinkAttributes . CONFIG_PROP_READ_TIMEOUT_MS , ( Object ) 500 ) ) ; assertThat ( properties , dictionaryHasEntry ( PhysicalLinkAttributes . CONFIG_PROP_DATA_BITS , ( Object ) 7 ) ) ; }
Tests that a Physical Layer can be configured correctly from the configs.xml.
Tests that a Physical Layer can be configured correctly from the configs . xml .