mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestBundleNamespace.java
@Test
    public void testBundleUpdateRequest() throws UnknownHostException, IOException, InterruptedException
    {
        //listener that will wait for messages
        MessageListener listener = new MessageListener(socket);
        
        //install the bundle
        long bundleId = BundleNamespaceUtils.installBundle(ResourceUtils.getExampleProjectBundleFile(), 
                "test.my.bundle", false, socket);

        byte[] buf = FileUtils.readFileToByteArray(ResourceUtils.getExampleProjectBundleFile());
        
        //request
        UpdateRequestData request = UpdateRequestData.newBuilder().
            setBundleId(bundleId).
            setBundleFile(ByteString.copyFrom(buf)).build();
        TerraHarvestMessage message = 
                BundleNamespaceUtils.createBundleMessage(request, BundleMessageType.UpdateRequest);

        //send message
        message.writeDelimitedTo(socket.getOutputStream());

        //read in response
        listener.waitForMessage(Namespace.Bundle, BundleMessageType.UpdateResponse, 500);
        
        // uninstall the bundle
        BundleNamespaceUtils.uninstallBundle(bundleId, socket);
    }
/**
     * Test update bundle request.
     * 
     * Verify response is returned.
     */
Test update bundle request.

Verify response is returned.
Test update bundle request . Verify response is returned .
@Test
    public void testBundleUpdateRequest() throws UnknownHostException, IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        long bundleId = BundleNamespaceUtils.installBundle(ResourceUtils.getExampleProjectBundleFile(), 
                "test.my.bundle", false, socket);
        byte[] buf = FileUtils.readFileToByteArray(ResourceUtils.getExampleProjectBundleFile());
        UpdateRequestData request = UpdateRequestData.newBuilder().
            setBundleId(bundleId).
            setBundleFile(ByteString.copyFrom(buf)).build();
        TerraHarvestMessage message = 
                BundleNamespaceUtils.createBundleMessage(request, BundleMessageType.UpdateRequest);
        message.writeDelimitedTo(socket.getOutputStream());
        listener.waitForMessage(Namespace.Bundle, BundleMessageType.UpdateResponse, 500);
        BundleNamespaceUtils.uninstallBundle(bundleId, socket);
    }
@ Test public void testBundleUpdateRequest ( ) throws UnknownHostException , IOException , InterruptedException { MessageListener listener = new MessageListener ( socket ) ; long bundleId = BundleNamespaceUtils . installBundle ( ResourceUtils . getExampleProjectBundleFile ( ) , "test.my.bundle" , false , socket ) ; byte [ ] buf = FileUtils . readFileToByteArray ( ResourceUtils . getExampleProjectBundleFile ( ) ) ; UpdateRequestData request = UpdateRequestData . newBuilder ( ) . setBundleId ( bundleId ) . setBundleFile ( ByteString . copyFrom ( buf ) ) . build ( ) ; TerraHarvestMessage message = BundleNamespaceUtils . createBundleMessage ( request , BundleMessageType . UpdateRequest ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; listener . waitForMessage ( Namespace . Bundle , BundleMessageType . UpdateResponse , 500 ) ; BundleNamespaceUtils . uninstallBundle ( bundleId , socket ) ; }
Test update bundle request.
Test update bundle request .
//listener that will wait for messages //install the bundle //request //send message //read in response // uninstall the bundle