public void testIsValueComposite() throws Exception
{
String[] itemNames = new String[] { "name1", "name2" };
String[] itemDescriptions = new String[] { "desc1", "desc2" };
MetaType[] itemTypes = new MetaType[] { SimpleMetaType.STRING, SimpleMetaType.INTEGER };
CompositeMetaType compositeType = new ImmutableCompositeMetaType("typeName", "description", itemNames, itemDescriptions, itemTypes);
MockCompositeValue cv = new MockCompositeValue(compositeType);
MockCompositeValue[][] compData1 = new MockCompositeValue[][]
{
{ cv, null }, { cv, cv }
};
ArrayMetaType compArrayType1 = new ArrayMetaType(2, compositeType);
assertTrue("compData1 should be a value of array type", compArrayType1.isValue(compData1));
ArrayMetaType compArrayType2 = new ArrayMetaType(1, compositeType);
assertFalse("compData1 should not be a value of array type, wrong dimension", compArrayType2.isValue(compData1));
CompositeMetaType compositeType2 = new ImmutableCompositeMetaType("typeName2", "description", itemNames, itemDescriptions, itemTypes);
ArrayMetaType compArrayType3 = new ArrayMetaType(2, compositeType2);
assertFalse("compData1 should not be a value of array type, wrong element type", compArrayType3.isValue(compData1));
}