@Given("^I have removed \"([^\"]*)\" on the \"([^\"]*)\" repo in the \"([^\"]*)\" transaction$") public void I_have_removed(String feature, String repoName, String txId) throws Exception { Repository repo = context.getRepo(repoName); TestData data = new TestData(repo); if (!txId.isEmpty()) { GeogigTransaction transaction = repo.command(TransactionResolve.class) .setId(UUID.fromString(context.getVariable(txId))).call().get(); data.setTransaction(transaction); } data.remove(parseFeature(feature)); data.add(); data.commit("Removed " + feature); // add the repo to the set so it can be closed openedRepos.add(repoName); }
@Given("^There are conflicts on the \"([^\"]*)\" repo in the (@[^\"]*) transaction$") public void There_are_conflict(String repoName, String txId) throws Throwable { Repository repo = context.getRepo(repoName); TestData data = new TestData(repo); GeogigTransaction transaction = repo.command(TransactionResolve.class) .setId(UUID.fromString(context.getVariable(txId))).call().get(); data.setTransaction(transaction); data.addAndCommit("Added Point.1", TestData.point1); data.branch("branch1"); data.addAndCommit("Modified Point.1", TestData.point1_modified); data.checkout("branch1"); data.remove(TestData.point1); data.add(); data.commit("Removed Point.1"); data.checkout("master"); try { data.mergeNoFF("branch1", "Merge branch1"); } catch (MergeConflictsException e) { // Expected } assertEquals(1, transaction.command(ConflictsCountOp.class).call().longValue()); // add the repo to the set so it can be closed openedRepos.add(repoName); }
@Given("^There is a repository with multiple branches named ([^\"]*)$") public void setUpMultipleBranches(String name) throws Throwable { Repository repo = context.createRepo(name).init("webuser", "webuser@test.com").getRepo(); TestData data = new TestData(repo); data.addAndCommit("Added Point.1", TestData.point1); data.branch("non_conflicting"); data.branch("conflicting"); data.addAndCommit("Modified Point.1", TestData.point1_modified); data.branch("master_original"); data.checkout("conflicting"); data.remove(TestData.point1); data.add(); data.commit("Removed Point.1"); data.checkout("non_conflicting"); data.addAndCommit("Added Point.2", TestData.point2); data.checkout("master"); repo.close(); openedRepos.add(name); }
public @Test void testResolve() { origin.loadDefaultData()// .checkout("branch1")// .branchAndCheckout("issuerBranch")// .remove(TestData.line2).add().commit("remove line2"); PRInitOp prinit = PRInitOp.builder()// .id(1)// .remoteURI(origin.getRepo().getLocation())// .remoteBranch("issuerBranch")// .targetBranch("branch1")// .title("first PR")// .description(null)// .build(); prinit.setContext(origin.getRepo().context()); PR request = prinit.call(); Optional<PR> resolved = origin.getRepo().command(PRFindOp.class).setId(request.getId()) .call(); assertTrue(resolved.isPresent()); assertEquals(request, resolved.get()); assertFalse(origin.getRepo().command(PRFindOp.class).setId(1 + request.getId()).call() .isPresent()); } }
.remove(TestData.line1).add().commit("remove line1")// .insert(TestData.poly4).add().commit("add poly 4")// .insert(TestData.point1_modified).add().commit("modify point1");
.remove(TestData.line1).add().commit("remove line1")// .insert(TestData.poly4).add().commit("add poly 4")// .insert(TestData.point1_modified).add().commit("modify point1");
public @Before void before() { origin = testSupport.newRepo("origin"); origin.loadDefaultData(); clone = testSupport.clone(origin, "clone"); commonAncestor = Iterators.getLast(origin.log("master")); origin.resetHard(commonAncestor.getId()); TestData.point1_modified.setAttribute("sp", "modified by clone"); clone.branchAndCheckout("issuerBranch")// .resetHard(commonAncestor.getId())// .remove(TestData.line1).add().commit("remove line1")// .insert(TestData.poly4).add().commit("add poly 4")// .insert(TestData.point1_modified).add().commit("modify point1"); PRInitOp prinit = PRInitOp.builder()// .id(1)// .remoteURI(clone.getRepo().getLocation())// .remoteBranch("issuerBranch")// .targetBranch("master")// .title("first PR")// .description(null)// .build(); prinit.setContext(origin.getContext()); request = prinit.call(); assertNotNull(request); }
public @Before void before() { origin = testSupport.newRepo("origin"); origin.loadDefaultData(); clone = testSupport.clone(origin, "clone"); commonAncestor = Iterators.getLast(origin.log("master")); origin.resetHard(commonAncestor.getId()); TestData.point1_modified.setAttribute("sp", "modified by clone"); clone.branchAndCheckout("issuerBranch")// .resetHard(commonAncestor.getId())// .remove(TestData.line1).add().commit("remove line1")// .insert(TestData.poly4).add().commit("add poly 4")// .insert(TestData.point1_modified).add().commit("modify point1"); PRInitOp prinit = PRInitOp.builder()// .id(1)// .remoteURI(clone.getRepo().getLocation())// .remoteBranch("issuerBranch")// .targetBranch("master")// .title("first PR")// .description(null)// .build(); prinit.setContext(origin.getContext()); request = prinit.call(); assertNotNull(request); }
public @Before void before() { origin = testSupport.newRepo("origin"); origin.loadDefaultData(); clone = testSupport.clone(origin, "clone"); commonAncestor = Iterators.getLast(origin.log("master")); origin.resetHard(commonAncestor.getId()); TestData.point1_modified.setAttribute("sp", "modified by clone"); clone.branchAndCheckout("issuerBranch")// .resetHard(commonAncestor.getId())// .remove(TestData.line1).add().commit("remove line1")// .insert(TestData.poly4).add().commit("add poly 4")// .insert(TestData.point1_modified).add().commit("modify point1"); PRInitOp prinit = PRInitOp.builder()// .id(1)// .remoteURI(clone.getRepo().getLocation())// .remoteBranch("issuerBranch")// .targetBranch("master")// .title("first PR")// .description(null)// .build(); prinit.setContext(origin.getRepo().context()); request = prinit.call(); assertNotNull(request); }
.remove(TestData.line1).add().commit("remove line1")// .insert(TestData.poly4).add().commit("add poly 4")// .insert(TestData.point1_modified).add().commit("modify point1");
.remove(TestData.line1).add().commit("remove line1")// .insert(TestData.poly4).add().commit("add poly 4")// .insert(TestData.point1_modified).add().commit("modify point1");