mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestBundleNamespace.java
@Test
    public void testBundleInfoRequest() throws UnknownHostException, IOException, InterruptedException
    {
        //construct request, get info for system bundle
        GetBundleInfoRequestData request = GetBundleInfoRequestData.newBuilder().
            setBundleId(0L).
            setBundleDescription(true).
            setBundleSymbolicName(true).
            setBundleState(true).
            setPackageImports(true).
            setPackageExports(true).build();
        TerraHarvestMessage message = 
                BundleNamespaceUtils.createBundleMessage(request, BundleMessageType.GetBundleInfoRequest);

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

        //read in response
        TerraHarvestMessage response = TerraHarvestMessage.parseDelimitedFrom(socket.getInputStream());
        TerraHarvestPayload payLoadTest = TerraHarvestPayload.parseFrom(response.getTerraHarvestPayload());
        assertThat(response, is(notNullValue()));
        assertThat(payLoadTest.getNamespace(), is(Namespace.Bundle));

        //parse specific message type
        BundleNamespace namespaceResponse = BundleNamespace.parseFrom(payLoadTest.getNamespaceMessage());
        assertThat(namespaceResponse.getType(), is(BundleMessageType.GetBundleInfoResponse));
        
        GetBundleInfoResponseData responseData = GetBundleInfoResponseData.parseFrom(namespaceResponse.getData());
       
        assertThat(responseData.getInfoDataCount(), is(1));
        
        BundleInfoType type = responseData.getInfoData(0);
        
        assertThat(type.getBundleId(), is(0L));
        assertThat(type.getBundleSymbolicName(), is("org.apache.felix.framework"));
        assertThat(type.getPackageExportList().get(0).contains("org.osgi.framework;"), is(true));
        //hex representation of the the bundle active status
        assertThat(type.getBundleState(), is(0x00000020));
    }
/**
     * Test get bundle info request.
     * 
     * Verify bundle info is returned.
     */
Test get bundle info request.

Verify bundle info is returned.
Test get bundle info request . Verify bundle info is returned .
@Test
    public void testBundleInfoRequest() throws UnknownHostException, IOException, InterruptedException
    {
        GetBundleInfoRequestData request = GetBundleInfoRequestData.newBuilder().
            setBundleId(0L).
            setBundleDescription(true).
            setBundleSymbolicName(true).
            setBundleState(true).
            setPackageImports(true).
            setPackageExports(true).build();
        TerraHarvestMessage message = 
                BundleNamespaceUtils.createBundleMessage(request, BundleMessageType.GetBundleInfoRequest);
        message.writeDelimitedTo(socket.getOutputStream());
        TerraHarvestMessage response = TerraHarvestMessage.parseDelimitedFrom(socket.getInputStream());
        TerraHarvestPayload payLoadTest = TerraHarvestPayload.parseFrom(response.getTerraHarvestPayload());
        assertThat(response, is(notNullValue()));
        assertThat(payLoadTest.getNamespace(), is(Namespace.Bundle));
        BundleNamespace namespaceResponse = BundleNamespace.parseFrom(payLoadTest.getNamespaceMessage());
        assertThat(namespaceResponse.getType(), is(BundleMessageType.GetBundleInfoResponse));
        GetBundleInfoResponseData responseData = GetBundleInfoResponseData.parseFrom(namespaceResponse.getData());
        assertThat(responseData.getInfoDataCount(), is(1));
        BundleInfoType type = responseData.getInfoData(0);
        assertThat(type.getBundleId(), is(0L));
        assertThat(type.getBundleSymbolicName(), is("org.apache.felix.framework"));
        assertThat(type.getPackageExportList().get(0).contains("org.osgi.framework;"), is(true));
        assertThat(type.getBundleState(), is(0x00000020));
    }
@ Test public void testBundleInfoRequest ( ) throws UnknownHostException , IOException , InterruptedException { GetBundleInfoRequestData request = GetBundleInfoRequestData . newBuilder ( ) . setBundleId ( 0L ) . setBundleDescription ( true ) . setBundleSymbolicName ( true ) . setBundleState ( true ) . setPackageImports ( true ) . setPackageExports ( true ) . build ( ) ; TerraHarvestMessage message = BundleNamespaceUtils . createBundleMessage ( request , BundleMessageType . GetBundleInfoRequest ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; TerraHarvestMessage response = TerraHarvestMessage . parseDelimitedFrom ( socket . getInputStream ( ) ) ; TerraHarvestPayload payLoadTest = TerraHarvestPayload . parseFrom ( response . getTerraHarvestPayload ( ) ) ; assertThat ( response , is ( notNullValue ( ) ) ) ; assertThat ( payLoadTest . getNamespace ( ) , is ( Namespace . Bundle ) ) ; BundleNamespace namespaceResponse = BundleNamespace . parseFrom ( payLoadTest . getNamespaceMessage ( ) ) ; assertThat ( namespaceResponse . getType ( ) , is ( BundleMessageType . GetBundleInfoResponse ) ) ; GetBundleInfoResponseData responseData = GetBundleInfoResponseData . parseFrom ( namespaceResponse . getData ( ) ) ; assertThat ( responseData . getInfoDataCount ( ) , is ( 1 ) ) ; BundleInfoType type = responseData . getInfoData ( 0 ) ; assertThat ( type . getBundleId ( ) , is ( 0L ) ) ; assertThat ( type . getBundleSymbolicName ( ) , is ( "org.apache.felix.framework" ) ) ; assertThat ( type . getPackageExportList ( ) . get ( 0 ) . contains ( "org.osgi.framework;" ) , is ( true ) ) ; assertThat ( type . getBundleState ( ) , is ( 0x00000020 ) ) ; }
Test get bundle info request.
Test get bundle info request .
//construct request, get info for system bundle //send message //read in response //parse specific message type //hex representation of the the bundle active status