xref: /JGit/org.eclipse.jgit.test/BUILD (revision 9b2f8ced9018dad519fefdc19d3940104b95434a)
10f6ddb37SDavid Ostrovskyload(
20f6ddb37SDavid Ostrovsky    "@com_googlesource_gerrit_bazlets//tools:genrule2.bzl",
30f6ddb37SDavid Ostrovsky    "genrule2",
40f6ddb37SDavid Ostrovsky)
522973d13SMatthias Sohnload("@rules_java//java:defs.bzl", "java_import", "java_library")
69150caa8SDavid Pursehouseload(":tests.bzl", "tests")
70f6ddb37SDavid Ostrovsky
80f6ddb37SDavid OstrovskyPKG = "tst/org/eclipse/jgit/"
90f6ddb37SDavid Ostrovsky
10488d9557SThomas WolfHELPERS = glob(
11488d9557SThomas Wolf    ["src/**/*.java"],
12f4c0189fSDavid Pursehouse    exclude = ["src/org/eclipse/jgit/transport/ssh/*.java"],
13488d9557SThomas Wolf) + [PKG + c for c in [
140f6ddb37SDavid Ostrovsky    "api/AbstractRemoteCommandTest.java",
150f6ddb37SDavid Ostrovsky    "diff/AbstractDiffTestCase.java",
160f6ddb37SDavid Ostrovsky    "internal/storage/file/GcTestCase.java",
170f6ddb37SDavid Ostrovsky    "internal/storage/file/PackIndexTestCase.java",
180f6ddb37SDavid Ostrovsky    "internal/storage/file/XInputStream.java",
190f6ddb37SDavid Ostrovsky    "nls/GermanTranslatedBundle.java",
200f6ddb37SDavid Ostrovsky    "nls/MissingPropertyBundle.java",
210f6ddb37SDavid Ostrovsky    "nls/NoPropertiesBundle.java",
220f6ddb37SDavid Ostrovsky    "nls/NonTranslatedBundle.java",
23bab68548SJonathan Tan    "revwalk/ReachabilityCheckerTestCase.java",
240f6ddb37SDavid Ostrovsky    "revwalk/RevQueueTestCase.java",
250f6ddb37SDavid Ostrovsky    "revwalk/RevWalkTestCase.java",
26a6da0591SDavid Pursehouse    "transport/ObjectIdMatcher.java",
27208ddab5SIvan Frade    "transport/RequestValidatorTestCase.java",
280f6ddb37SDavid Ostrovsky    "transport/SpiTransport.java",
290f6ddb37SDavid Ostrovsky    "treewalk/filter/AlwaysCloneTreeFilter.java",
300f6ddb37SDavid Ostrovsky    "test/resources/SampleDataRepositoryTestCase.java",
310f6ddb37SDavid Ostrovsky    "util/CPUTimeStopWatch.java",
326518d633SDavid Pursehouse    "util/http/HttpCookiesMatcher.java",
330f6ddb37SDavid Ostrovsky    "util/io/Strings.java",
340f6ddb37SDavid Ostrovsky]]
350f6ddb37SDavid Ostrovsky
360f6ddb37SDavid OstrovskyDATA = [
370f6ddb37SDavid Ostrovsky    PKG + "lib/empty.gitindex.dat",
380f6ddb37SDavid Ostrovsky    PKG + "lib/sorttest.gitindex.dat",
390f6ddb37SDavid Ostrovsky]
400f6ddb37SDavid Ostrovsky
41cee26c00SMatthias SohnEXCLUDED = [
42cee26c00SMatthias Sohn    PKG + "api/SecurityManagerTest.java",
43*9b2f8cedSDavid Ostrovsky    PKG + "api/SecurityManagerMissingPermissionsTest.java",
44cee26c00SMatthias Sohn]
45cee26c00SMatthias Sohn
46488d9557SThomas WolfRESOURCES = glob(["resources/**"])
47488d9557SThomas Wolf
48bbef67e8SDavid Ostrovskytests(tests = glob(
490f6ddb37SDavid Ostrovsky    ["tst/**/*.java"],
50cee26c00SMatthias Sohn    exclude = HELPERS + DATA + EXCLUDED,
510f6ddb37SDavid Ostrovsky))
520f6ddb37SDavid Ostrovsky
530f6ddb37SDavid Ostrovskyjava_library(
540f6ddb37SDavid Ostrovsky    name = "helpers",
550f6ddb37SDavid Ostrovsky    testonly = 1,
560f6ddb37SDavid Ostrovsky    srcs = HELPERS,
570f6ddb37SDavid Ostrovsky    resources = DATA,
580f6ddb37SDavid Ostrovsky    deps = [
598ada9048SMatthias Sohn        "//lib:assertj-core",
6008b0a863SThomas Wolf        "//lib:jsch",
6128cfda54SDavid Pursehouse        "//lib:junit",
622532fa74SMatthias Sohn        "//lib:mockito",
631fd09a19SDavid Pursehouse        "//lib:slf4j-simple",
640f6ddb37SDavid Ostrovsky        "//org.eclipse.jgit:jgit",
650f6ddb37SDavid Ostrovsky        "//org.eclipse.jgit.junit:junit",
660f6ddb37SDavid Ostrovsky    ],
670f6ddb37SDavid Ostrovsky)
680f6ddb37SDavid Ostrovsky
69488d9557SThomas Wolfjava_library(
70488d9557SThomas Wolf    name = "sshd-helpers",
71488d9557SThomas Wolf    testonly = 1,
72488d9557SThomas Wolf    srcs = glob(["src/org/eclipse/jgit/transport/ssh/*.java"]),
73488d9557SThomas Wolf    resource_strip_prefix = "org.eclipse.jgit.test/resources",
74488d9557SThomas Wolf    resources = RESOURCES,
75488d9557SThomas Wolf    visibility = [
76488d9557SThomas Wolf        "//org.eclipse.jgit.ssh.apache.test:__pkg__",
77488d9557SThomas Wolf    ],
78f4c0189fSDavid Pursehouse    deps = [
79f4c0189fSDavid Pursehouse        "//lib:jsch",
80f4c0189fSDavid Pursehouse        "//lib:junit",
8186cee68eSThomas Wolf        "//lib:sshd-osgi",
82f4c0189fSDavid Pursehouse        "//lib:sshd-sftp",
83f4c0189fSDavid Pursehouse        "//org.eclipse.jgit:jgit",
84f4c0189fSDavid Pursehouse        "//org.eclipse.jgit.junit:junit",
851316d43eSThomas Wolf        "//org.eclipse.jgit.junit.ssh:junit-ssh",
86f4c0189fSDavid Pursehouse    ],
87488d9557SThomas Wolf)
88488d9557SThomas Wolf
890f6ddb37SDavid Ostrovskyjava_import(
900f6ddb37SDavid Ostrovsky    name = "tst_rsrc",
910f6ddb37SDavid Ostrovsky    jars = [":tst_rsrc_jar"],
920f6ddb37SDavid Ostrovsky)
930f6ddb37SDavid Ostrovsky
940f6ddb37SDavid Ostrovskygenrule2(
95904e9f8bSDavid Pursehouse    name = "tst_rsrc_jar",
96904e9f8bSDavid Pursehouse    srcs = glob(["tst-rsrc/**"]),
97904e9f8bSDavid Pursehouse    outs = ["tst_rsrc.jar"],
98904e9f8bSDavid Pursehouse    cmd = "o=$$PWD/$@ && tar cf - $(SRCS) | tar -C $$TMP --strip-components=2 -xf - && cd  $$TMP && zip -qr $$o .",
990f6ddb37SDavid Ostrovsky)
100