@Then("We change, add and commit some more data") public void addMoreDataIntoRepo() throws Exception { Repository repo = context.getRepo("repo1"); TestData data = new TestData(repo); data.addAndCommit("modify point1; add point2, line1, poly1", data.point1_modified, data.point2, data.line1, data.poly1); }
@Given("^There is a feature with multiple authors on the \"([^\"]*)\" repo$") public void There_is_a_feature_with_multiple_authors(String repoName) throws Throwable { Repository repo = context.getRepo(repoName); TestData data = new TestData(repo); data.config("user.name", "Author1"); data.config("user.email", "author1@test.com"); data.addAndCommit("Added Point.1", TestData.point1); data.config("user.name", "Author2"); data.config("user.email", "author2@test.com"); data.addAndCommit("Modified Point.1", TestData.point1_modified); // add the repo to the set so it can be closed openedRepos.add(repoName); }
@Given("There is a repo with some data") public void setUpRepoWithData() throws Exception { Repository repo = context.createRepo("repo1").init("myuser", "the_user@testing.com") .getRepo(); TestData data = new TestData(repo); data.addAndCommit("Added Point.1", TestData.point1); }
@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); }
.addAndCommit("point1, line1, poly1", point1, line1, poly1)// .branchAndCheckout("branch1")// .addAndCommit("point2, line2, poly2", point2, line2, poly2)// .checkout("master")// .branchAndCheckout("branch2")// .addAndCommit("point3, line3, poly3", point3, line3, poly3)// .checkout("master")// .mergeNoFF("branch1", "merge branch branch1 onto master")//
.addAndCommit("point1, line1, poly1", point1, line1, poly1)// .branchAndCheckout("branch1")// .addAndCommit("point2, line2, poly2", point2, line2, poly2)// .checkout("master")// .branchAndCheckout("branch2")// .addAndCommit("point3, line3, poly3", point3, line3, poly3)// .checkout("master")// .mergeNoFF("branch1", "merge branch branch1 onto master")//
@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 are multiple branches on the \"([^\"]*)\" repo$") public void There_are_multiple_branches(String repoName) throws Throwable { Repository repo = context.getRepo(repoName); TestData data = new TestData(repo); data.addAndCommit("Added Point.1", TestData.point1); ObjectId master = repo.command(RefParse.class).setName("master").call().get().getObjectId(); repo.command(UpdateRef.class).setName(Ref.REMOTES_PREFIX + "origin/master_remote") .setNewValue(master).call(); data.branchAndCheckout("branch1"); data.addAndCommit("Added Point.2", TestData.point2); ObjectId branch1 = repo.command(RefParse.class).setName("branch1").call().get() .getObjectId(); repo.command(UpdateRef.class).setName(Ref.REMOTES_PREFIX + "origin/branch1_remote") .setNewValue(branch1).call(); data.branchAndCheckout("branch2"); data.addAndCommit("Added Line.1", TestData.line1); ObjectId branch2 = repo.command(RefParse.class).setName("branch2").call().get() .getObjectId(); repo.command(UpdateRef.class).setName(Ref.REMOTES_PREFIX + "origin/branch2_remote") .setNewValue(branch2).call(); data.checkout("master"); // add the repo to the set so it can be closed openedRepos.add(repoName); }