mil.dod.th.ose.shared/test/mil/dod/th/ose/shared/TestSharedMessageUtils.java
@Test
    public void testConvertDictionarytoMap()
    {
        Dictionary<String, Object> testDictionary = new Hashtable<String, Object>();
        testDictionary.put("testKey", "testValue");
        
        UUID uuid = UUID.randomUUID() ;
        testDictionary.put("testKey1", uuid );
        
        Byte byteTest = Byte.valueOf("100");
        testDictionary.put("testKey2", byteTest );
        
        String stringChar = "test";
        Character charTest = stringChar.charAt(0);
        testDictionary.put("testKey3", charTest );
        
        Boolean boolTest = false ;
        testDictionary.put("testKey4", boolTest);

        testDictionary.put("testKey5", 2);
        
        List<SimpleTypesMapEntry> listTest = SharedMessageUtils.convertDictionarytoMap(testDictionary);
        Dictionary<String, Multitype> entryMap = new Hashtable<String, Multitype>();
        
        for (SimpleTypesMapEntry entry:listTest)        
        {
            entryMap.put(entry.getKey(), entry.getValue());
        }

        assertThat(entryMap.get("testKey").getStringValue(),is("testValue"));
        assertThat(entryMap.get("testKey1").getUuidMostSigBitsValue(), is(uuid.getMostSignificantBits()));
        assertThat(entryMap.get("testKey2").getByteValue(), is(100));
        assertThat(entryMap.get("testKey3").getCharValue(), is("t"));
        assertThat(entryMap.get("testKey4").getBoolValue(), is(false));
        assertThat(entryMap.get("testKey5").getInt32Value(), is(2));
    }
/**
     * Test and verify that a Java native type Dictionary object is properly converted to a list of SimpleTypesMapEntry.
     */
Test and verify that a Java native type Dictionary object is properly converted to a list of SimpleTypesMapEntry.
Test and verify that a Java native type Dictionary object is properly converted to a list of SimpleTypesMapEntry .
@Test
    public void testConvertDictionarytoMap()
    {
        Dictionary<String, Object> testDictionary = new Hashtable<String, Object>();
        testDictionary.put("testKey", "testValue");
        UUID uuid = UUID.randomUUID() ;
        testDictionary.put("testKey1", uuid );
        Byte byteTest = Byte.valueOf("100");
        testDictionary.put("testKey2", byteTest );
        String stringChar = "test";
        Character charTest = stringChar.charAt(0);
        testDictionary.put("testKey3", charTest );
        Boolean boolTest = false ;
        testDictionary.put("testKey4", boolTest);
        testDictionary.put("testKey5", 2);
        List<SimpleTypesMapEntry> listTest = SharedMessageUtils.convertDictionarytoMap(testDictionary);
        Dictionary<String, Multitype> entryMap = new Hashtable<String, Multitype>();
        for (SimpleTypesMapEntry entry:listTest)        
        {
            entryMap.put(entry.getKey(), entry.getValue());
        }
        assertThat(entryMap.get("testKey").getStringValue(),is("testValue"));
        assertThat(entryMap.get("testKey1").getUuidMostSigBitsValue(), is(uuid.getMostSignificantBits()));
        assertThat(entryMap.get("testKey2").getByteValue(), is(100));
        assertThat(entryMap.get("testKey3").getCharValue(), is("t"));
        assertThat(entryMap.get("testKey4").getBoolValue(), is(false));
        assertThat(entryMap.get("testKey5").getInt32Value(), is(2));
    }
@ Test public void testConvertDictionarytoMap ( ) { Dictionary < String , Object > testDictionary = new Hashtable < String , Object > ( ) ; testDictionary . put ( "testKey" , "testValue" ) ; UUID uuid = UUID . randomUUID ( ) ; testDictionary . put ( "testKey1" , uuid ) ; Byte byteTest = Byte . valueOf ( "100" ) ; testDictionary . put ( "testKey2" , byteTest ) ; String stringChar = "test" ; Character charTest = stringChar . charAt ( 0 ) ; testDictionary . put ( "testKey3" , charTest ) ; Boolean boolTest = false ; testDictionary . put ( "testKey4" , boolTest ) ; testDictionary . put ( "testKey5" , 2 ) ; List < SimpleTypesMapEntry > listTest = SharedMessageUtils . convertDictionarytoMap ( testDictionary ) ; Dictionary < String , Multitype > entryMap = new Hashtable < String , Multitype > ( ) ; for ( SimpleTypesMapEntry entry : listTest ) { entryMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } assertThat ( entryMap . get ( "testKey" ) . getStringValue ( ) , is ( "testValue" ) ) ; assertThat ( entryMap . get ( "testKey1" ) . getUuidMostSigBitsValue ( ) , is ( uuid . getMostSignificantBits ( ) ) ) ; assertThat ( entryMap . get ( "testKey2" ) . getByteValue ( ) , is ( 100 ) ) ; assertThat ( entryMap . get ( "testKey3" ) . getCharValue ( ) , is ( "t" ) ) ; assertThat ( entryMap . get ( "testKey4" ) . getBoolValue ( ) , is ( false ) ) ; assertThat ( entryMap . get ( "testKey5" ) . getInt32Value ( ) , is ( 2 ) ) ; }
Test and verify that a Java native type Dictionary object is properly converted to a list of SimpleTypesMapEntry.
Test and verify that a Java native type Dictionary object is properly converted to a list of SimpleTypesMapEntry .