Search in sources :

Example 36 with RevCommit

use of org.locationtech.geogig.api.RevCommit in project GeoGig by boundlessgeo.

the class RemoteRepositoryTestCase method populate.

protected List<RevCommit> populate(GeoGIG geogig, boolean oneCommitPerFeature, List<Feature> features) throws Exception {
    List<RevCommit> commits = new ArrayList<RevCommit>();
    for (Feature f : features) {
        insertAndAdd(geogig, f);
        if (oneCommitPerFeature) {
            RevCommit commit = geogig.command(CommitOp.class).call();
            commits.add(commit);
        }
    }
    if (!oneCommitPerFeature) {
        RevCommit commit = geogig.command(CommitOp.class).call();
        commits.add(commit);
    }
    return commits;
}
Also used : ArrayList(java.util.ArrayList) CommitOp(org.locationtech.geogig.api.porcelain.CommitOp) Feature(org.opengis.feature.Feature) RevCommit(org.locationtech.geogig.api.RevCommit)

Example 37 with RevCommit

use of org.locationtech.geogig.api.RevCommit in project GeoGig by boundlessgeo.

the class RevCommitSerializationTest method testCommitSerializationNoMessage.

@Test
public void testCommitSerializationNoMessage() throws IOException {
    testCommit.setMessage(null);
    RevCommit commit = testCommit.build();
    testCommit(commit);
}
Also used : RevCommit(org.locationtech.geogig.api.RevCommit) Test(org.junit.Test)

Example 38 with RevCommit

use of org.locationtech.geogig.api.RevCommit in project GeoGig by boundlessgeo.

the class RevCommitSerializationTest method testCommitSerializationNoCommitter.

@Test
public void testCommitSerializationNoCommitter() throws IOException {
    testCommit.setCommitter(null);
    testCommit.setCommitterEmail(null);
    RevCommit commit = testCommit.build();
    testCommit(commit);
}
Also used : RevCommit(org.locationtech.geogig.api.RevCommit) Test(org.junit.Test)

Example 39 with RevCommit

use of org.locationtech.geogig.api.RevCommit in project GeoGig by boundlessgeo.

the class RevCommitSerializationTest method testCommitSerializationNoParents.

@Test
public void testCommitSerializationNoParents() throws IOException {
    testCommit.setParentIds(null);
    RevCommit commit = testCommit.build();
    testCommit(commit);
}
Also used : RevCommit(org.locationtech.geogig.api.RevCommit) Test(org.junit.Test)

Example 40 with RevCommit

use of org.locationtech.geogig.api.RevCommit in project GeoGig by boundlessgeo.

the class RevCommitSerializationTest method testCommit.

private void testCommit(RevCommit commit) throws IOException {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    ObjectWriter<RevCommit> writer = factory.createObjectWriter(TYPE.COMMIT);
    writer.write(commit, out);
    // System.err.println(out);
    ObjectReader<RevCommit> reader = factory.createCommitReader();
    RevCommit read = reader.read(commit.getId(), new ByteArrayInputStream(out.toByteArray()));
    assertEquals(commit, read);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) RevCommit(org.locationtech.geogig.api.RevCommit)

Aggregations

RevCommit (org.locationtech.geogig.api.RevCommit)291 Test (org.junit.Test)212 ObjectId (org.locationtech.geogig.api.ObjectId)109 CommitOp (org.locationtech.geogig.api.porcelain.CommitOp)107 LogOp (org.locationtech.geogig.api.porcelain.LogOp)86 Ref (org.locationtech.geogig.api.Ref)71 Feature (org.opengis.feature.Feature)52 NodeRef (org.locationtech.geogig.api.NodeRef)47 ArrayList (java.util.ArrayList)44 BranchCreateOp (org.locationtech.geogig.api.porcelain.BranchCreateOp)44 RevTree (org.locationtech.geogig.api.RevTree)36 SymRef (org.locationtech.geogig.api.SymRef)33 RefParse (org.locationtech.geogig.api.plumbing.RefParse)33 DiffEntry (org.locationtech.geogig.api.plumbing.diff.DiffEntry)31 RevObject (org.locationtech.geogig.api.RevObject)30 UpdateRef (org.locationtech.geogig.api.plumbing.UpdateRef)30 MergeScenarioReport (org.locationtech.geogig.api.plumbing.merge.MergeScenarioReport)30 UpdateSymRef (org.locationtech.geogig.api.plumbing.UpdateSymRef)26 LinkedList (java.util.LinkedList)24 AddOp (org.locationtech.geogig.api.porcelain.AddOp)21