}
@Test(dataProvider="dataElementFactories")
public void testDataElement(DataElementFactory factory) throws IOException
{
RecordDataSchema fooSchema = (RecordDataSchema) TestUtil.dataSchemaFromString(fooSchemaText);
ArrayDataSchema arraySchema = (ArrayDataSchema) fooSchema.getField("array").getType();
String fooText =
"{\n" +
" \"int\" : 34,\n" +
" \"string\" : \"abc\",\n" +
" \"array\" : [\n" +
" { \"int\" : 56 },\n" +
" { \"string\" : \"xyz\" },\n" +
" { \"array\" : [\n" +
" { \"int\" : 78 }\n" +
" ] }\n" +
" ]\n" +
"}\n";
DataMap foo = TestUtil.dataMapFromString(fooText);
DataElement root = factory.create(foo, DataElement.ROOT_NAME, fooSchema, null);
DataElement int1 = factory.create(foo.get("int"), "int", fooSchema.getField("int").getType(), root);
DataElement string1 = factory.create(foo.get("string"), "string", fooSchema.getField("string").getType(), root);
DataElement array1 = factory.create(foo.get("array"), "array", fooSchema.getField("array").getType(), root);
DataElement foo20 = factory.create(array1.getChild(0), 0, arraySchema.getItems(), array1);
DataElement foo21 = factory.create(array1.getChild(1), 1, arraySchema.getItems(), array1);
DataElement foo22 = factory.create(array1.getChild(2), 2, arraySchema.getItems(), array1);
DataElement int20 = factory.create(foo20.getChild("int"), "int", fooSchema.getField("int").getType(), foo20);
DataElement string21 = factory.create(foo21.getChild("string"), "string", fooSchema.getField("string").getType(), foo21);
DataElement array22 = factory.create(foo22.getChild("array"), "array", fooSchema.getField("array").getType(), foo22);
DataElement foo30 = factory.create(array22.getChild(0), 0, arraySchema.getItems(), array22);
DataElement int30 = factory.create(foo30.getChild("int"), "int", fooSchema.getField("int").getType(), foo30);
// test path
Object[][] testPathInput =
{