use of org.locationtech.geogig.api.plumbing.merge.MergeScenarioReport in project GeoGig by boundlessgeo.
the class ReportMergeConflictsOpTest method testModifiedSameAttributeCompatible.
@Test
public void testModifiedSameAttributeCompatible() throws Exception {
insertAndAdd(points1);
geogig.command(CommitOp.class).call();
geogig.command(BranchCreateOp.class).setName("TestBranch").call();
Feature points1Modified = feature(pointsType, idP1, "StringProp1_2", new Integer(1000), "POINT(1 1)");
insertAndAdd(points1Modified);
RevCommit masterCommit = geogig.command(CommitOp.class).call();
geogig.command(CheckoutOp.class).setSource("TestBranch").call();
Feature points1ModifiedB = feature(pointsType, idP1, "StringProp1_2", new Integer(2000), "POINT(1 1)");
insertAndAdd(points1ModifiedB);
RevCommit branchCommit = geogig.command(CommitOp.class).call();
MergeScenarioReport conflicts = geogig.command(ReportMergeScenarioOp.class).setMergeIntoCommit(masterCommit).setToMergeCommit(branchCommit).call();
assertEquals(0, conflicts.getConflicts().size());
assertEquals(1, conflicts.getUnconflicted().size());
Boolean hasConflictsOrAutomerge = geogig.command(CheckMergeScenarioOp.class).setCommits(Lists.newArrayList(masterCommit, branchCommit)).call();
assertTrue(hasConflictsOrAutomerge.booleanValue());
}
use of org.locationtech.geogig.api.plumbing.merge.MergeScenarioReport in project GeoGig by boundlessgeo.
the class ReportCommitConflictsOpTest method testAddedSameFeatureType.
@Test
public void testAddedSameFeatureType() throws Exception {
insertAndAdd(lines1);
geogig.command(CommitOp.class).call();
geogig.command(BranchCreateOp.class).setName("TestBranch").call();
insert(points2);
delete(points2);
geogig.command(AddOp.class).call();
geogig.command(CommitOp.class).call();
geogig.command(CheckoutOp.class).setSource("TestBranch").call();
insert(points2);
delete(points2);
geogig.command(AddOp.class).call();
RevCommit branchCommit = geogig.command(CommitOp.class).call();
geogig.command(CheckoutOp.class).setSource("master").call();
MergeScenarioReport conflicts = geogig.command(ReportCommitConflictsOp.class).setCommit(branchCommit).call();
assertEquals(0, conflicts.getConflicts().size());
assertEquals(0, conflicts.getUnconflicted().size());
}
use of org.locationtech.geogig.api.plumbing.merge.MergeScenarioReport in project GeoGig by boundlessgeo.
the class ReportCommitConflictsOpTest method testModifiedSameFeatureCompatible.
@Test
public void testModifiedSameFeatureCompatible() throws Exception {
insertAndAdd(points1);
geogig.command(CommitOp.class).call();
geogig.command(BranchCreateOp.class).setName("TestBranch").call();
Feature points1Modified = feature(pointsType, idP1, "StringProp1_2", new Integer(1000), "POINT(1 1)");
insertAndAdd(points1Modified);
geogig.command(CommitOp.class).call();
geogig.command(CheckoutOp.class).setSource("TestBranch").call();
Feature points1ModifiedB = feature(pointsType, idP1, "StringProp1_1", new Integer(2000), "POINT(1 1)");
insertAndAdd(points1ModifiedB);
RevCommit branchCommit = geogig.command(CommitOp.class).call();
geogig.command(CheckoutOp.class).setSource("master").call();
MergeScenarioReport conflicts = geogig.command(ReportCommitConflictsOp.class).setCommit(branchCommit).call();
assertEquals(0, conflicts.getConflicts().size());
assertEquals(1, conflicts.getUnconflicted().size());
}
use of org.locationtech.geogig.api.plumbing.merge.MergeScenarioReport in project GeoGig by boundlessgeo.
the class ReportCommitConflictsOpTest method testAddedDifferentFeatures.
@Test
public void testAddedDifferentFeatures() throws Exception {
insertAndAdd(points1);
geogig.command(CommitOp.class).call();
geogig.command(BranchCreateOp.class).setName("TestBranch").call();
insertAndAdd(points2);
geogig.command(CommitOp.class).call();
geogig.command(CheckoutOp.class).setSource("TestBranch").call();
insertAndAdd(points3);
RevCommit branchCommit = geogig.command(CommitOp.class).call();
geogig.command(CheckoutOp.class).setSource("master").call();
MergeScenarioReport conflicts = geogig.command(ReportCommitConflictsOp.class).setCommit(branchCommit).call();
assertEquals(0, conflicts.getConflicts().size());
assertEquals(1, conflicts.getUnconflicted().size());
}
use of org.locationtech.geogig.api.plumbing.merge.MergeScenarioReport in project GeoGig by boundlessgeo.
the class ReportCommitConflictsOpTest method testAddedDifferentFeatureType.
@Test
public void testAddedDifferentFeatureType() throws Exception {
insertAndAdd(lines1);
geogig.command(CommitOp.class).call();
geogig.command(BranchCreateOp.class).setName("TestBranch").call();
insert(points1);
delete(points1);
geogig.command(AddOp.class).call();
geogig.command(CommitOp.class).call();
geogig.command(CheckoutOp.class).setSource("TestBranch").call();
insert(points1B);
delete(points1B);
geogig.command(AddOp.class).call();
RevCommit branchCommit = geogig.command(CommitOp.class).call();
geogig.command(CheckoutOp.class).setSource("master").call();
MergeScenarioReport conflicts = geogig.command(ReportCommitConflictsOp.class).setCommit(branchCommit).call();
assertEquals(1, conflicts.getConflicts().size());
assertEquals(0, conflicts.getUnconflicted().size());
}
Aggregations