mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestMissionProgrammingNamespace.java
@Test
    public void testRemoveTemplate() throws UnknownHostException, IOException, InterruptedException
    {
        //load the test template
        loadProtoTestTemplate();
        
        MessageListener listener = new MessageListener(m_Socket);
        
        //remove template message
        RemoveTemplateRequestData removeMessage = MissionProgramMessages.RemoveTemplateRequestData.newBuilder().
                setNameOfTemplate("TEST_TEMPLATE_REMOTE").build();
        
        //construct the namespace message
        MissionProgrammingNamespace.Builder missionMessageBuilder = MissionProgrammingNamespace.newBuilder().
            setType(MissionProgrammingMessageType.RemoveTemplateRequest).setData(removeMessage.toByteString());
        
        //add the previous messages to a terra harvest message
        TerraHarvestMessage message = TerraHarvestMessageHelper.createTerraHarvestMsg(Namespace.MissionProgramming, 
                missionMessageBuilder);
        // send out message
        message.writeDelimitedTo(m_Socket.getOutputStream());
        
        //verify response
        listener.waitForMessage(Namespace.MissionProgramming, MissionProgrammingMessageType.RemoveTemplateResponse,
                    300);
    }
/**
     * Test requesting the removal of a template.
     */
Test requesting the removal of a template.
Test requesting the removal of a template .
@Test
    public void testRemoveTemplate() throws UnknownHostException, IOException, InterruptedException
    {
        loadProtoTestTemplate();
        MessageListener listener = new MessageListener(m_Socket);
        RemoveTemplateRequestData removeMessage = MissionProgramMessages.RemoveTemplateRequestData.newBuilder().
                setNameOfTemplate("TEST_TEMPLATE_REMOTE").build();
        MissionProgrammingNamespace.Builder missionMessageBuilder = MissionProgrammingNamespace.newBuilder().
            setType(MissionProgrammingMessageType.RemoveTemplateRequest).setData(removeMessage.toByteString());
        TerraHarvestMessage message = TerraHarvestMessageHelper.createTerraHarvestMsg(Namespace.MissionProgramming, 
                missionMessageBuilder);
        message.writeDelimitedTo(m_Socket.getOutputStream());
        listener.waitForMessage(Namespace.MissionProgramming, MissionProgrammingMessageType.RemoveTemplateResponse,
                    300);
    }
@ Test public void testRemoveTemplate ( ) throws UnknownHostException , IOException , InterruptedException { loadProtoTestTemplate ( ) ; MessageListener listener = new MessageListener ( m_Socket ) ; RemoveTemplateRequestData removeMessage = MissionProgramMessages . RemoveTemplateRequestData . newBuilder ( ) . setNameOfTemplate ( "TEST_TEMPLATE_REMOTE" ) . build ( ) ; MissionProgrammingNamespace . Builder missionMessageBuilder = MissionProgrammingNamespace . newBuilder ( ) . setType ( MissionProgrammingMessageType . RemoveTemplateRequest ) . setData ( removeMessage . toByteString ( ) ) ; TerraHarvestMessage message = TerraHarvestMessageHelper . createTerraHarvestMsg ( Namespace . MissionProgramming , missionMessageBuilder ) ; message . writeDelimitedTo ( m_Socket . getOutputStream ( ) ) ; listener . waitForMessage ( Namespace . MissionProgramming , MissionProgrammingMessageType . RemoveTemplateResponse , 300 ) ; }
Test requesting the removal of a template.
Test requesting the removal of a template .
//load the test template //remove template message //construct the namespace message //add the previous messages to a terra harvest message // send out message //verify response