mil.dod.th.ose.integration/src/mil/dod/th/ose/controller/integration/TestPrepFor2ndRun.java
@Test
    public void testCreateFactoryObjects() throws Exception
    {
        AssetDirectoryService assetDirectoryService = IntegrationTestRunner.getService(AssetDirectoryService.class);

        Asset asset = assetDirectoryService.createAsset(ExampleAsset.class.getName(), "persistObsAsset");
        
        AssetTestUtils.activateAsset(asset, 5);
        
        Map<String, Object> properties = asset.getProperties();
        properties.put(ExampleAssetAttributes.CONFIG_PROP_DEVICE_POWER_NAME, "exampleA");
        asset.setProperties(properties);
        
        // verify later the asset is activated during 2nd run
        asset.setActivateOnStartUp(true);
        
        assertThat(asset.getConfig().activateOnStartup(), is(true));
        
        asset.setPluginOverridesPosition(false);
        
        assertThat(asset.getConfig().pluginOverridesPosition(), is(false));
        
        // Test execute for value within range
        // Syncer to listen event that data was merged for the position
        EventHandlerSyncer syncerPosistion = new EventHandlerSyncer(PersistentDataStore.TOPIC_DATA_MERGED);
        
        //location
        final Command setPos = new SetPositionCommand().withLocation(
            new Coordinates().
                withLongitude(
                    new LongitudeWgsDegrees().withValue(1)).
                withLatitude(
                    new LatitudeWgsDegrees().withValue(-2)));
        assertThat(setPos, is(notNullValue()));
        asset.executeCommand(setPos);
        syncerPosistion.waitForEvent(10);
    }
/**
     * Verify that factory objects are persisted along with their appropriate previously assigned values.
     * Values are verified in during second run by {@link 
     * mil.dod.th.ose.controller.integration.core.TestPersistedAsset#testAssetRestored()}.
     */
Verify that factory objects are persisted along with their appropriate previously assigned values.
Values are verified in during second run by {@link
mil.dod.th.ose.controller.integration.core.TestPersistedAsset#testAssetRestored()}.
Verify that factory objects are persisted along with their appropriate previously assigned values . Values are verified in during second run by { @link mil . dod . th . ose . controller . integration . core . TestPersistedAsset#testAssetRestored () } .
@Test
    public void testCreateFactoryObjects() throws Exception
    {
        AssetDirectoryService assetDirectoryService = IntegrationTestRunner.getService(AssetDirectoryService.class);
        Asset asset = assetDirectoryService.createAsset(ExampleAsset.class.getName(), "persistObsAsset");
        AssetTestUtils.activateAsset(asset, 5);
        Map<String, Object> properties = asset.getProperties();
        properties.put(ExampleAssetAttributes.CONFIG_PROP_DEVICE_POWER_NAME, "exampleA");
        asset.setProperties(properties);
        asset.setActivateOnStartUp(true);
        assertThat(asset.getConfig().activateOnStartup(), is(true));
        asset.setPluginOverridesPosition(false);
        assertThat(asset.getConfig().pluginOverridesPosition(), is(false));
        EventHandlerSyncer syncerPosistion = new EventHandlerSyncer(PersistentDataStore.TOPIC_DATA_MERGED);
        final Command setPos = new SetPositionCommand().withLocation(
            new Coordinates().
                withLongitude(
                    new LongitudeWgsDegrees().withValue(1)).
                withLatitude(
                    new LatitudeWgsDegrees().withValue(-2)));
        assertThat(setPos, is(notNullValue()));
        asset.executeCommand(setPos);
        syncerPosistion.waitForEvent(10);
    }
@ Test public void testCreateFactoryObjects ( ) throws Exception { AssetDirectoryService assetDirectoryService = IntegrationTestRunner . getService ( AssetDirectoryService . class ) ; Asset asset = assetDirectoryService . createAsset ( ExampleAsset . class . getName ( ) , "persistObsAsset" ) ; AssetTestUtils . activateAsset ( asset , 5 ) ; Map < String , Object > properties = asset . getProperties ( ) ; properties . put ( ExampleAssetAttributes . CONFIG_PROP_DEVICE_POWER_NAME , "exampleA" ) ; asset . setProperties ( properties ) ; asset . setActivateOnStartUp ( true ) ; assertThat ( asset . getConfig ( ) . activateOnStartup ( ) , is ( true ) ) ; asset . setPluginOverridesPosition ( false ) ; assertThat ( asset . getConfig ( ) . pluginOverridesPosition ( ) , is ( false ) ) ; EventHandlerSyncer syncerPosistion = new EventHandlerSyncer ( PersistentDataStore . TOPIC_DATA_MERGED ) ; final Command setPos = new SetPositionCommand ( ) . withLocation ( new Coordinates ( ) . withLongitude ( new LongitudeWgsDegrees ( ) . withValue ( 1 ) ) . withLatitude ( new LatitudeWgsDegrees ( ) . withValue ( - 2 ) ) ) ; assertThat ( setPos , is ( notNullValue ( ) ) ) ; asset . executeCommand ( setPos ) ; syncerPosistion . waitForEvent ( 10 ) ; }
Verify that factory objects are persisted along with their appropriate previously assigned values.
Verify that factory objects are persisted along with their appropriate previously assigned values .
// verify later the asset is activated during 2nd run // Test execute for value within range // Syncer to listen event that data was merged for the position //location