From ce79c8170a723e9e21407f891c92f2730e272f78 Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Wed, 15 Jun 2016 10:00:55 +0000 Subject: Make bazel test work on Windows bazel test now works for java native example tests, but most of Bazel's java_test still fail on Windows due to other reasons. -- Change-Id: Ie4ab6570b294815b9e06dd9bbd0cb7a48eb6ed11 Reviewed-on: https://bazel-review.googlesource.com/#/c/3810 MOS_MIGRATED_REVID=124932604 --- .../src/test/java/com/example/myproject/TestCustomGreeting.java | 4 ++-- .../java-native/src/test/java/com/example/myproject/TestHello.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/java-native/src/test/java/com/example/myproject/TestCustomGreeting.java b/examples/java-native/src/test/java/com/example/myproject/TestCustomGreeting.java index f14b7d234a..7bc55fc643 100644 --- a/examples/java-native/src/test/java/com/example/myproject/TestCustomGreeting.java +++ b/examples/java-native/src/test/java/com/example/myproject/TestCustomGreeting.java @@ -18,7 +18,7 @@ public class TestCustomGreeting { ByteArrayOutputStream out = new ByteArrayOutputStream(); Greeter.out = new PrintStream(out); Greeter.main(); - assertEquals("Bye world\n", new String(out.toByteArray(), StandardCharsets.UTF_8)); + assertEquals("Bye world", new String(out.toByteArray(), StandardCharsets.UTF_8).trim()); } @Test @@ -26,7 +26,7 @@ public class TestCustomGreeting { ByteArrayOutputStream out = new ByteArrayOutputStream(); Greeter.out = new PrintStream(out); Greeter.main("toto"); - assertEquals("Bye toto\n", new String(out.toByteArray(), StandardCharsets.UTF_8)); + assertEquals("Bye toto", new String(out.toByteArray(), StandardCharsets.UTF_8).trim()); } } diff --git a/examples/java-native/src/test/java/com/example/myproject/TestHello.java b/examples/java-native/src/test/java/com/example/myproject/TestHello.java index d50e6e503f..e8b775847f 100644 --- a/examples/java-native/src/test/java/com/example/myproject/TestHello.java +++ b/examples/java-native/src/test/java/com/example/myproject/TestHello.java @@ -21,7 +21,7 @@ public class TestHello { ByteArrayOutputStream out = new ByteArrayOutputStream(); Greeter.out = new PrintStream(out); Greeter.main(); - assertEquals("Hello world\n", new String(out.toByteArray(), StandardCharsets.UTF_8)); + assertEquals("Hello world", new String(out.toByteArray(), StandardCharsets.UTF_8).trim()); } @Test @@ -29,7 +29,7 @@ public class TestHello { ByteArrayOutputStream out = new ByteArrayOutputStream(); Greeter.out = new PrintStream(out); Greeter.main("toto"); - assertEquals("Hello toto\n", new String(out.toByteArray(), StandardCharsets.UTF_8)); + assertEquals("Hello toto", new String(out.toByteArray(), StandardCharsets.UTF_8).trim()); } } -- cgit v1.2.3