mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestBaseNamespace.java
@Test
    public void testRequestControllerInfoDefaultNamesapce() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        
        // send out message without setting the namespace (so don't use helper class)
        BaseNamespace baseNamespaceMsg = BaseNamespace.newBuilder().setType(
                BaseMessageType.RequestControllerInfo).build();
        TerraHarvestPayload payload = TerraHarvestPayload.newBuilder().setNamespace(Namespace.Base).
                setNamespaceMessage(baseNamespaceMsg.toByteString()).build();
        TerraHarvestMessage request = TerraHarvestMessage.newBuilder().setVersion(RemoteConstants.SPEC_VERSION)
                .setSourceId(TerraHarvestMessageHelper.getSourceId())
                .setDestId(TerraHarvestMessageHelper.getControllerId())
                .setMessageId(0)
                .setTerraHarvestPayload(payload.toByteString())
                .build();
        request.writeDelimitedTo(socket.getOutputStream());

        // read in response
        Message response = listener.waitForMessage(Namespace.Base, 
                BaseMessageType.ControllerInfo, 300);
        BaseNamespace namespaceResponse = (BaseNamespace)response;
        assertThat(namespaceResponse, is(notNullValue()));
        assertThat(namespaceResponse.getType(), is(BaseMessageType.ControllerInfo));
        
        ControllerInfoData controllerInfo = ControllerInfoData.parseFrom(namespaceResponse.getData());
        assertThat(controllerInfo.getName(), is(notNullValue()));
        assertThat(controllerInfo.getVersion(), is(notNullValue()));
        assertThat(controllerInfo.getBuildInfoCount(), greaterThan(0));        
    }
/**
     * Verify sending a controller info request message returns with controller info even if namespace is not 
     * explicitly set.
     */
Verify sending a controller info request message returns with controller info even if namespace is not
explicitly set.
Verify sending a controller info request message returns with controller info even if namespace is not explicitly set .
@Test
    public void testRequestControllerInfoDefaultNamesapce() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        BaseNamespace baseNamespaceMsg = BaseNamespace.newBuilder().setType(
                BaseMessageType.RequestControllerInfo).build();
        TerraHarvestPayload payload = TerraHarvestPayload.newBuilder().setNamespace(Namespace.Base).
                setNamespaceMessage(baseNamespaceMsg.toByteString()).build();
        TerraHarvestMessage request = TerraHarvestMessage.newBuilder().setVersion(RemoteConstants.SPEC_VERSION)
                .setSourceId(TerraHarvestMessageHelper.getSourceId())
                .setDestId(TerraHarvestMessageHelper.getControllerId())
                .setMessageId(0)
                .setTerraHarvestPayload(payload.toByteString())
                .build();
        request.writeDelimitedTo(socket.getOutputStream());
        Message response = listener.waitForMessage(Namespace.Base, 
                BaseMessageType.ControllerInfo, 300);
        BaseNamespace namespaceResponse = (BaseNamespace)response;
        assertThat(namespaceResponse, is(notNullValue()));
        assertThat(namespaceResponse.getType(), is(BaseMessageType.ControllerInfo));
        ControllerInfoData controllerInfo = ControllerInfoData.parseFrom(namespaceResponse.getData());
        assertThat(controllerInfo.getName(), is(notNullValue()));
        assertThat(controllerInfo.getVersion(), is(notNullValue()));
        assertThat(controllerInfo.getBuildInfoCount(), greaterThan(0));        
    }
@ Test public void testRequestControllerInfoDefaultNamesapce ( ) throws IOException , InterruptedException { MessageListener listener = new MessageListener ( socket ) ; BaseNamespace baseNamespaceMsg = BaseNamespace . newBuilder ( ) . setType ( BaseMessageType . RequestControllerInfo ) . build ( ) ; TerraHarvestPayload payload = TerraHarvestPayload . newBuilder ( ) . setNamespace ( Namespace . Base ) . setNamespaceMessage ( baseNamespaceMsg . toByteString ( ) ) . build ( ) ; TerraHarvestMessage request = TerraHarvestMessage . newBuilder ( ) . setVersion ( RemoteConstants . SPEC_VERSION ) . setSourceId ( TerraHarvestMessageHelper . getSourceId ( ) ) . setDestId ( TerraHarvestMessageHelper . getControllerId ( ) ) . setMessageId ( 0 ) . setTerraHarvestPayload ( payload . toByteString ( ) ) . build ( ) ; request . writeDelimitedTo ( socket . getOutputStream ( ) ) ; Message response = listener . waitForMessage ( Namespace . Base , BaseMessageType . ControllerInfo , 300 ) ; BaseNamespace namespaceResponse = ( BaseNamespace ) response ; assertThat ( namespaceResponse , is ( notNullValue ( ) ) ) ; assertThat ( namespaceResponse . getType ( ) , is ( BaseMessageType . ControllerInfo ) ) ; ControllerInfoData controllerInfo = ControllerInfoData . parseFrom ( namespaceResponse . getData ( ) ) ; assertThat ( controllerInfo . getName ( ) , is ( notNullValue ( ) ) ) ; assertThat ( controllerInfo . getVersion ( ) , is ( notNullValue ( ) ) ) ; assertThat ( controllerInfo . getBuildInfoCount ( ) , greaterThan ( 0 ) ) ; }
Verify sending a controller info request message returns with controller info even if namespace is not
 explicitly set.
Verify sending a controller info request message returns with controller info even if namespace is not explicitly set .
// send out message without setting the namespace (so don't use helper class) // read in response