CompositeMetaType rowType = initRowType();
String[] indexNames = new String[] { "name1", "name2" };
try
{
new ImmutableTableMetaType(null, "description", rowType, indexNames);
fail("Expected IllegalArgumentException for null type name");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableTableMetaType("", "description", rowType, indexNames);
fail("Expected IllegalArgumentException for empty type name");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableTableMetaType("typeName", null, rowType, indexNames);
fail("Expected IllegalArgumentException for null description");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableTableMetaType("typeName", "", rowType, indexNames);
fail("Expected IllegalArgumentException for empty description");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableTableMetaType("typeName", "description", null, indexNames);
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableTableMetaType("typeName", "description", rowType, null);
fail("Expected IllegalArgumentException for null row type");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableTableMetaType("typeName", "description", rowType, new String[0]);
fail("Expected IllegalArgumentException for empty index names");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableTableMetaType("typeName", "description", rowType, new String[] { "name1", null });
fail("Expected IllegalArgumentException for null index name element");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableTableMetaType("typeName", "description", rowType, new String[] { "name1", "" });
fail("Expected IllegalArgumentException for empty index name element");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new ImmutableTableMetaType("typeName", "description", rowType, new String[] { "name1", "nameX" });
fail("Expected IllegalArgumentException for invalid index name");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);