mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestBundleNamespace.java
@Test
    public void testBundleInfoRequestWithNoSpecifiedId() throws UnknownHostException, IOException
    {
        MessageListener listener = new MessageListener(socket);
        
        GetBundlesResponseData info = BundleNamespaceUtils.getBundles(socket);
        int totalBundles = info.getBundleIdCount();
        
        //construct request, get info for system bundle
        GetBundleInfoRequestData request = GetBundleInfoRequestData.newBuilder().
            setBundleDescription(true).
            setBundleSymbolicName(true).
            setBundleState(true).
            setPackageImports(true).
            setPackageExports(true).build();
        TerraHarvestMessage message = 
                BundleNamespaceUtils.createBundleMessage(request, BundleMessageType.GetBundleInfoRequest);

        //send message
        message.writeDelimitedTo(socket.getOutputStream());
        
        BundleNamespace namespaceResponse = (BundleNamespace)listener.waitForMessage(Namespace.Bundle, 
                BundleMessageType.GetBundleInfoResponse, 1000);

        GetBundleInfoResponseData responseData = GetBundleInfoResponseData.parseFrom(namespaceResponse.getData());
        
        assertThat(responseData.getInfoDataCount(), is(totalBundles));
    }
/**
     * Verify that with no bundle id specified, all bundles are returned. 
     */
Verify that with no bundle id specified, all bundles are returned.
Verify that with no bundle id specified all bundles are returned .
@Test
    public void testBundleInfoRequestWithNoSpecifiedId() throws UnknownHostException, IOException
    {
        MessageListener listener = new MessageListener(socket);
        GetBundlesResponseData info = BundleNamespaceUtils.getBundles(socket);
        int totalBundles = info.getBundleIdCount();
        GetBundleInfoRequestData request = GetBundleInfoRequestData.newBuilder().
            setBundleDescription(true).
            setBundleSymbolicName(true).
            setBundleState(true).
            setPackageImports(true).
            setPackageExports(true).build();
        TerraHarvestMessage message = 
                BundleNamespaceUtils.createBundleMessage(request, BundleMessageType.GetBundleInfoRequest);
        message.writeDelimitedTo(socket.getOutputStream());
        BundleNamespace namespaceResponse = (BundleNamespace)listener.waitForMessage(Namespace.Bundle, 
                BundleMessageType.GetBundleInfoResponse, 1000);
        GetBundleInfoResponseData responseData = GetBundleInfoResponseData.parseFrom(namespaceResponse.getData());
        assertThat(responseData.getInfoDataCount(), is(totalBundles));
    }
@ Test public void testBundleInfoRequestWithNoSpecifiedId ( ) throws UnknownHostException , IOException { MessageListener listener = new MessageListener ( socket ) ; GetBundlesResponseData info = BundleNamespaceUtils . getBundles ( socket ) ; int totalBundles = info . getBundleIdCount ( ) ; GetBundleInfoRequestData request = GetBundleInfoRequestData . newBuilder ( ) . setBundleDescription ( true ) . setBundleSymbolicName ( true ) . setBundleState ( true ) . setPackageImports ( true ) . setPackageExports ( true ) . build ( ) ; TerraHarvestMessage message = BundleNamespaceUtils . createBundleMessage ( request , BundleMessageType . GetBundleInfoRequest ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; BundleNamespace namespaceResponse = ( BundleNamespace ) listener . waitForMessage ( Namespace . Bundle , BundleMessageType . GetBundleInfoResponse , 1000 ) ; GetBundleInfoResponseData responseData = GetBundleInfoResponseData . parseFrom ( namespaceResponse . getData ( ) ) ; assertThat ( responseData . getInfoDataCount ( ) , is ( totalBundles ) ) ; }
Verify that with no bundle id specified, all bundles are returned.
Verify that with no bundle id specified all bundles are returned .
//construct request, get info for system bundle //send message