use of com.google.gerrit.entities.SubmoduleSubscription in project gerrit by GerritCodeReview.
the class SubmoduleSectionParserTest method withAnotherURI.
@Test
public void withAnotherURI() throws Exception {
Project.NameKey p = Project.nameKey("a");
Config cfg = new Config();
cfg.fromText("" + "[submodule \"a\"]\n" + "path = a\n" + "url = http://localhost:80/" + p.get() + "\n" + "branch = master\n");
BranchNameKey targetBranch = BranchNameKey.create(Project.nameKey("project"), "master");
Set<SubmoduleSubscription> res = new SubmoduleSectionParser(cfg, THIS_SERVER, targetBranch).parseAllSections();
Set<SubmoduleSubscription> expected = Sets.newHashSet(new SubmoduleSubscription(targetBranch, BranchNameKey.create(p, "master"), "a"));
assertThat(res).containsExactlyElementsIn(expected);
}
use of com.google.gerrit.entities.SubmoduleSubscription in project gerrit by GerritCodeReview.
the class SubmoduleSectionParserTest method withSubProjectFound.
@Test
public void withSubProjectFound() throws Exception {
Project.NameKey p1 = Project.nameKey("a/b");
Project.NameKey p2 = Project.nameKey("b");
Config cfg = new Config();
cfg.fromText("\n" + "[submodule \"a/b\"]\n" + "path = a/b\n" + "url = ssh://localhost/" + p1.get() + "\n" + "branch = .\n" + "[submodule \"b\"]\n" + "path = b\n" + "url = http://localhost/" + p2.get() + "\n" + "branch = .\n");
BranchNameKey targetBranch = BranchNameKey.create(Project.nameKey("project"), "master");
Set<SubmoduleSubscription> res = new SubmoduleSectionParser(cfg, THIS_SERVER, targetBranch).parseAllSections();
Set<SubmoduleSubscription> expected = Sets.newHashSet(new SubmoduleSubscription(targetBranch, BranchNameKey.create(p2, "master"), "b"), new SubmoduleSubscription(targetBranch, BranchNameKey.create(p1, "master"), "a/b"));
assertThat(res).containsExactlyElementsIn(expected);
}
Aggregations