mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestConfigAdminNamespace.java
@Test
    public void testGetPropertyKeys() throws IOException, InterruptedException
    {   
        ConfigNamespaceUtils.setConfigProperty(ExampleClass.CONFIG_PID, "name", "golden egg", socket);
        
        //allow config admin to post property set
        Thread.sleep(1000);
        
        MessageListener listener = new MessageListener(socket);
        
        GetPropertyKeysRequestData request = GetPropertyKeysRequestData.newBuilder().
                setPid(ExampleClass.CONFIG_PID).build();
                
        //create terra harvest message   
        TerraHarvestMessage message = createConfigAdminMessage(ConfigAdminMessageType.GetPropertyKeysRequest, request);
                
        // send out message
        message.writeDelimitedTo(socket.getOutputStream());
        
        // listen for response
        ConfigAdminNamespace namespaceResponse = (ConfigAdminNamespace)listener.waitForMessage(
                Namespace.ConfigAdmin, ConfigAdminMessageType.GetPropertyKeysResponse, 500);
        
        //verify
        GetPropertyKeysResponseData keysData = GetPropertyKeysResponseData.parseFrom(namespaceResponse.getData());
        assertThat(keysData.getKeyList(), is(notNullValue()));
        assertThat(keysData.getKeyCount(), greaterThan(0));
        assertThat(keysData.getKeyList(), containsInAnyOrder("service.pid", "name"));
        assertThat(keysData.getPid(), is(ExampleClass.CONFIG_PID));
                            
        //create message with a pid that is not known
        request = GetPropertyKeysRequestData.newBuilder().setPid("Look ma no hands").build();
                    
        //create terra harvest message   
        message = createConfigAdminMessage(ConfigAdminMessageType.GetPropertyKeysRequest, request);
                    
        // send out message
        message.writeDelimitedTo(socket.getOutputStream());
         
        // read in response
        namespaceResponse = (ConfigAdminNamespace)listener.waitForMessage(
                Namespace.ConfigAdmin, ConfigAdminMessageType.GetPropertyKeysResponse, 500);
        //verify
        keysData = GetPropertyKeysResponseData.parseFrom(namespaceResponse.getData());
        assertThat(keysData.getKeyList(), is(notNullValue()));
        assertThat(keysData.getKeyList().isEmpty(), is(true));
        assertThat(keysData.getPid(), is("Look ma no hands"));       
    }
/**
     * Test the 'get property keys request'.
     * 
     * Verify that keys are returned. 
     * 
     * Verify that is there is no properties from the requested PID that the 'property key list' is empty and not
     * null.
     */
Test the 'get property keys request'.

Verify that keys are returned.

Verify that is there is no properties from the requested PID that the 'property key list' is empty and not
null.
Test the ' get property keys request ' . Verify that keys are returned . Verify that is there is no properties from the requested PID that the ' property key list ' is empty and not null .
@Test
    public void testGetPropertyKeys() throws IOException, InterruptedException
    {   
        ConfigNamespaceUtils.setConfigProperty(ExampleClass.CONFIG_PID, "name", "golden egg", socket);
        Thread.sleep(1000);
        MessageListener listener = new MessageListener(socket);
        GetPropertyKeysRequestData request = GetPropertyKeysRequestData.newBuilder().
                setPid(ExampleClass.CONFIG_PID).build();
        TerraHarvestMessage message = createConfigAdminMessage(ConfigAdminMessageType.GetPropertyKeysRequest, request);
        message.writeDelimitedTo(socket.getOutputStream());
        ConfigAdminNamespace namespaceResponse = (ConfigAdminNamespace)listener.waitForMessage(
                Namespace.ConfigAdmin, ConfigAdminMessageType.GetPropertyKeysResponse, 500);
        GetPropertyKeysResponseData keysData = GetPropertyKeysResponseData.parseFrom(namespaceResponse.getData());
        assertThat(keysData.getKeyList(), is(notNullValue()));
        assertThat(keysData.getKeyCount(), greaterThan(0));
        assertThat(keysData.getKeyList(), containsInAnyOrder("service.pid", "name"));
        assertThat(keysData.getPid(), is(ExampleClass.CONFIG_PID));
        request = GetPropertyKeysRequestData.newBuilder().setPid("Look ma no hands").build();
        message = createConfigAdminMessage(ConfigAdminMessageType.GetPropertyKeysRequest, request);
        message.writeDelimitedTo(socket.getOutputStream());
        namespaceResponse = (ConfigAdminNamespace)listener.waitForMessage(
                Namespace.ConfigAdmin, ConfigAdminMessageType.GetPropertyKeysResponse, 500);
        keysData = GetPropertyKeysResponseData.parseFrom(namespaceResponse.getData());
        assertThat(keysData.getKeyList(), is(notNullValue()));
        assertThat(keysData.getKeyList().isEmpty(), is(true));
        assertThat(keysData.getPid(), is("Look ma no hands"));       
    }
@ Test public void testGetPropertyKeys ( ) throws IOException , InterruptedException { ConfigNamespaceUtils . setConfigProperty ( ExampleClass . CONFIG_PID , "name" , "golden egg" , socket ) ; Thread . sleep ( 1000 ) ; MessageListener listener = new MessageListener ( socket ) ; GetPropertyKeysRequestData request = GetPropertyKeysRequestData . newBuilder ( ) . setPid ( ExampleClass . CONFIG_PID ) . build ( ) ; TerraHarvestMessage message = createConfigAdminMessage ( ConfigAdminMessageType . GetPropertyKeysRequest , request ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; ConfigAdminNamespace namespaceResponse = ( ConfigAdminNamespace ) listener . waitForMessage ( Namespace . ConfigAdmin , ConfigAdminMessageType . GetPropertyKeysResponse , 500 ) ; GetPropertyKeysResponseData keysData = GetPropertyKeysResponseData . parseFrom ( namespaceResponse . getData ( ) ) ; assertThat ( keysData . getKeyList ( ) , is ( notNullValue ( ) ) ) ; assertThat ( keysData . getKeyCount ( ) , greaterThan ( 0 ) ) ; assertThat ( keysData . getKeyList ( ) , containsInAnyOrder ( "service.pid" , "name" ) ) ; assertThat ( keysData . getPid ( ) , is ( ExampleClass . CONFIG_PID ) ) ; request = GetPropertyKeysRequestData . newBuilder ( ) . setPid ( "Look ma no hands" ) . build ( ) ; message = createConfigAdminMessage ( ConfigAdminMessageType . GetPropertyKeysRequest , request ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; namespaceResponse = ( ConfigAdminNamespace ) listener . waitForMessage ( Namespace . ConfigAdmin , ConfigAdminMessageType . GetPropertyKeysResponse , 500 ) ; keysData = GetPropertyKeysResponseData . parseFrom ( namespaceResponse . getData ( ) ) ; assertThat ( keysData . getKeyList ( ) , is ( notNullValue ( ) ) ) ; assertThat ( keysData . getKeyList ( ) . isEmpty ( ) , is ( true ) ) ; assertThat ( keysData . getPid ( ) , is ( "Look ma no hands" ) ) ; }
Test the 'get property keys request'.
Test the ' get property keys request ' .
//allow config admin to post property set //create terra harvest message    // send out message // listen for response //verify //create message with a pid that is not known //create terra harvest message    // send out message // read in response //verify