From d40b14f1e8a35db6bf8ccd9a5fdcf7d51216f541 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Fri, 3 Jun 2016 18:03:45 -0700 Subject: [PATCH] Superproject Subscriptions: test more corner cases With the previous commit in this makes sure there are no errors in the push. Change-Id: I615b109f9994658343ab2edf82019caa1ba6c8ca --- .../git/SubmoduleSubscriptionsIT.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/git/SubmoduleSubscriptionsIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/git/SubmoduleSubscriptionsIT.java index 1fcc42055e..f53575923f 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/git/SubmoduleSubscriptionsIT.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/git/SubmoduleSubscriptionsIT.java @@ -107,6 +107,33 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription { "subscribed-to-project", subHEAD); } + @Test + public void testSubscriptionWildcardACLForMissingProject() throws Exception { + TestRepository subRepo = createProjectWithPush("subscribed-to-project"); + allowSubmoduleSubscription("subscribed-to-project", "refs/heads/*", + "not-existing-super-project", "refs/heads/*"); + pushChangeTo(subRepo, "master"); + } + + @Test + public void testSubscriptionWildcardACLForMissingBranch() throws Exception { + createProjectWithPush("super-project"); + TestRepository subRepo = createProjectWithPush("subscribed-to-project"); + allowSubmoduleSubscription("subscribed-to-project", "refs/heads/*", + "super-project", "refs/heads/*"); + pushChangeTo(subRepo, "foo"); + } + + @Test + public void testSubscriptionWildcardACLForMissingGitmodules() throws Exception { + TestRepository superRepo = createProjectWithPush("super-project"); + TestRepository subRepo = createProjectWithPush("subscribed-to-project"); + allowSubmoduleSubscription("subscribed-to-project", "refs/heads/*", + "super-project", "refs/heads/*"); + pushChangeTo(superRepo, "master"); + pushChangeTo(subRepo, "master"); + } + @Test public void testSubscriptionWildcardACLOneOnOneMapping() throws Exception { TestRepository superRepo = createProjectWithPush("super-project");