mil.dod.th.ose.shared/test/mil/dod/th/ose/shared/TestSharedMessageUtils.java
@Test 
    public void testConvertListSimpleTypesMapEntrytoMap()
    {
        //Create a list of map entries
        SimpleTypesMapEntry testEntry1 = SimpleTypesMapEntry.newBuilder().setKey("something").
                setValue(Multitype.newBuilder().setType(Type.STRING).setStringValue("test1")).build();
 
        SimpleTypesMapEntry testEntry2 = SimpleTypesMapEntry.newBuilder().setKey("something2").
                setValue(Multitype.newBuilder().setType(Type.STRING).setStringValue("test2")).build();
        
        List<SimpleTypesMapEntry> testList = new ArrayList<SimpleTypesMapEntry>();   
        testList.add(testEntry1);
        testList.add(testEntry2);
        
        //convert the map list to dictionary object
        Map<String, String> convertedMap = SharedMessageUtils.convertListSimpleTypesMapEntrytoMap(testList);

        //verify values
        assertThat(testList.get(0).getValue().getStringValue(), is(convertedMap.get("something"))); 
        assertThat(testList.get(1).getValue().getStringValue(), is(convertedMap.get("something2"))); 
    }
/**
     * Test and verify that a list of SimpleTypesMapEntry is properly converted to a Java native type Map object
     */
Test and verify that a list of SimpleTypesMapEntry is properly converted to a Java native type Map object
Test and verify that a list of SimpleTypesMapEntry is properly converted to a Java native type Map object
@Test 
    public void testConvertListSimpleTypesMapEntrytoMap()
    {
        SimpleTypesMapEntry testEntry1 = SimpleTypesMapEntry.newBuilder().setKey("something").
                setValue(Multitype.newBuilder().setType(Type.STRING).setStringValue("test1")).build();
        SimpleTypesMapEntry testEntry2 = SimpleTypesMapEntry.newBuilder().setKey("something2").
                setValue(Multitype.newBuilder().setType(Type.STRING).setStringValue("test2")).build();
        List<SimpleTypesMapEntry> testList = new ArrayList<SimpleTypesMapEntry>();   
        testList.add(testEntry1);
        testList.add(testEntry2);
        Map<String, String> convertedMap = SharedMessageUtils.convertListSimpleTypesMapEntrytoMap(testList);
        assertThat(testList.get(0).getValue().getStringValue(), is(convertedMap.get("something"))); 
        assertThat(testList.get(1).getValue().getStringValue(), is(convertedMap.get("something2"))); 
    }
@ Test public void testConvertListSimpleTypesMapEntrytoMap ( ) { SimpleTypesMapEntry testEntry1 = SimpleTypesMapEntry . newBuilder ( ) . setKey ( "something" ) . setValue ( Multitype . newBuilder ( ) . setType ( Type . STRING ) . setStringValue ( "test1" ) ) . build ( ) ; SimpleTypesMapEntry testEntry2 = SimpleTypesMapEntry . newBuilder ( ) . setKey ( "something2" ) . setValue ( Multitype . newBuilder ( ) . setType ( Type . STRING ) . setStringValue ( "test2" ) ) . build ( ) ; List < SimpleTypesMapEntry > testList = new ArrayList < SimpleTypesMapEntry > ( ) ; testList . add ( testEntry1 ) ; testList . add ( testEntry2 ) ; Map < String , String > convertedMap = SharedMessageUtils . convertListSimpleTypesMapEntrytoMap ( testList ) ; assertThat ( testList . get ( 0 ) . getValue ( ) . getStringValue ( ) , is ( convertedMap . get ( "something" ) ) ) ; assertThat ( testList . get ( 1 ) . getValue ( ) . getStringValue ( ) , is ( convertedMap . get ( "something2" ) ) ) ; }
Test and verify that a list of SimpleTypesMapEntry is properly converted to a Java native type Map object
Test and verify that a list of SimpleTypesMapEntry is properly converted to a Java native type Map object
//Create a list of map entries //convert the map list to dictionary object //verify values