mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetCommandViewImpl.java
@Test
    public void testGetTree() throws ReflectionsUtilException
    {
        ExampleClass testCommandObject = new ExampleClass();

        UUID assetUuid = UUID.randomUUID();
        TreeNode root = m_SUT.getTree(assetUuid, testCommandObject);
        
        //Verify tree contains appropriate nodes.
        assertThat(containsNode(root, "boolField", "", 1), is(true));
        assertThat(containsNode(root, "boolWrapperField", testCommandObject.isBoolWrapperField(), 1), is(true));
        assertThat(containsNode(root, "byteField", "", 1), is(true));
        assertThat(containsNode(root, "byteWrapperField", testCommandObject.getByteWrapperField(), 1), is(true));
        assertThat(containsNode(root, "charField", "", 1), is(true));
        assertThat(containsNode(root, "charWrapperField", testCommandObject.getCharWrapperField(), 1), is(true));
        assertThat(containsNode(root, "complexField", testCommandObject.getComplexField(), 1), is(true));
        assertThat(containsNode(root, "complexListField", testCommandObject.getComplexListField(), 1), is(true));
        assertThat(containsNode(root, "doubleField", "", 1), is(true));
        assertThat(containsNode(root, "doubleWrapperField", testCommandObject.getDoubleWrapperField(), 1), is(true));
        assertThat(containsNode(root, "enumField", testCommandObject.getEnumField(), 1), is(true));
        assertThat(containsNode(root, "floatField", "", 1), is(true));
        assertThat(containsNode(root, "floatWrapperField", testCommandObject.getFloatWrapperField(), 1), is(true));
        assertThat(containsNode(root, "intField", "", 1), is(true));
        assertThat(containsNode(root, "intWrapperField", testCommandObject.getIntWrapperField(), 1), is(true));
        assertThat(containsNode(root, "intWrapperListField", testCommandObject.getIntWrapperListField(), 1), is(true));
        assertThat(containsNode(root, "longField", "", 1), is(true));
        assertThat(containsNode(root, "longWrapperField", testCommandObject.getLongWrapperField(), 1), is(true));
        assertThat(containsNode(root, "nullComplexField", testCommandObject.getNullComplexField(), 1), is(true));
        assertThat(containsNode(root, "shortField", "", 1), is(true));
        assertThat(containsNode(root, "shortWrapperField", testCommandObject.getShortWrapperField(), 1), is(true));
        assertThat(containsNode(root, "stringField", testCommandObject.getStringField(), 1), is(true));
        
        ExampleComplexClass listComplexClass = testCommandObject.getComplexListField().get(0);
        assertThat(containsNode(root, "ExampleComplexClass", listComplexClass, 2), is(true));
        assertThat(containsNode(root, "intWrapperField", listComplexClass.getIntWrapperField(), 3), is(true));
        assertThat(containsNode(root, "doubleWrapperField", listComplexClass.getDoubleWrapperField(), 3), is(true));
        
        ExampleComplexClass complexClass = testCommandObject.getComplexField();
        assertThat(containsNode(root, "intWrapperField", complexClass.getIntWrapperField(), 2), is(true));
        assertThat(containsNode(root, "doubleWrapperField", complexClass.getDoubleWrapperField(), 2), is(true));
        
        List<Integer> intList = testCommandObject.getIntWrapperListField();
        assertThat(containsNode(root, "Integer", intList.get(0), 2), is(true));
        assertThat(containsNode(root, "Integer", intList.get(1), 2), is(true));
        assertThat(containsNode(root, "Integer", intList.get(2), 2), is(true));
        
        //Verify that the serialVersionUID field did not get put in the tree.
        assertThat(containsNode(root, "serialVersionUID", testCommandObject.getSerialVersionUID(), 1), is(false));
        assertThat(containsNode(root, "stringTransientField", testCommandObject.getStringTransientField(), 1), 
                is(false));
    }
/**
     * Test the get tree method.
     * Verify that the tree has been built correctly. 
     */
Test the get tree method.
Verify that the tree has been built correctly.
Test the get tree method . Verify that the tree has been built correctly .
@Test
    public void testGetTree() throws ReflectionsUtilException
    {
        ExampleClass testCommandObject = new ExampleClass();
        UUID assetUuid = UUID.randomUUID();
        TreeNode root = m_SUT.getTree(assetUuid, testCommandObject);
        assertThat(containsNode(root, "boolField", "", 1), is(true));
        assertThat(containsNode(root, "boolWrapperField", testCommandObject.isBoolWrapperField(), 1), is(true));
        assertThat(containsNode(root, "byteField", "", 1), is(true));
        assertThat(containsNode(root, "byteWrapperField", testCommandObject.getByteWrapperField(), 1), is(true));
        assertThat(containsNode(root, "charField", "", 1), is(true));
        assertThat(containsNode(root, "charWrapperField", testCommandObject.getCharWrapperField(), 1), is(true));
        assertThat(containsNode(root, "complexField", testCommandObject.getComplexField(), 1), is(true));
        assertThat(containsNode(root, "complexListField", testCommandObject.getComplexListField(), 1), is(true));
        assertThat(containsNode(root, "doubleField", "", 1), is(true));
        assertThat(containsNode(root, "doubleWrapperField", testCommandObject.getDoubleWrapperField(), 1), is(true));
        assertThat(containsNode(root, "enumField", testCommandObject.getEnumField(), 1), is(true));
        assertThat(containsNode(root, "floatField", "", 1), is(true));
        assertThat(containsNode(root, "floatWrapperField", testCommandObject.getFloatWrapperField(), 1), is(true));
        assertThat(containsNode(root, "intField", "", 1), is(true));
        assertThat(containsNode(root, "intWrapperField", testCommandObject.getIntWrapperField(), 1), is(true));
        assertThat(containsNode(root, "intWrapperListField", testCommandObject.getIntWrapperListField(), 1), is(true));
        assertThat(containsNode(root, "longField", "", 1), is(true));
        assertThat(containsNode(root, "longWrapperField", testCommandObject.getLongWrapperField(), 1), is(true));
        assertThat(containsNode(root, "nullComplexField", testCommandObject.getNullComplexField(), 1), is(true));
        assertThat(containsNode(root, "shortField", "", 1), is(true));
        assertThat(containsNode(root, "shortWrapperField", testCommandObject.getShortWrapperField(), 1), is(true));
        assertThat(containsNode(root, "stringField", testCommandObject.getStringField(), 1), is(true));
        ExampleComplexClass listComplexClass = testCommandObject.getComplexListField().get(0);
        assertThat(containsNode(root, "ExampleComplexClass", listComplexClass, 2), is(true));
        assertThat(containsNode(root, "intWrapperField", listComplexClass.getIntWrapperField(), 3), is(true));
        assertThat(containsNode(root, "doubleWrapperField", listComplexClass.getDoubleWrapperField(), 3), is(true));
        ExampleComplexClass complexClass = testCommandObject.getComplexField();
        assertThat(containsNode(root, "intWrapperField", complexClass.getIntWrapperField(), 2), is(true));
        assertThat(containsNode(root, "doubleWrapperField", complexClass.getDoubleWrapperField(), 2), is(true));
        List<Integer> intList = testCommandObject.getIntWrapperListField();
        assertThat(containsNode(root, "Integer", intList.get(0), 2), is(true));
        assertThat(containsNode(root, "Integer", intList.get(1), 2), is(true));
        assertThat(containsNode(root, "Integer", intList.get(2), 2), is(true));
        assertThat(containsNode(root, "serialVersionUID", testCommandObject.getSerialVersionUID(), 1), is(false));
        assertThat(containsNode(root, "stringTransientField", testCommandObject.getStringTransientField(), 1), 
                is(false));
    }
@ Test public void testGetTree ( ) throws ReflectionsUtilException { ExampleClass testCommandObject = new ExampleClass ( ) ; UUID assetUuid = UUID . randomUUID ( ) ; TreeNode root = m_SUT . getTree ( assetUuid , testCommandObject ) ; assertThat ( containsNode ( root , "boolField" , "" , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "boolWrapperField" , testCommandObject . isBoolWrapperField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "byteField" , "" , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "byteWrapperField" , testCommandObject . getByteWrapperField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "charField" , "" , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "charWrapperField" , testCommandObject . getCharWrapperField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "complexField" , testCommandObject . getComplexField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "complexListField" , testCommandObject . getComplexListField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "doubleField" , "" , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "doubleWrapperField" , testCommandObject . getDoubleWrapperField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "enumField" , testCommandObject . getEnumField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "floatField" , "" , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "floatWrapperField" , testCommandObject . getFloatWrapperField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "intField" , "" , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "intWrapperField" , testCommandObject . getIntWrapperField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "intWrapperListField" , testCommandObject . getIntWrapperListField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "longField" , "" , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "longWrapperField" , testCommandObject . getLongWrapperField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "nullComplexField" , testCommandObject . getNullComplexField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "shortField" , "" , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "shortWrapperField" , testCommandObject . getShortWrapperField ( ) , 1 ) , is ( true ) ) ; assertThat ( containsNode ( root , "stringField" , testCommandObject . getStringField ( ) , 1 ) , is ( true ) ) ; ExampleComplexClass listComplexClass = testCommandObject . getComplexListField ( ) . get ( 0 ) ; assertThat ( containsNode ( root , "ExampleComplexClass" , listComplexClass , 2 ) , is ( true ) ) ; assertThat ( containsNode ( root , "intWrapperField" , listComplexClass . getIntWrapperField ( ) , 3 ) , is ( true ) ) ; assertThat ( containsNode ( root , "doubleWrapperField" , listComplexClass . getDoubleWrapperField ( ) , 3 ) , is ( true ) ) ; ExampleComplexClass complexClass = testCommandObject . getComplexField ( ) ; assertThat ( containsNode ( root , "intWrapperField" , complexClass . getIntWrapperField ( ) , 2 ) , is ( true ) ) ; assertThat ( containsNode ( root , "doubleWrapperField" , complexClass . getDoubleWrapperField ( ) , 2 ) , is ( true ) ) ; List < Integer > intList = testCommandObject . getIntWrapperListField ( ) ; assertThat ( containsNode ( root , "Integer" , intList . get ( 0 ) , 2 ) , is ( true ) ) ; assertThat ( containsNode ( root , "Integer" , intList . get ( 1 ) , 2 ) , is ( true ) ) ; assertThat ( containsNode ( root , "Integer" , intList . get ( 2 ) , 2 ) , is ( true ) ) ; assertThat ( containsNode ( root , "serialVersionUID" , testCommandObject . getSerialVersionUID ( ) , 1 ) , is ( false ) ) ; assertThat ( containsNode ( root , "stringTransientField" , testCommandObject . getStringTransientField ( ) , 1 ) , is ( false ) ) ; }
Test the get tree method.
Test the get tree method .
//Verify tree contains appropriate nodes. //Verify that the serialVersionUID field did not get put in the tree.