aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/java-native/src/test/java/com/example/myproject/BUILD
blob: f3a262db992e46dc7d190301fe7849fd84796285 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
java_test(
    name = "hello",
    srcs = ["TestHello.java"],
    test_class = "com.example.myproject.TestHello",
    deps = [
        "//examples/java-native/src/main/java/com/example/myproject:hello-lib",
        "//third_party:junit4",
    ],
)

java_test(
    name = "custom",
    srcs = ["TestCustomGreeting.java"],
    test_class = "com.example.myproject.TestCustomGreeting",
    deps = [
        "//examples/java-native/src/main/java/com/example/myproject:custom-greeting",
        "//third_party:junit4",
    ],
)

java_test(
    name = "custom_with_test_class",
    srcs = glob(["Test*.java"]),
    test_class = "com.example.myproject.TestCustomGreeting",
    deps = [
        "//examples/java-native/src/main/java/com/example/myproject:custom-greeting",
        "//third_party:junit4",
    ],
)

java_test(
    name = "fail",
    srcs = ["Fail.java"],
    deps = ["//third_party:junit4"],
)

# This attempts to run TestCustomGreeting.java without any resources, so fails.
java_test(
    name = "resource-fail",
    srcs = glob(["Test*.java"]),
    test_class = "com.example.myproject.TestCustomGreeting",
    deps = [
        "//examples/java-native/src/main/java/com/example/myproject:hello-lib",
        "//third_party:junit4",
    ],
)

filegroup(
    name = "srcs",
    srcs = glob(["**/*.java"]) + ["BUILD"],
    visibility = ["//examples/java-native:__pkg__"],
)