CompositeValue compData = initCompositeValue(tableType.getRowType());
CompositeValue compData2 = initCompositeValue2(initCompositeMetaType2());
try
{
new TableValueSupport(null);
fail("Expected IllegalArgumentException for null tabular type");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new TableValueSupport(null, 10, .5f);
fail("Expected IllegalArgumentException for null tabular type");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new TableValueSupport(tableType, -1, .5f);
fail("Expected IllegalArgumentException for negative initial capacity");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new TableValueSupport(tableType, 10, 0f);
fail("Expected IllegalArgumentException for zero load factor");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
new TableValueSupport(tableType, 10, -0.5f);
fail("Expected IllegalArgumentException for negative load factor");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
data.calculateIndex(null);
fail("Expected IllegalArgumentException for calculate index on null object");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
data.calculateIndex(compData2);
fail("Expected IllegalArgumentException for calculate index on wrong composite type");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
data.get((MetaValue[]) null);
fail("Expected IllegalArgumentException for get(null)");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
data.get(new MetaValue[] { initStringWrong() });
fail("Expected IllegalArgumentException for get(wrong)");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
data.put(null);
fail("Expected IllegalArgumentException for put(CompositeValue) with null value");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
data.put(compData2);
fail("Expected IllegalArgumentException for put(CompositeValue) with wrong CompositeType");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
data.put(compData);
data.put(compData);
fail("Expected IllegalArgumentException for put(CompositeValue)");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
data.remove((MetaValue[]) null);
fail("Expected IllegalArgumentException for remove(null)");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
data.remove(new MetaValue[] { initStringWrong() });
fail("Expected IllegalArgumentException for remove(wrong)");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
CompositeValue[] toPut = new CompositeValue[] { compData, null };
data.putAll(toPut);
fail("Expected IllegalArgumentException for putAll(CompositeValue[]) null");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
CompositeValue[] toPut = new CompositeValue[] { compData, compData2 };
data.putAll(toPut);
fail("Expected IllegalArgumentException for putAll(CompositeValue[]) wrong composite type");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
CompositeValue[] toPut = new CompositeValue[] { compData, compData };
data.putAll(toPut);
fail("Expected IllegalArgumentException for putAll(CompositeValue[]) with duplicate data");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);
}
try
{
TableValueSupport data = new TableValueSupport(tableType);
CompositeValue[] toPut = new CompositeValue[] { compData };
data.putAll(toPut);
data.putAll(toPut);
fail("Expected IllegalArgumentException for putAll(CompositeValue[]) adding a duplicate");
}
catch (Throwable t)
{
checkThrowable(IllegalArgumentException.class, t);