mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/util/TestRemotePropertyConverter.java
@Test
    public void testComplexTypesMapToMap() throws Exception
    {
        List<ComplexTypesMapEntry> entries = new ArrayList<ComplexTypesMapEntry>();

        entries.add(ComplexTypesMapEntry.newBuilder().setKey("test").setMulti(Multitype.newBuilder().
                setType(Type.STRING).
                setStringValue("blah").build()).
                build());
        
        entries.add(ComplexTypesMapEntry.newBuilder().setKey("prop2").setMulti(Multitype.newBuilder().
                setType(Type.INT32).
                setInt32Value(28).build()).
                build());

        entries.add(ComplexTypesMapEntry.newBuilder().setKey("prop3").
                setLinkLayerStatus(CustomCommsTypes.LinkStatus.OK).build());
        
        entries.add(ComplexTypesMapEntry.newBuilder().setKey("prop4").
                setProgramStatus(MissionStatus.EXECUTED).build());
        
        entries.add(ComplexTypesMapEntry.newBuilder().setKey("prop5").
                setProgramTestResult(MissionTestResult.PASSED).build());

        List<String> strings = new ArrayList<String>();
        strings.add("String");
        strings.add("String2");

        entries.add(ComplexTypesMapEntry.newBuilder().
             setKey("prop6").
             setMulti(SharedMessageUtils.convertObjectToMultitype(strings)).build());
        
        entries.add(ComplexTypesMapEntry.newBuilder().setKey("prop7").
                setSummaryStatus(SummaryStatusEnumConverter.convertJavaEnumToProto(SummaryStatusEnum.UNKNOWN))
                .build());
        
        //create a map from the list of proto properties
        Map<String, Object> map = m_SUT.complexTypesMapToMap(entries);

        assertThat(map.size(), is(7));
        
        //verify values
        assertThat(map, rawMapHasEntry("test", "blah"));
        assertThat(map, rawMapHasEntry("prop2", 28));
        assertThat(map, rawMapHasEntry("prop3", LinkStatus.OK));
        assertThat(map, rawMapHasEntry("prop4", ProgramStatus.EXECUTED));
        assertThat(map, rawMapHasEntry("prop5", TestResult.PASSED));
        assertThat(map, rawMapHasEntry("prop6", strings));
        assertThat(map, rawMapHasEntry("prop7", SummaryStatusEnum.UNKNOWN));
    }
/**
     * Test creating a property map from protocol buffer message event properties.
     */
Test creating a property map from protocol buffer message event properties.
Test creating a property map from protocol buffer message event properties .
@Test
    public void testComplexTypesMapToMap() throws Exception
    {
        List<ComplexTypesMapEntry> entries = new ArrayList<ComplexTypesMapEntry>();
        entries.add(ComplexTypesMapEntry.newBuilder().setKey("test").setMulti(Multitype.newBuilder().
                setType(Type.STRING).
                setStringValue("blah").build()).
                build());
        entries.add(ComplexTypesMapEntry.newBuilder().setKey("prop2").setMulti(Multitype.newBuilder().
                setType(Type.INT32).
                setInt32Value(28).build()).
                build());
        entries.add(ComplexTypesMapEntry.newBuilder().setKey("prop3").
                setLinkLayerStatus(CustomCommsTypes.LinkStatus.OK).build());
        entries.add(ComplexTypesMapEntry.newBuilder().setKey("prop4").
                setProgramStatus(MissionStatus.EXECUTED).build());
        entries.add(ComplexTypesMapEntry.newBuilder().setKey("prop5").
                setProgramTestResult(MissionTestResult.PASSED).build());
        List<String> strings = new ArrayList<String>();
        strings.add("String");
        strings.add("String2");
        entries.add(ComplexTypesMapEntry.newBuilder().
             setKey("prop6").
             setMulti(SharedMessageUtils.convertObjectToMultitype(strings)).build());
        entries.add(ComplexTypesMapEntry.newBuilder().setKey("prop7").
                setSummaryStatus(SummaryStatusEnumConverter.convertJavaEnumToProto(SummaryStatusEnum.UNKNOWN))
                .build());
        Map<String, Object> map = m_SUT.complexTypesMapToMap(entries);
        assertThat(map.size(), is(7));
        assertThat(map, rawMapHasEntry("test", "blah"));
        assertThat(map, rawMapHasEntry("prop2", 28));
        assertThat(map, rawMapHasEntry("prop3", LinkStatus.OK));
        assertThat(map, rawMapHasEntry("prop4", ProgramStatus.EXECUTED));
        assertThat(map, rawMapHasEntry("prop5", TestResult.PASSED));
        assertThat(map, rawMapHasEntry("prop6", strings));
        assertThat(map, rawMapHasEntry("prop7", SummaryStatusEnum.UNKNOWN));
    }
@ Test public void testComplexTypesMapToMap ( ) throws Exception { List < ComplexTypesMapEntry > entries = new ArrayList < ComplexTypesMapEntry > ( ) ; entries . add ( ComplexTypesMapEntry . newBuilder ( ) . setKey ( "test" ) . setMulti ( Multitype . newBuilder ( ) . setType ( Type . STRING ) . setStringValue ( "blah" ) . build ( ) ) . build ( ) ) ; entries . add ( ComplexTypesMapEntry . newBuilder ( ) . setKey ( "prop2" ) . setMulti ( Multitype . newBuilder ( ) . setType ( Type . INT32 ) . setInt32Value ( 28 ) . build ( ) ) . build ( ) ) ; entries . add ( ComplexTypesMapEntry . newBuilder ( ) . setKey ( "prop3" ) . setLinkLayerStatus ( CustomCommsTypes . LinkStatus . OK ) . build ( ) ) ; entries . add ( ComplexTypesMapEntry . newBuilder ( ) . setKey ( "prop4" ) . setProgramStatus ( MissionStatus . EXECUTED ) . build ( ) ) ; entries . add ( ComplexTypesMapEntry . newBuilder ( ) . setKey ( "prop5" ) . setProgramTestResult ( MissionTestResult . PASSED ) . build ( ) ) ; List < String > strings = new ArrayList < String > ( ) ; strings . add ( "String" ) ; strings . add ( "String2" ) ; entries . add ( ComplexTypesMapEntry . newBuilder ( ) . setKey ( "prop6" ) . setMulti ( SharedMessageUtils . convertObjectToMultitype ( strings ) ) . build ( ) ) ; entries . add ( ComplexTypesMapEntry . newBuilder ( ) . setKey ( "prop7" ) . setSummaryStatus ( SummaryStatusEnumConverter . convertJavaEnumToProto ( SummaryStatusEnum . UNKNOWN ) ) . build ( ) ) ; Map < String , Object > map = m_SUT . complexTypesMapToMap ( entries ) ; assertThat ( map . size ( ) , is ( 7 ) ) ; assertThat ( map , rawMapHasEntry ( "test" , "blah" ) ) ; assertThat ( map , rawMapHasEntry ( "prop2" , 28 ) ) ; assertThat ( map , rawMapHasEntry ( "prop3" , LinkStatus . OK ) ) ; assertThat ( map , rawMapHasEntry ( "prop4" , ProgramStatus . EXECUTED ) ) ; assertThat ( map , rawMapHasEntry ( "prop5" , TestResult . PASSED ) ) ; assertThat ( map , rawMapHasEntry ( "prop6" , strings ) ) ; assertThat ( map , rawMapHasEntry ( "prop7" , SummaryStatusEnum . UNKNOWN ) ) ; }
Test creating a property map from protocol buffer message event properties.
Test creating a property map from protocol buffer message event properties .
//create a map from the list of proto properties //verify values