use of org.apache.gobblin.converter.json.JsonSchema in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithRecordOfEnum.
@Test
public void schemaWithRecordOfEnum() throws Exception {
String testName = "schemaWithRecordOfEnum";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
RecordConverter converter = new RecordConverter(new JsonSchema(schema), state, buildNamespace(state.getExtract().getNamespace(), "something"));
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
use of org.apache.gobblin.converter.json.JsonSchema in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithRecordOfRecord.
@Test
public void schemaWithRecordOfRecord() throws Exception {
String testName = "schemaWithRecordOfRecord";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
RecordConverter converter = new RecordConverter(new JsonSchema(schema), state, buildNamespace(state.getExtract().getNamespace(), "something"));
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
use of org.apache.gobblin.converter.json.JsonSchema in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithMapOfArrays.
@Test
public void schemaWithMapOfArrays() throws Exception {
String testName = "schemaWithMapOfArrays";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
MapConverter converter = new MapConverter(new JsonSchema(schema), state);
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
use of org.apache.gobblin.converter.json.JsonSchema in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithRecord.
@Test
public void schemaWithRecord() throws DataConversionException, SchemaConversionException, UnsupportedDateTypeException {
String testName = "schemaWithRecord";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
JsonSchema jsonSchema = new JsonSchema(schema);
jsonSchema.setColumnName("dummy1");
RecordConverter converter = new RecordConverter(jsonSchema, state, buildNamespace(state.getExtract().getNamespace(), "something"));
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
use of org.apache.gobblin.converter.json.JsonSchema in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithUnion.
@Test
public void schemaWithUnion() throws Exception {
String testName = "schemaWithUnion";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonArray expected = getExpectedSchema(testName).getAsJsonArray();
UnionConverter converter = new UnionConverter(new JsonSchema(schema), state);
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
Aggregations