mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/advanced/configuration/TestConfigurationWrapperImpl.java
@Test
    public void testGetConfigurationByPid()
    {
        //Verify the contents of the model being returned.
        UnmodifiableConfigMetatypeModel returnModel = m_SUT.getConfigurationByPidAsync(25, "some PID");
        assertThat(returnModel.getPid(), is("some PID"));
        assertThat(returnModel.getProperties().size(), is(1));
        UnmodifiablePropertyModel property = returnModel.getProperties().get(0);
        assertThat(property.getKey(), is("name"));
        assertThat(property.getName(), is("name"));
        assertThat(property.getDefaultValues().get(0), is("Bob"));
        assertThat(property.getCardinality(), is(1));
        assertThat(property.getType(), is((Object)String.class));
        assertThat(property.getValue(), is((Object)"some name"));
        
        //Verify contents of factory configuration is returned correctly.
        returnModel = m_SUT.getConfigurationByPidAsync(25, "some factory config");
        assertThat(returnModel.getPid(), is("some factory config"));
        assertThat(returnModel.getProperties().size(), is(1));
        property = returnModel.getProperties().get(0);
        assertThat(property.getKey(), is("name"));
        assertThat(property.getName(), is("name"));
        assertThat(property.getDefaultValues().get(0), is("Bob"));
        assertThat(property.getCardinality(), is(1));
        assertThat(property.getType(), is((Object)String.class));
        assertThat(property.getValue(), is((Object)"some name"));
        
        //Verify non-existent pid returns null.
        returnModel = m_SUT.getConfigurationByPidAsync(25, "doesn't exist");
        assertThat(returnModel, is(nullValue()));
    }
/**
     * Test the GetConfigurationByPid method.
     * Verify the model returned is correct.
     */
Test the GetConfigurationByPid method.
Verify the model returned is correct.
Test the GetConfigurationByPid method . Verify the model returned is correct .
@Test
    public void testGetConfigurationByPid()
    {
        UnmodifiableConfigMetatypeModel returnModel = m_SUT.getConfigurationByPidAsync(25, "some PID");
        assertThat(returnModel.getPid(), is("some PID"));
        assertThat(returnModel.getProperties().size(), is(1));
        UnmodifiablePropertyModel property = returnModel.getProperties().get(0);
        assertThat(property.getKey(), is("name"));
        assertThat(property.getName(), is("name"));
        assertThat(property.getDefaultValues().get(0), is("Bob"));
        assertThat(property.getCardinality(), is(1));
        assertThat(property.getType(), is((Object)String.class));
        assertThat(property.getValue(), is((Object)"some name"));
        returnModel = m_SUT.getConfigurationByPidAsync(25, "some factory config");
        assertThat(returnModel.getPid(), is("some factory config"));
        assertThat(returnModel.getProperties().size(), is(1));
        property = returnModel.getProperties().get(0);
        assertThat(property.getKey(), is("name"));
        assertThat(property.getName(), is("name"));
        assertThat(property.getDefaultValues().get(0), is("Bob"));
        assertThat(property.getCardinality(), is(1));
        assertThat(property.getType(), is((Object)String.class));
        assertThat(property.getValue(), is((Object)"some name"));
        returnModel = m_SUT.getConfigurationByPidAsync(25, "doesn't exist");
        assertThat(returnModel, is(nullValue()));
    }
@ Test public void testGetConfigurationByPid ( ) { UnmodifiableConfigMetatypeModel returnModel = m_SUT . getConfigurationByPidAsync ( 25 , "some PID" ) ; assertThat ( returnModel . getPid ( ) , is ( "some PID" ) ) ; assertThat ( returnModel . getProperties ( ) . size ( ) , is ( 1 ) ) ; UnmodifiablePropertyModel property = returnModel . getProperties ( ) . get ( 0 ) ; assertThat ( property . getKey ( ) , is ( "name" ) ) ; assertThat ( property . getName ( ) , is ( "name" ) ) ; assertThat ( property . getDefaultValues ( ) . get ( 0 ) , is ( "Bob" ) ) ; assertThat ( property . getCardinality ( ) , is ( 1 ) ) ; assertThat ( property . getType ( ) , is ( ( Object ) String . class ) ) ; assertThat ( property . getValue ( ) , is ( ( Object ) "some name" ) ) ; returnModel = m_SUT . getConfigurationByPidAsync ( 25 , "some factory config" ) ; assertThat ( returnModel . getPid ( ) , is ( "some factory config" ) ) ; assertThat ( returnModel . getProperties ( ) . size ( ) , is ( 1 ) ) ; property = returnModel . getProperties ( ) . get ( 0 ) ; assertThat ( property . getKey ( ) , is ( "name" ) ) ; assertThat ( property . getName ( ) , is ( "name" ) ) ; assertThat ( property . getDefaultValues ( ) . get ( 0 ) , is ( "Bob" ) ) ; assertThat ( property . getCardinality ( ) , is ( 1 ) ) ; assertThat ( property . getType ( ) , is ( ( Object ) String . class ) ) ; assertThat ( property . getValue ( ) , is ( ( Object ) "some name" ) ) ; returnModel = m_SUT . getConfigurationByPidAsync ( 25 , "doesn't exist" ) ; assertThat ( returnModel , is ( nullValue ( ) ) ) ; }
Test the GetConfigurationByPid method.
Test the GetConfigurationByPid method .
//Verify the contents of the model being returned. //Verify contents of factory configuration is returned correctly. //Verify non-existent pid returns null.