I would update the test to this:
| public Map<String, String> compositeSignature;
|
| public void testMapComposite() throws Exception
| {
| Field field = getClass().getField("compositeSignature");
| Type mapSignature = field.getGenericType();
| CompositeMetaType result = assertInstanceOf(resolve(mapSignature),
CompositeMetaType.class);
| MutableCompositeMetaType expected = new
MutableCompositeMetaType(HashMap.class.getName(),
"HashMap<String,String>");
| expected.addItem("key1", "key1", SimpleMetaType.STRING);
| expected.addItem("key2", "key2", SimpleMetaType.STRING);
| expected.addItem("key3", "key3", SimpleMetaType.STRING);
| expected.freeze();
|
| testComposite(expected, result);
|
| String[] itemNames = {"key1", "key2", "key3"};
| MetaValue[] itemValues = {SimpleValueSupport.wrap("value1"),
SimpleValueSupport.wrap("value3"),
SimpleValueSupport.wrap("value3")};
| CompositeValueSupport mapValue = new CompositeValueSupport(expected, itemNames,
itemValues);
| assertEquals("value1", mapValue.get("key1"));
| }
|
Your test will never work, since:
| new HashMap<String,String>().getClass()
|
will just return the erased type, not the generic type.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131470#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...