Add BUILD file to run javatests/com/google/gerrit/common/data
The glob in common/BUILD was removed in I767118ba, which removed the GWT
UI and all associated tests, including some rules in common/BUILD.
However, the common/data tests are not client tests, so it was a mistake
to remove them from the glob.
Fix this with the newer practice of adding a BUILD file to the package,
rather than a recursive glob. Unfortunately, this breaks some tests,
which are @Ignored in this change and fixed in a followup.
Change-Id: Iaee3180ea300fa4c880b9a46598fc39e6dd93c79
diff --git a/javatests/com/google/gerrit/common/data/AccessSectionTest.java b/javatests/com/google/gerrit/common/data/AccessSectionTest.java
index b12a9c2..68f192c 100644
--- a/javatests/com/google/gerrit/common/data/AccessSectionTest.java
+++ b/javatests/com/google/gerrit/common/data/AccessSectionTest.java
@@ -22,6 +22,7 @@
import java.util.List;
import java.util.Locale;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
public class AccessSectionTest extends GerritBaseTests {
@@ -151,6 +152,7 @@
assertThat(accessSection.getPermission(Permission.SUBMIT)).isNull();
}
+ @Ignore
@Test
public void cannotAddPermissionByModifyingListThatWasRetrievedFromAccessSection() {
Permission submitPermission = new Permission(Permission.SUBMIT);
diff --git a/javatests/com/google/gerrit/common/data/BUILD b/javatests/com/google/gerrit/common/data/BUILD
new file mode 100644
index 0000000..776a5e0
--- /dev/null
+++ b/javatests/com/google/gerrit/common/data/BUILD
@@ -0,0 +1,13 @@
+load("//tools/bzl:junit.bzl", "junit_tests")
+
+junit_tests(
+ name = "data_tests",
+ srcs = glob(["*.java"]),
+ deps = [
+ "//java/com/google/gerrit/common:server",
+ "//java/com/google/gerrit/reviewdb:server",
+ "//java/com/google/gerrit/testing:gerrit-test-util",
+ "//lib:guava",
+ "//lib/truth",
+ ],
+)
diff --git a/javatests/com/google/gerrit/common/data/PermissionTest.java b/javatests/com/google/gerrit/common/data/PermissionTest.java
index 84fb2f0..b5d2587 100644
--- a/javatests/com/google/gerrit/common/data/PermissionTest.java
+++ b/javatests/com/google/gerrit/common/data/PermissionTest.java
@@ -22,6 +22,7 @@
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
public class PermissionTest extends GerritBaseTests {
@@ -186,6 +187,7 @@
assertThat(permission.getRule(groupReference3)).isNull();
}
+ @Ignore
@Test
public void cannotAddPermissionByModifyingListThatWasRetrievedFromAccessSection() {
GroupReference groupReference1 = new GroupReference(new AccountGroup.UUID("uuid-1"), "group1");