mil.dod.th.ose.integration/src/mil/dod/th/ose/controller/integration/config/TestXmlConfigurations.java
@Test
    public final void testAssetConfiguration() throws IllegalArgumentException, IllegalStateException
    {
        String assetName1 = "xmlConfigAsset1";
        String assetName2 = "xmlConfigAsset2";
        
        AssetDirectoryService assetDirectoryService = IntegrationTestRunner.getService(AssetDirectoryService.class);
        assertThat(assetDirectoryService, is(notNullValue()));
        
        Set<Asset> assets = assetDirectoryService.getAssets();
        assertThat(assets.size(), greaterThan(0));
        
        Set<Asset> exampleAssets = assetDirectoryService.getAssetsByType(ExampleAsset.class.getName());
        assertThat(exampleAssets.size(), greaterThanOrEqualTo(2));
        
        Asset testAsset1 = assetDirectoryService.getAssetByName(assetName1);    
        assertThat(testAsset1.getConfig().activateOnStartup(), is(true));
        assertThat(testAsset1.getProperties(), hasEntry(ExampleAssetAttributes.CONFIG_PROP_DEVICE_POWER_NAME, 
                (Object)"config-value"));
        assertThat(testAsset1.getActiveStatus(), is(Asset.AssetActiveStatus.ACTIVATED));
        
        Asset testAsset2 = assetDirectoryService.getAssetByName(assetName2);
        assertThat(testAsset2.getProperties(), hasEntry(ExampleAssetAttributes.CONFIG_PROP_DEVICE_POWER_NAME, 
                (Object)"config-value"));    
        assertThat(testAsset2.getActiveStatus(), is(Asset.AssetActiveStatus.DEACTIVATED));
    }
/*
     * Tests that Assets can be correctly configured from the configs.xml.
     */
Tests that Assets can be correctly configured from the configs.xml.
Tests that Assets can be correctly configured from the configs . xml .
@Test
    public final void testAssetConfiguration() throws IllegalArgumentException, IllegalStateException
    {
        String assetName1 = "xmlConfigAsset1";
        String assetName2 = "xmlConfigAsset2";
        AssetDirectoryService assetDirectoryService = IntegrationTestRunner.getService(AssetDirectoryService.class);
        assertThat(assetDirectoryService, is(notNullValue()));
        Set<Asset> assets = assetDirectoryService.getAssets();
        assertThat(assets.size(), greaterThan(0));
        Set<Asset> exampleAssets = assetDirectoryService.getAssetsByType(ExampleAsset.class.getName());
        assertThat(exampleAssets.size(), greaterThanOrEqualTo(2));
        Asset testAsset1 = assetDirectoryService.getAssetByName(assetName1);    
        assertThat(testAsset1.getConfig().activateOnStartup(), is(true));
        assertThat(testAsset1.getProperties(), hasEntry(ExampleAssetAttributes.CONFIG_PROP_DEVICE_POWER_NAME, 
                (Object)"config-value"));
        assertThat(testAsset1.getActiveStatus(), is(Asset.AssetActiveStatus.ACTIVATED));
        Asset testAsset2 = assetDirectoryService.getAssetByName(assetName2);
        assertThat(testAsset2.getProperties(), hasEntry(ExampleAssetAttributes.CONFIG_PROP_DEVICE_POWER_NAME, 
                (Object)"config-value"));    
        assertThat(testAsset2.getActiveStatus(), is(Asset.AssetActiveStatus.DEACTIVATED));
    }
@ Test public final void testAssetConfiguration ( ) throws IllegalArgumentException , IllegalStateException { String assetName1 = "xmlConfigAsset1" ; String assetName2 = "xmlConfigAsset2" ; AssetDirectoryService assetDirectoryService = IntegrationTestRunner . getService ( AssetDirectoryService . class ) ; assertThat ( assetDirectoryService , is ( notNullValue ( ) ) ) ; Set < Asset > assets = assetDirectoryService . getAssets ( ) ; assertThat ( assets . size ( ) , greaterThan ( 0 ) ) ; Set < Asset > exampleAssets = assetDirectoryService . getAssetsByType ( ExampleAsset . class . getName ( ) ) ; assertThat ( exampleAssets . size ( ) , greaterThanOrEqualTo ( 2 ) ) ; Asset testAsset1 = assetDirectoryService . getAssetByName ( assetName1 ) ; assertThat ( testAsset1 . getConfig ( ) . activateOnStartup ( ) , is ( true ) ) ; assertThat ( testAsset1 . getProperties ( ) , hasEntry ( ExampleAssetAttributes . CONFIG_PROP_DEVICE_POWER_NAME , ( Object ) "config-value" ) ) ; assertThat ( testAsset1 . getActiveStatus ( ) , is ( Asset . AssetActiveStatus . ACTIVATED ) ) ; Asset testAsset2 = assetDirectoryService . getAssetByName ( assetName2 ) ; assertThat ( testAsset2 . getProperties ( ) , hasEntry ( ExampleAssetAttributes . CONFIG_PROP_DEVICE_POWER_NAME , ( Object ) "config-value" ) ) ; assertThat ( testAsset2 . getActiveStatus ( ) , is ( Asset . AssetActiveStatus . DEACTIVATED ) ) ; }
Tests that Assets can be correctly configured from the configs.xml.
Tests that Assets can be correctly configured from the configs . xml .