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;
}
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);
}
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);
}
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);
}
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);
}
Aggregations