"{ \"type\" : \"record\", \"name\" : \"foo\", \"fields\" : " +
"[ { \"name\" : \"bar\", \"type\" : { \"type\" : \"array\", \"items\" : \"int\" } } ] }";
Object inputs[][] =
{
{ new DataList(asList("1")), new DataList(asList(1)) },
{ new DataList(asList("1", "2", "3")), new DataList(asList(1, 2, 3)) },
{ new DataList(), new DataList() },
{ new DataList(asList(1)), new DataList(asList(1)) },
{ new DataList(asList(2, 3)), new DataList(asList(2, 3)) },
{ new DataList(asList(1L)), new DataList(asList(1)) },
{ new DataList(asList(1.0f)), new DataList(asList(1)) },
{ new DataList(asList(1.0)), new DataList(asList(1)) }
};
Object badObjects[] =
{
new Boolean(true),
new Integer(1),
new Long(1),
new Float(1),
new Double(1),
new String(),
new DataMap(),
new DataList(asList(new Boolean(true))),
new DataList(asList(new DataMap())),
new DataList(asList(new DataList())),
new DataList(asList(new Boolean(true), new Integer(1))),
new DataList(asList(new Integer(1), new Boolean(true)))
};
testStringToPrimitiveCoercionValidation(schemaText, "bar", inputs, badObjects);
}