mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetCommandViewImpl.java
@Test
    public void testRemoveField()
    {
        ExampleClass testCommandObject = new ExampleClass();
        
        //Create fake node for a value in primitive list field.
        CommandNodeModel listNode = new CommandNodeModel("int", Integer.class, false, 
                testCommandObject.getIntWrapperListField(), m_GrowlUtil);
        listNode.setIndex(1);
        
        Object secondValue = testCommandObject.getIntWrapperListField().get(1);
        //Verify the size of the list before removal of the second value.
        assertThat(testCommandObject.getIntWrapperListField().size(), is(3));
        assertThat(testCommandObject.getIntWrapperListField().contains(secondValue), is(true));
        //Remove the second list value.
        m_SUT.removeField(listNode);
        //Verify the size of the list have decreased by one and that it no longer contains the second value.
        assertThat(testCommandObject.getIntWrapperListField().size(), is(2));
        assertThat(testCommandObject.getIntWrapperListField().contains(secondValue), is(false));
        
        //Create fake node for a complex field.
        CommandNodeModel complexNode = new CommandNodeModel("complexField", ExampleComplexClass.class, true, 
                testCommandObject, m_GrowlUtil);
        
        //Verify that the complex field is initially null.
        assertThat(testCommandObject.getComplexField(), is(notNullValue()));
        //Add object to complex field.
        m_SUT.removeField(complexNode);
        //Verify that the complex field is no longer null.
        assertThat(testCommandObject.getComplexField(), is(nullValue()));
    }
/**
     * Test the remove field method.
     * Verify that the specified list item is removed or the specified field is set to null.
     */
Test the remove field method.
Verify that the specified list item is removed or the specified field is set to null.
Test the remove field method . Verify that the specified list item is removed or the specified field is set to null .
@Test
    public void testRemoveField()
    {
        ExampleClass testCommandObject = new ExampleClass();
        CommandNodeModel listNode = new CommandNodeModel("int", Integer.class, false, 
                testCommandObject.getIntWrapperListField(), m_GrowlUtil);
        listNode.setIndex(1);
        Object secondValue = testCommandObject.getIntWrapperListField().get(1);
        assertThat(testCommandObject.getIntWrapperListField().size(), is(3));
        assertThat(testCommandObject.getIntWrapperListField().contains(secondValue), is(true));
        m_SUT.removeField(listNode);
        assertThat(testCommandObject.getIntWrapperListField().size(), is(2));
        assertThat(testCommandObject.getIntWrapperListField().contains(secondValue), is(false));
        CommandNodeModel complexNode = new CommandNodeModel("complexField", ExampleComplexClass.class, true, 
                testCommandObject, m_GrowlUtil);
        assertThat(testCommandObject.getComplexField(), is(notNullValue()));
        m_SUT.removeField(complexNode);
        assertThat(testCommandObject.getComplexField(), is(nullValue()));
    }
@ Test public void testRemoveField ( ) { ExampleClass testCommandObject = new ExampleClass ( ) ; CommandNodeModel listNode = new CommandNodeModel ( "int" , Integer . class , false , testCommandObject . getIntWrapperListField ( ) , m_GrowlUtil ) ; listNode . setIndex ( 1 ) ; Object secondValue = testCommandObject . getIntWrapperListField ( ) . get ( 1 ) ; assertThat ( testCommandObject . getIntWrapperListField ( ) . size ( ) , is ( 3 ) ) ; assertThat ( testCommandObject . getIntWrapperListField ( ) . contains ( secondValue ) , is ( true ) ) ; m_SUT . removeField ( listNode ) ; assertThat ( testCommandObject . getIntWrapperListField ( ) . size ( ) , is ( 2 ) ) ; assertThat ( testCommandObject . getIntWrapperListField ( ) . contains ( secondValue ) , is ( false ) ) ; CommandNodeModel complexNode = new CommandNodeModel ( "complexField" , ExampleComplexClass . class , true , testCommandObject , m_GrowlUtil ) ; assertThat ( testCommandObject . getComplexField ( ) , is ( notNullValue ( ) ) ) ; m_SUT . removeField ( complexNode ) ; assertThat ( testCommandObject . getComplexField ( ) , is ( nullValue ( ) ) ) ; }
Test the remove field method.
Test the remove field method .
//Create fake node for a value in primitive list field. //Verify the size of the list before removal of the second value. //Remove the second list value. //Verify the size of the list have decreased by one and that it no longer contains the second value. //Create fake node for a complex field. //Verify that the complex field is initially null. //Add object to complex field. //Verify that the complex field is no longer null.