rumeshkrish commented on a change in pull request #805:
URL: https://github.com/apache/avro/pull/805#discussion_r439811262
##########
File path:
lang/java/avro/src/test/java/org/apache/avro/TestSchemaNormalization.java
##########
@@ -60,6 +71,88 @@ public void testCanonicalization() throws Exception {
}
}
+ @RunWith(Parameterized.class)
+ public static class TestStandardCanonicalSchema {
+ String input, expectedOutput;
+
+ public TestStandardCanonicalSchema(String i, String o) {
+ input = i;
+ expectedOutput = o;
+ }
+
+ @Parameters
+ public static List<Object[]> cases() throws IOException {
+ return CaseFinder.find(data(STANDARD_CANONICAL_DATA_FILE), "canonical",
new ArrayList<>());
+ }
+
+ @Test
+ public void testCanonicalization() throws Exception {
+ assertEquals(SchemaNormalization.toCanonicalForm(new
Schema.Parser().parse(input)), expectedOutput);
+ }
+ }
+
+ @RunWith(Parameterized.class)
+ public static class TestCustomCanonicalSchema {
+ String input, expectedOutput;
+ LinkedHashSet<String> properties = new
LinkedHashSet<>(Arrays.asList("format"));
+
+ public TestCustomCanonicalSchema(String i, String o) {
+ input = i;
+ expectedOutput = o;
+ }
+
+ @Parameters
+ public static List<Object[]> cases() throws IOException {
+ return CaseFinder.find(data(CUSTOM_CANONICAL_DATA_FILE), "canonical",
new ArrayList<>());
+ }
+
+ @Test
+ public void testCanonicalization() throws Exception {
+ assertEquals(SchemaNormalization.toCanonicalForm(new
Schema.Parser().parse(input), properties), expectedOutput);
+ }
+ }
+
+ @RunWith(Parameterized.class)
Review comment:
duplicate class removed. Thanks @cutting .
##########
File path:
lang/java/avro/src/test/java/org/apache/avro/TestSchemaNormalization.java
##########
@@ -60,6 +71,88 @@ public void testCanonicalization() throws Exception {
}
}
+ @RunWith(Parameterized.class)
+ public static class TestStandardCanonicalSchema {
+ String input, expectedOutput;
+
+ public TestStandardCanonicalSchema(String i, String o) {
+ input = i;
+ expectedOutput = o;
+ }
+
+ @Parameters
+ public static List<Object[]> cases() throws IOException {
+ return CaseFinder.find(data(STANDARD_CANONICAL_DATA_FILE), "canonical",
new ArrayList<>());
+ }
+
+ @Test
+ public void testCanonicalization() throws Exception {
+ assertEquals(SchemaNormalization.toCanonicalForm(new
Schema.Parser().parse(input)), expectedOutput);
+ }
+ }
+
+ @RunWith(Parameterized.class)
+ public static class TestCustomCanonicalSchema {
+ String input, expectedOutput;
+ LinkedHashSet<String> properties = new
LinkedHashSet<>(Arrays.asList("format"));
+
+ public TestCustomCanonicalSchema(String i, String o) {
+ input = i;
+ expectedOutput = o;
+ }
+
+ @Parameters
+ public static List<Object[]> cases() throws IOException {
+ return CaseFinder.find(data(CUSTOM_CANONICAL_DATA_FILE), "canonical",
new ArrayList<>());
+ }
+
+ @Test
+ public void testCanonicalization() throws Exception {
+ assertEquals(SchemaNormalization.toCanonicalForm(new
Schema.Parser().parse(input), properties), expectedOutput);
+ }
+ }
+
+ @RunWith(Parameterized.class)
+ public static class TestStandardCanonicalSchema {
+ String input, expectedOutput;
+
+ public TestStandardCanonicalSchema(String i, String o) {
+ input = i;
+ expectedOutput = o;
+ }
+
+ @Parameters
+ public static List<Object[]> cases() throws IOException {
+ return CaseFinder.find(data(STANDARD_CANONICAL_DATA_FILE), "canonical",
new ArrayList<>());
+ }
+
+ @Test
+ public void testCanonicalization() throws Exception {
+ assertEquals(SchemaNormalization.toCanonicalForm(new
Schema.Parser().parse(input)), expectedOutput);
+ }
+ }
+
+ @RunWith(Parameterized.class)
Review comment:
duplicate class removed. Thanks @cutting .
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]