String[] itemDescriptions = new String[] { "desc1", "desc2" };
MetaType[] itemTypes = new MetaType[] { SimpleMetaType.STRING, SimpleMetaType.INTEGER };
try
{
new ImmutableCompositeMetaType(null, "description", itemNames, itemDescriptions, itemTypes);
fail("Excepted IllegalArgumentException for null typeName");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableCompositeMetaType("", "description", itemNames, itemDescriptions, itemTypes);
fail("Excepted IllegalArgumentException for empty typeName");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableCompositeMetaType("typeName", null, itemNames, itemDescriptions, itemTypes);
fail("Excepted IllegalArgumentException for null description");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableCompositeMetaType("typeName", "", itemNames, itemDescriptions, itemTypes);
fail("Excepted IllegalArgumentException for empty description");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableCompositeMetaType("typeName", "description", null, itemDescriptions, itemTypes);
fail("Excepted IllegalArgumentException for null item names");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableCompositeMetaType("typeName", "description", itemNames, null, itemTypes);
fail("Excepted IllegalArgumentException for null item descriptions");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableCompositeMetaType("typeName", "description", itemNames, itemDescriptions, null);
fail("Excepted IllegalArgumentException for null item types");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
String[] nullItemNames = new String[] { "name1", null };
try
{
new ImmutableCompositeMetaType("typeName", "description", nullItemNames, itemDescriptions, itemTypes);
fail("Excepted IllegalArgumentException for null element of item names");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
String[] nullItemDescriptions = new String[] { "desc1", null };
try
{
new ImmutableCompositeMetaType("typeName", "description", itemNames, nullItemDescriptions, itemTypes);
fail("Excepted IllegalArgumentException for null element of item descriptions");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
MetaType[] nullItemTypes = new MetaType[] { SimpleMetaType.STRING, null };
try
{
new ImmutableCompositeMetaType("typeName", "description", itemNames, itemDescriptions, nullItemTypes);
fail("Excepted IllegalArgumentException for null element of item types");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
String[] wrongItemNames = new String[] { "name1" };
try
{
new ImmutableCompositeMetaType("typeName", "description", wrongItemNames, itemDescriptions, itemTypes);
fail("Excepted IllegalArgumentException for wrong number of elements for item names");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
String[] wrongItemDescriptions = new String[] { "desc1"};
try
{
new ImmutableCompositeMetaType("typeName", "description", itemNames, wrongItemDescriptions, itemTypes);
fail("Excepted IllegalArgumentException for wrong number of elements for item descriptions");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
MetaType[] wrongItemTypes = new MetaType[] { SimpleMetaType.STRING };
try
{
new ImmutableCompositeMetaType("typeName", "description", itemNames, itemDescriptions, wrongItemTypes);
fail("Excepted IllegalArgumentException for wrong number of elements for item types");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
String[] duplicateItemNames = new String[] { "desc1", "desc1" };
try
{
new ImmutableCompositeMetaType("typeName", "description", duplicateItemNames, itemDescriptions, itemTypes);
fail("Excepted OpenDataException for duplicate item names");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
duplicateItemNames = new String[] { "desc1", " desc1 " };
try
{
new ImmutableCompositeMetaType("typeName", "description", duplicateItemNames, itemDescriptions, itemTypes);
fail("Excepted OpenDataException for duplicate item names");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);