mil.dod.th.ose.integration/src/mil/dod/th/ose/controller/integration/core/TestPersistedAsset.java
@Test
    public void testAssetRestored() throws CommandExecutionException, IllegalArgumentException, IllegalStateException, 
        FactoryException, InterruptedException
    {
        AssetDirectoryService assetDirectoryService = 
                IntegrationTestRunner.getService(AssetDirectoryService.class);
        Asset asset = assetDirectoryService.getAssetByName("persistObsAsset");
        
        //verify the asset is activated
        assertThat(asset.getActiveStatus(), is(Asset.AssetActiveStatus.ACTIVATED));
        
        //verify that location information was persisted and set, this should happen at activation.
        //This asset was set to activate at start up so the location should be reflective of the values
        //previously assigned. Longitude should be 1, Latitude should be -2
        Command getPos = new GetPositionCommand();
        
        GetPositionResponse getPTResponse = (GetPositionResponse)asset.executeCommand(getPos);
        assertThat("Get Position Response is null", getPTResponse, is(notNullValue()));
        
        assertThat(getPTResponse.getLocation().getLongitude().getValue(), is((double)1));
        assertThat(getPTResponse.getLocation().getLatitude().getValue(), is((double)-2));
    }
/**
     * Verify information for asset created in the first run of the integration tests.
     */
Verify information for asset created in the first run of the integration tests.
Verify information for asset created in the first run of the integration tests .
@Test
    public void testAssetRestored() throws CommandExecutionException, IllegalArgumentException, IllegalStateException, 
        FactoryException, InterruptedException
    {
        AssetDirectoryService assetDirectoryService = 
                IntegrationTestRunner.getService(AssetDirectoryService.class);
        Asset asset = assetDirectoryService.getAssetByName("persistObsAsset");
        assertThat(asset.getActiveStatus(), is(Asset.AssetActiveStatus.ACTIVATED));
        Command getPos = new GetPositionCommand();
        GetPositionResponse getPTResponse = (GetPositionResponse)asset.executeCommand(getPos);
        assertThat("Get Position Response is null", getPTResponse, is(notNullValue()));
        assertThat(getPTResponse.getLocation().getLongitude().getValue(), is((double)1));
        assertThat(getPTResponse.getLocation().getLatitude().getValue(), is((double)-2));
    }
@ Test public void testAssetRestored ( ) throws CommandExecutionException , IllegalArgumentException , IllegalStateException , FactoryException , InterruptedException { AssetDirectoryService assetDirectoryService = IntegrationTestRunner . getService ( AssetDirectoryService . class ) ; Asset asset = assetDirectoryService . getAssetByName ( "persistObsAsset" ) ; assertThat ( asset . getActiveStatus ( ) , is ( Asset . AssetActiveStatus . ACTIVATED ) ) ; Command getPos = new GetPositionCommand ( ) ; GetPositionResponse getPTResponse = ( GetPositionResponse ) asset . executeCommand ( getPos ) ; assertThat ( "Get Position Response is null" , getPTResponse , is ( notNullValue ( ) ) ) ; assertThat ( getPTResponse . getLocation ( ) . getLongitude ( ) . getValue ( ) , is ( ( double ) 1 ) ) ; assertThat ( getPTResponse . getLocation ( ) . getLatitude ( ) . getValue ( ) , is ( ( double ) - 2 ) ) ; }
Verify information for asset created in the first run of the integration tests.
Verify information for asset created in the first run of the integration tests .
//verify the asset is activated //verify that location information was persisted and set, this should happen at activation. //This asset was set to activate at start up so the location should be reflective of the values //previously assigned. Longitude should be 1, Latitude should be -2