mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestMetaTypeNamespace.java
@Test
    public void testGetBundlePids() throws UnknownHostException, IOException, InterruptedException
    {
        //find the example metatype bundle
        long bundleId = 
                BundleNamespaceUtils.getBundleBySymbolicName(EXAMPLE_METATYPE_BUNDLE_NAME, m_Socket);
        
        //construct request
        GetBundlePidsRequestData request = GetBundlePidsRequestData.newBuilder().
            setBundleId(bundleId).build();
        TerraHarvestMessage message = createMetaTypeMessage(MetaTypeMessageType.GetBundlePidsRequest, request);

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

        //read in response
        TerraHarvestMessage response = TerraHarvestMessage.parseDelimitedFrom(m_Socket.getInputStream());
        TerraHarvestPayload payLoadTest = TerraHarvestPayload.parseFrom(response.getTerraHarvestPayload());
        
        assertThat(response, is(notNullValue()));
        assertThat(payLoadTest.getNamespace(), is(Namespace.MetaType));
        //parse specific message type
        MetaTypeNamespace namespaceResponse = MetaTypeNamespace.parseFrom(payLoadTest.getNamespaceMessage());
        assertThat(namespaceResponse.getType(), is(MetaTypeMessageType.GetBundlePidsResponse));
        //verify
        GetBundlePidsResponseData responseData = GetBundlePidsResponseData.parseFrom(namespaceResponse.getData());

        assertThat(responseData.getPidsCount(), is(1));
        //verify if there is more that one PID
        assertThat(responseData.getPidsList().contains(ExampleClass.class.getName()), is(true));
    }
/**
     * Test that a list of pids is returned for a particular bundle id.
     * 
     * Verify that pids are returned.
     */
Test that a list of pids is returned for a particular bundle id.

Verify that pids are returned.
Test that a list of pids is returned for a particular bundle id . Verify that pids are returned .
@Test
    public void testGetBundlePids() throws UnknownHostException, IOException, InterruptedException
    {
        long bundleId = 
                BundleNamespaceUtils.getBundleBySymbolicName(EXAMPLE_METATYPE_BUNDLE_NAME, m_Socket);
        GetBundlePidsRequestData request = GetBundlePidsRequestData.newBuilder().
            setBundleId(bundleId).build();
        TerraHarvestMessage message = createMetaTypeMessage(MetaTypeMessageType.GetBundlePidsRequest, request);
        message.writeDelimitedTo(m_Socket.getOutputStream());
        TerraHarvestMessage response = TerraHarvestMessage.parseDelimitedFrom(m_Socket.getInputStream());
        TerraHarvestPayload payLoadTest = TerraHarvestPayload.parseFrom(response.getTerraHarvestPayload());
        assertThat(response, is(notNullValue()));
        assertThat(payLoadTest.getNamespace(), is(Namespace.MetaType));
        MetaTypeNamespace namespaceResponse = MetaTypeNamespace.parseFrom(payLoadTest.getNamespaceMessage());
        assertThat(namespaceResponse.getType(), is(MetaTypeMessageType.GetBundlePidsResponse));
        GetBundlePidsResponseData responseData = GetBundlePidsResponseData.parseFrom(namespaceResponse.getData());
        assertThat(responseData.getPidsCount(), is(1));
         if there is more that one PID
        assertThat(responseData.getPidsList().contains(ExampleClass.class.getName()), is(true));
    }
@ Test public void testGetBundlePids ( ) throws UnknownHostException , IOException , InterruptedException { long bundleId = BundleNamespaceUtils . getBundleBySymbolicName ( EXAMPLE_METATYPE_BUNDLE_NAME , m_Socket ) ; GetBundlePidsRequestData request = GetBundlePidsRequestData . newBuilder ( ) . setBundleId ( bundleId ) . build ( ) ; TerraHarvestMessage message = createMetaTypeMessage ( MetaTypeMessageType . GetBundlePidsRequest , request ) ; message . writeDelimitedTo ( m_Socket . getOutputStream ( ) ) ; TerraHarvestMessage response = TerraHarvestMessage . parseDelimitedFrom ( m_Socket . getInputStream ( ) ) ; TerraHarvestPayload payLoadTest = TerraHarvestPayload . parseFrom ( response . getTerraHarvestPayload ( ) ) ; assertThat ( response , is ( notNullValue ( ) ) ) ; assertThat ( payLoadTest . getNamespace ( ) , is ( Namespace . MetaType ) ) ; MetaTypeNamespace namespaceResponse = MetaTypeNamespace . parseFrom ( payLoadTest . getNamespaceMessage ( ) ) ; assertThat ( namespaceResponse . getType ( ) , is ( MetaTypeMessageType . GetBundlePidsResponse ) ) ; GetBundlePidsResponseData responseData = GetBundlePidsResponseData . parseFrom ( namespaceResponse . getData ( ) ) ; assertThat ( responseData . getPidsCount ( ) , is ( 1 ) ) ; assertThat ( responseData . getPidsList ( ) . contains ( ExampleClass . class . getName ( ) ) , is ( true ) ) ; }
Test that a list of pids is returned for a particular bundle id.
Test that a list of pids is returned for a particular bundle id .
//find the example metatype bundle //construct request //send message //read in response //parse specific message type //verify //verify if there is more that one PID