mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestMetaTypeNamespace.java
@Test
    public void testGetAttributeKeysRequest() throws UnknownHostException, IOException, InterruptedException
    {
        //find the example metatype bundle
        long bundleId = 
                BundleNamespaceUtils.getBundleBySymbolicName(EXAMPLE_METATYPE_BUNDLE_NAME, m_Socket);

        //construct request
        GetAttributeKeysRequestData request = GetAttributeKeysRequestData.newBuilder().
            setBundleId(bundleId).setPid(ExampleClass.class.getName()).build();
        TerraHarvestMessage message = createMetaTypeMessage(MetaTypeMessageType.GetAttributeKeyRequest, 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.GetAttributeKeyResponse));
        //verify
        GetAttributeKeysResponseData responseData = GetAttributeKeysResponseData.parseFrom(namespaceResponse.getData());
        assertThat(responseData.getKeyCount(), is(4));
        assertThat(responseData.getKeyList(), hasItems(ExampleClassConfig.CONFIG_PROP_EXAMPLE_CONFIG_VALUE, 
                ExampleClassConfig.CONFIG_PROP_EXAMPLE_CONFIG_VALUE_STRING, 
                ExampleClassConfig.CONFIG_PROP_EXAMPLE_CONFIG_STRING_VALUE_AGAIN,
                ExampleClassConfig.CONFIG_PROP_EXAMPLE_CONFIG_REQUIRED_STRING_VALUE));
    }
/**
     * Test that GetAttributeKeysRequest returns a list of attribute keys.
     * 
     * Verify that the list of keys contains that expected values.
     */
Test that GetAttributeKeysRequest returns a list of attribute keys.

Verify that the list of keys contains that expected values.
Test that GetAttributeKeysRequest returns a list of attribute keys . Verify that the list of keys contains that expected values .
@Test
    public void testGetAttributeKeysRequest() throws UnknownHostException, IOException, InterruptedException
    {
        long bundleId = 
                BundleNamespaceUtils.getBundleBySymbolicName(EXAMPLE_METATYPE_BUNDLE_NAME, m_Socket);
        GetAttributeKeysRequestData request = GetAttributeKeysRequestData.newBuilder().
            setBundleId(bundleId).setPid(ExampleClass.class.getName()).build();
        TerraHarvestMessage message = createMetaTypeMessage(MetaTypeMessageType.GetAttributeKeyRequest, 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.GetAttributeKeyResponse));
        GetAttributeKeysResponseData responseData = GetAttributeKeysResponseData.parseFrom(namespaceResponse.getData());
        assertThat(responseData.getKeyCount(), is(4));
        assertThat(responseData.getKeyList(), hasItems(ExampleClassConfig.CONFIG_PROP_EXAMPLE_CONFIG_VALUE, 
                ExampleClassConfig.CONFIG_PROP_EXAMPLE_CONFIG_VALUE_STRING, 
                ExampleClassConfig.CONFIG_PROP_EXAMPLE_CONFIG_STRING_VALUE_AGAIN,
                ExampleClassConfig.CONFIG_PROP_EXAMPLE_CONFIG_REQUIRED_STRING_VALUE));
    }
@ Test public void testGetAttributeKeysRequest ( ) throws UnknownHostException , IOException , InterruptedException { long bundleId = BundleNamespaceUtils . getBundleBySymbolicName ( EXAMPLE_METATYPE_BUNDLE_NAME , m_Socket ) ; GetAttributeKeysRequestData request = GetAttributeKeysRequestData . newBuilder ( ) . setBundleId ( bundleId ) . setPid ( ExampleClass . class . getName ( ) ) . build ( ) ; TerraHarvestMessage message = createMetaTypeMessage ( MetaTypeMessageType . GetAttributeKeyRequest , 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 . GetAttributeKeyResponse ) ) ; GetAttributeKeysResponseData responseData = GetAttributeKeysResponseData . parseFrom ( namespaceResponse . getData ( ) ) ; assertThat ( responseData . getKeyCount ( ) , is ( 4 ) ) ; assertThat ( responseData . getKeyList ( ) , hasItems ( ExampleClassConfig . CONFIG_PROP_EXAMPLE_CONFIG_VALUE , ExampleClassConfig . CONFIG_PROP_EXAMPLE_CONFIG_VALUE_STRING , ExampleClassConfig . CONFIG_PROP_EXAMPLE_CONFIG_STRING_VALUE_AGAIN , ExampleClassConfig . CONFIG_PROP_EXAMPLE_CONFIG_REQUIRED_STRING_VALUE ) ) ; }
Test that GetAttributeKeysRequest returns a list of attribute keys.
Test that GetAttributeKeysRequest returns a list of attribute keys .
//find the example metatype bundle //construct request //send message //read in response //parse specific message type //verify