Search in sources :

Example 6 with Bounded

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

the class PostOrderDiffWalkTest method testBucketBucketFlat.

@Test
public void testBucketBucketFlat() {
    RevTree left = createFeaturesTree(leftSource, "f", RevTree.NORMALIZED_SIZE_LIMIT + 1).build();
    RevTree right = createFeaturesTree(rightSource, "f", RevTree.NORMALIZED_SIZE_LIMIT + 2).build();
    PostOrderDiffWalk visitor = new PostOrderDiffWalk(left, right, leftSource, rightSource);
    visitor.walk(testConsumer);
    List<Bounded> leftCalls = testConsumer.orderedLeft;
    List<Bounded> rightCalls = testConsumer.orderedRight;
    // System.err.println(leftCalls);
    // System.err.println(rightCalls);
    Node lroot = nodeFor(left);
    Node rroot = nodeFor(right);
    assertEquals(3, leftCalls.size());
    assertEquals(3, rightCalls.size());
    assertNull(leftCalls.get(0));
    assertTrue(leftCalls.get(1) instanceof Bucket);
    assertEquals(lroot, leftCalls.get(2));
    assertEquals(rroot, rightCalls.get(2));
    assertTrue(rightCalls.get(1) instanceof Bucket);
    assertTrue(rightCalls.get(0) instanceof Node);
    assertEquals(RevObject.TYPE.FEATURE, ((Node) rightCalls.get(0)).getType());
}
Also used : Bounded(org.locationtech.geogig.api.Bounded) Bucket(org.locationtech.geogig.api.Bucket) Node(org.locationtech.geogig.api.Node) TreeTestSupport.featureNode(org.locationtech.geogig.api.plumbing.diff.TreeTestSupport.featureNode) RevTree(org.locationtech.geogig.api.RevTree) Test(org.junit.Test)

Aggregations

Bounded (org.locationtech.geogig.api.Bounded)6 Node (org.locationtech.geogig.api.Node)4 ObjectId (org.locationtech.geogig.api.ObjectId)4 Predicate (com.google.common.base.Predicate)3 Bucket (org.locationtech.geogig.api.Bucket)3 RevTree (org.locationtech.geogig.api.RevTree)3 Envelope (com.vividsolutions.jts.geom.Envelope)2 Nullable (javax.annotation.Nullable)2 Test (org.junit.Test)2 NodeRef (org.locationtech.geogig.api.NodeRef)2 TreeTestSupport.featureNode (org.locationtech.geogig.api.plumbing.diff.TreeTestSupport.featureNode)2 Function (com.google.common.base.Function)1 Optional (com.google.common.base.Optional)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 SimpleFeatureBuilder (org.geotools.feature.simple.SimpleFeatureBuilder)1 RevFeature (org.locationtech.geogig.api.RevFeature)1 RevFeatureType (org.locationtech.geogig.api.RevFeatureType)1 RevTreeBuilder (org.locationtech.geogig.api.RevTreeBuilder)1 LsTreeOp (org.locationtech.geogig.api.plumbing.LsTreeOp)1