mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestAssetNamespace.java
@Test
    public final void testRemoveAsset() throws IOException, InterruptedException
    {
        SharedMessages.UUID uuid = AssetNamespaceUtils.createAsset(socket, ExampleAsset.class.getName(), "removeAsset", 
                null).getInfo().getUuid();
        
        MessageListener listener = new MessageListener(socket);
        
        AssetNamespaceUtils.removeAsset(socket, uuid);
        
        TerraHarvestMessage message = AssetNamespaceUtils.createAssetDirSvcNamespaceMessage(
                AssetDirectoryServiceMessageType.GetAssetsRequest, null);        
        message.writeDelimitedTo(socket.getOutputStream());
        
        //listen for messages for a specific time interval
        Message responseRcvd = listener.waitForMessage(Namespace.AssetDirectoryService, 
                AssetDirectoryServiceMessageType.GetAssetsResponse, 500);   
        
        AssetDirectoryServiceNamespace response = (AssetDirectoryServiceNamespace)responseRcvd;
        GetAssetsResponseData dataResponse = GetAssetsResponseData.
                parseFrom(response.getData());   
        //verify the asset has been removed, and its UUID does not appear in the asset info list
        for (SharedMessages.FactoryObjectInfo info : dataResponse.getAssetInfoList())
        {
            assertThat(info.getUuid(), is(not(uuid)));
        }
    }
/**
     * Verifies the ability of the system to handle a remote request to remove an asset. 
     */
Verifies the ability of the system to handle a remote request to remove an asset.
Verifies the ability of the system to handle a remote request to remove an asset .
@Test
    public final void testRemoveAsset() throws IOException, InterruptedException
    {
        SharedMessages.UUID uuid = AssetNamespaceUtils.createAsset(socket, ExampleAsset.class.getName(), "removeAsset", 
                null).getInfo().getUuid();
        MessageListener listener = new MessageListener(socket);
        AssetNamespaceUtils.removeAsset(socket, uuid);
        TerraHarvestMessage message = AssetNamespaceUtils.createAssetDirSvcNamespaceMessage(
                AssetDirectoryServiceMessageType.GetAssetsRequest, null);        
        message.writeDelimitedTo(socket.getOutputStream());
        Message responseRcvd = listener.waitForMessage(Namespace.AssetDirectoryService, 
                AssetDirectoryServiceMessageType.GetAssetsResponse, 500);   
        AssetDirectoryServiceNamespace response = (AssetDirectoryServiceNamespace)responseRcvd;
        GetAssetsResponseData dataResponse = GetAssetsResponseData.
                parseFrom(response.getData());   
        for (SharedMessages.FactoryObjectInfo info : dataResponse.getAssetInfoList())
        {
            assertThat(info.getUuid(), is(not(uuid)));
        }
    }
@ Test public final void testRemoveAsset ( ) throws IOException , InterruptedException { SharedMessages . UUID uuid = AssetNamespaceUtils . createAsset ( socket , ExampleAsset . class . getName ( ) , "removeAsset" , null ) . getInfo ( ) . getUuid ( ) ; MessageListener listener = new MessageListener ( socket ) ; AssetNamespaceUtils . removeAsset ( socket , uuid ) ; TerraHarvestMessage message = AssetNamespaceUtils . createAssetDirSvcNamespaceMessage ( AssetDirectoryServiceMessageType . GetAssetsRequest , null ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; Message responseRcvd = listener . waitForMessage ( Namespace . AssetDirectoryService , AssetDirectoryServiceMessageType . GetAssetsResponse , 500 ) ; AssetDirectoryServiceNamespace response = ( AssetDirectoryServiceNamespace ) responseRcvd ; GetAssetsResponseData dataResponse = GetAssetsResponseData . parseFrom ( response . getData ( ) ) ; for ( SharedMessages . FactoryObjectInfo info : dataResponse . getAssetInfoList ( ) ) { assertThat ( info . getUuid ( ) , is ( not ( uuid ) ) ) ; } }
Verifies the ability of the system to handle a remote request to remove an asset.
Verifies the ability of the system to handle a remote request to remove an asset .
//listen for messages for a specific time interval //verify the asset has been removed, and its UUID does not appear in the asset info list