From 65d1372bafb62f0d7f8c939f876e24e4b02e75ae Mon Sep 17 00:00:00 2001 From: radai-rosenblatt Date: Mon, 5 Sep 2016 15:28:56 -0700 Subject: [PATCH] fix test breakage in ipc after changes to SpecificCompiler Signed-off-by: radai-rosenblatt --- .../org/apache/avro/compiler/specific/SpecificCompiler.java | 3 ++- .../apache/avro/compiler/specific/TestSpecificCompiler.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java b/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java index d1b594f79f5..295949313d1 100644 --- a/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java +++ b/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java @@ -406,7 +406,8 @@ OutputFile compileInterface(Protocol protocol) { return outputFile; } - private String makePath(String name, String space) { + //package private for testing purposes + String makePath(String name, String space) { if (space == null || space.isEmpty()) { return name + suffix; } else { diff --git a/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java b/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java index 7710be8ac21..28aa9981a34 100644 --- a/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java +++ b/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java @@ -79,8 +79,9 @@ public void testEsc() { @Test public void testMakePath() { - assertEquals("foo/bar/Baz.java".replace("/", File.separator), SpecificCompiler.makePath("Baz", "foo.bar")); - assertEquals("baz.java", SpecificCompiler.makePath("baz", "")); + SpecificCompiler compiler = new SpecificCompiler(); + assertEquals("foo/bar/Baz.java".replace("/", File.separator), compiler.makePath("Baz", "foo.bar")); + assertEquals("baz.java", compiler.makePath("baz", "")); } @Test