@Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = "Symbol .* does not belong to set \\[.*?\\]") public void testEnumTypeBelongsToEnumSet() throws Exception { JsonObject test = testCases.get("enum").getAsJsonObject(); parquetConverter = new JsonIntermediateToParquetGroupConverter(); MessageType schema = parquetConverter.convertSchema(test.get("schema").getAsJsonArray(), workUnit); JsonObject jsonRecord = test.get("record").getAsJsonObject(); jsonRecord.addProperty("some_enum", "HELL"); parquetConverter.convertRecord(schema, jsonRecord, workUnit).iterator().next(); }
private void testCase(String testCaseName) throws SchemaConversionException, DataConversionException { JsonObject test = testCases.get(testCaseName).getAsJsonObject(); parquetConverter = new JsonIntermediateToParquetGroupConverter(); MessageType schema = parquetConverter.convertSchema(test.get("schema").getAsJsonArray(), workUnit); Group record = parquetConverter.convertRecord(schema, test.get("record").getAsJsonObject(), workUnit).iterator().next(); assertEqualsIgnoreSpaces(schema.toString(), test.get("expectedSchema").getAsString()); assertEqualsIgnoreSpaces(record.toString(), test.get("expectedRecord").getAsString()); }