mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestAssetDirectoryService.java
public void testAssetExecuteCommandPositionOverrideTrue() throws Exception
    {
        AssetDirectoryService assetDirectoryService = ServiceUtils.getService(m_Context, AssetDirectoryService.class);
        assertThat(assetDirectoryService, is(notNullValue()));
        
        Asset asset = assetDirectoryService.createAsset(ExampleAsset.class.getName());
        asset.setName("positionAsset");
        
        Map<String, Object> properties = asset.getProperties();
        properties.put(AssetAttributes.CONFIG_PROP_PLUGIN_OVERRIDES_POSITION, true);
        asset.setProperties(properties);
        
        // Test execute for value within range
        //location, none of which will actually be used but need to make the command valid
        final Command setPos = new SetPositionCommand().withLocation(
            new Coordinates().
                withLongitude(
                    new LongitudeWgsDegrees().withValue(31)).
                withLatitude(
                    new LatitudeWgsDegrees().withValue(-15)));
        assertThat(setPos, is(notNullValue()));
        final SetPositionResponse setPTResponse = (SetPositionResponse)asset.executeCommand(setPos);
        assertThat("Position Response is null", setPTResponse, is(notNullValue()));
        
        //verify that the value is retrievable
        final Command getPos = new GetPositionCommand();
        
        final GetPositionResponse getPTResponse = (GetPositionResponse)asset.executeCommand(getPos);
        assertThat("Get Position Response is null", getPTResponse, is(notNullValue()));
        
        //these values are implemented in the example asset
        assertThat(getPTResponse.getLocation().getLongitude().getValue(), is((double)0));
        assertThat(getPTResponse.getLocation().getLatitude().getValue(), is((double)0));
    }
/**
     * Tests executing a position command for an asset that does not use the default behavior.
     * 
     * Verifies response is actually posted as an event and someone can listen for a specific response by type.
     * Verifies invalid commands can throw exception that is thrown back to the caller.
     */
Tests executing a position command for an asset that does not use the default behavior.

Verifies response is actually posted as an event and someone can listen for a specific response by type.
Verifies invalid commands can throw exception that is thrown back to the caller.
Tests executing a position command for an asset that does not use the default behavior . Verifies response is actually posted as an event and someone can listen for a specific response by type . Verifies invalid commands can throw exception that is thrown back to the caller .
public void testAssetExecuteCommandPositionOverrideTrue() throws Exception
    {
        AssetDirectoryService assetDirectoryService = ServiceUtils.getService(m_Context, AssetDirectoryService.class);
        assertThat(assetDirectoryService, is(notNullValue()));
        Asset asset = assetDirectoryService.createAsset(ExampleAsset.class.getName());
        asset.setName("positionAsset");
        Map<String, Object> properties = asset.getProperties();
        properties.put(AssetAttributes.CONFIG_PROP_PLUGIN_OVERRIDES_POSITION, true);
        asset.setProperties(properties);
        final Command setPos = new SetPositionCommand().withLocation(
            new Coordinates().
                withLongitude(
                    new LongitudeWgsDegrees().withValue(31)).
                withLatitude(
                    new LatitudeWgsDegrees().withValue(-15)));
        assertThat(setPos, is(notNullValue()));
        final SetPositionResponse setPTResponse = (SetPositionResponse)asset.executeCommand(setPos);
        assertThat("Position Response is null", setPTResponse, is(notNullValue()));
        final Command getPos = new GetPositionCommand();
        final GetPositionResponse getPTResponse = (GetPositionResponse)asset.executeCommand(getPos);
        assertThat("Get Position Response is null", getPTResponse, is(notNullValue()));
        assertThat(getPTResponse.getLocation().getLongitude().getValue(), is((double)0));
        assertThat(getPTResponse.getLocation().getLatitude().getValue(), is((double)0));
    }
public void testAssetExecuteCommandPositionOverrideTrue ( ) throws Exception { AssetDirectoryService assetDirectoryService = ServiceUtils . getService ( m_Context , AssetDirectoryService . class ) ; assertThat ( assetDirectoryService , is ( notNullValue ( ) ) ) ; Asset asset = assetDirectoryService . createAsset ( ExampleAsset . class . getName ( ) ) ; asset . setName ( "positionAsset" ) ; Map < String , Object > properties = asset . getProperties ( ) ; properties . put ( AssetAttributes . CONFIG_PROP_PLUGIN_OVERRIDES_POSITION , true ) ; asset . setProperties ( properties ) ; final Command setPos = new SetPositionCommand ( ) . withLocation ( new Coordinates ( ) . withLongitude ( new LongitudeWgsDegrees ( ) . withValue ( 31 ) ) . withLatitude ( new LatitudeWgsDegrees ( ) . withValue ( - 15 ) ) ) ; assertThat ( setPos , is ( notNullValue ( ) ) ) ; final SetPositionResponse setPTResponse = ( SetPositionResponse ) asset . executeCommand ( setPos ) ; assertThat ( "Position Response is null" , setPTResponse , is ( notNullValue ( ) ) ) ; final Command getPos = new GetPositionCommand ( ) ; final GetPositionResponse getPTResponse = ( GetPositionResponse ) asset . executeCommand ( getPos ) ; assertThat ( "Get Position Response is null" , getPTResponse , is ( notNullValue ( ) ) ) ; assertThat ( getPTResponse . getLocation ( ) . getLongitude ( ) . getValue ( ) , is ( ( double ) 0 ) ) ; assertThat ( getPTResponse . getLocation ( ) . getLatitude ( ) . getValue ( ) , is ( ( double ) 0 ) ) ; }
Tests executing a position command for an asset that does not use the default behavior.
Tests executing a position command for an asset that does not use the default behavior .
// Test execute for value within range //location, none of which will actually be used but need to make the command valid //verify that the value is retrievable //these values are implemented in the example asset