From adeef73a97cf191301a7b563883a075caed733b7 Mon Sep 17 00:00:00 2001 From: Damien Martin-Guillerez Date: Tue, 24 Mar 2015 09:05:08 +0000 Subject: Move all examples into Bazel workspace Those examples will be used for Bazel integration tests and their sources should be available directly to the Bazel workspace itself. -- MOS_MIGRATED_REVID=89380736 --- .../src/test/java/com/example/myproject/BUILD | 16 ---------- .../src/test/java/com/example/myproject/Fail.java | 7 ----- .../test/java/com/example/myproject/TestHello.java | 35 ---------------------- 3 files changed, 58 deletions(-) delete mode 100644 base_workspace/examples/java-skylark/src/test/java/com/example/myproject/BUILD delete mode 100644 base_workspace/examples/java-skylark/src/test/java/com/example/myproject/Fail.java delete mode 100644 base_workspace/examples/java-skylark/src/test/java/com/example/myproject/TestHello.java (limited to 'base_workspace/examples/java-skylark/src/test/java/com/example/myproject') diff --git a/base_workspace/examples/java-skylark/src/test/java/com/example/myproject/BUILD b/base_workspace/examples/java-skylark/src/test/java/com/example/myproject/BUILD deleted file mode 100644 index 36c4cc3a67..0000000000 --- a/base_workspace/examples/java-skylark/src/test/java/com/example/myproject/BUILD +++ /dev/null @@ -1,16 +0,0 @@ -load("/tools/build_rules/java_rules_skylark", "java_test") - -java_test( - name = "pass", - srcs = ["TestHello.java"], - deps = [ - "//examples/java-skylark/src/main/java/com/example/myproject:hello-lib", - "//third_party:junit4-skylark", - ], -) - -java_test( - name = "fail", - srcs = ["Fail.java"], - main_class = "com.example.myproject.Fail", -) diff --git a/base_workspace/examples/java-skylark/src/test/java/com/example/myproject/Fail.java b/base_workspace/examples/java-skylark/src/test/java/com/example/myproject/Fail.java deleted file mode 100644 index 079e1e9f04..0000000000 --- a/base_workspace/examples/java-skylark/src/test/java/com/example/myproject/Fail.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.example.myproject; - -class Fail { - public static void main(String []args) { - System.exit(1); - } -} diff --git a/base_workspace/examples/java-skylark/src/test/java/com/example/myproject/TestHello.java b/base_workspace/examples/java-skylark/src/test/java/com/example/myproject/TestHello.java deleted file mode 100644 index d50e6e503f..0000000000 --- a/base_workspace/examples/java-skylark/src/test/java/com/example/myproject/TestHello.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.example.myproject; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import java.nio.charset.StandardCharsets; - -/** - * Tests different numbers of arguments to main(). - * - *

With an empty args array, {@link Greeter} should print "Hello world". If there are one or more - * args, {@link Greeter} should print "Hello <arg[0]>".

- */ -public class TestHello { - - @Test - public void testNoArgument() throws Exception { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - Greeter.out = new PrintStream(out); - Greeter.main(); - assertEquals("Hello world\n", new String(out.toByteArray(), StandardCharsets.UTF_8)); - } - - @Test - public void testWithArgument() throws Exception { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - Greeter.out = new PrintStream(out); - Greeter.main("toto"); - assertEquals("Hello toto\n", new String(out.toByteArray(), StandardCharsets.UTF_8)); - } - -} -- cgit v1.2.3