private void runCase(File dir) throws Exception { Schema schema = Schema.parse(new File(dir, "input.avsc")); List<Object> data = fromJson(schema, new File(dir, "input.json")); // write full data AvroColumnWriter<Object> writer = new AvroColumnWriter<>(schema, new ColumnFileMetaData()); for (Object datum : data) writer.write(datum); writer.writeTo(FILE); // test that the full schema reads correctly checkRead(schema, data); // test that sub-schemas read correctly for (File f : dir.listFiles()) if (f.isDirectory() && !f.getName().startsWith(".")) { Schema s = Schema.parse(new File(f, "sub.avsc")); checkRead(s, fromJson(s, new File(f, "sub.json"))); } }
@Test public void testCases() throws Exception { for (File f : DIR.listFiles()) if (f.isDirectory() && !f.getName().startsWith(".")) runCase(f); }
private void runCase(File dir) throws Exception { Schema schema = Schema.parse(new File(dir, "input.avsc")); List<Object> data = fromJson(schema, new File(dir, "input.json")); // write full data AvroColumnWriter<Object> writer = new AvroColumnWriter<Object>(schema, new ColumnFileMetaData()); for (Object datum : data) writer.write(datum); writer.writeTo(FILE); // test that the full schema reads correctly checkRead(schema, data); // test that sub-schemas read correctly for (File f : dir.listFiles()) if (f.isDirectory()) { Schema s = Schema.parse(new File(f, "sub.avsc")); checkRead(s, fromJson(s, new File(f, "sub.json"))); } }
@Test public void testCases() throws Exception { for (File f : DIR.listFiles()) if (f.isDirectory()) runCase(f); }