assertFalse(changed.buckets().isPresent());
}
@Test
public void testBucketBucketChange() {
RevTreeBuilder builder;
RevTree changed;
builder = new RevTreeBuilder(odb, bucketsFeatureTree);
changed = builder.put(
Node.create("1023", FAKE_FEATURE_ID_CHANGED, ObjectId.NULL, TYPE.FEATURE, null))
.build();
DiffObjectCount count = count(bucketsFeatureTree, changed);
assertEquals(1, count.featureCount());
assertEquals(0, count.treeCount());
count = count(changed, bucketsFeatureTree);
assertEquals(1, count.featureCount());
assertEquals(0, count.treeCount());
builder = new RevTreeBuilder(odb, bucketsFeatureTree);
int expected = 0;
for (int i = 0; i < bucketsFeatureTree.size(); i += 2) {
changed = builder.put(
Node.create(String.valueOf(i), FAKE_FEATURE_ID_CHANGED, ObjectId.NULL,
TYPE.FEATURE, null)).build();
expected++;
}
changed = builder.build();
assertEquals(expected, count(bucketsFeatureTree, changed).featureCount());
assertEquals(expected, count(changed, bucketsFeatureTree).featureCount());
assertEquals(expected, count(bucketsFeatureTree, changed).getFeaturesChanged());
assertEquals(expected, count(changed, bucketsFeatureTree).getFeaturesChanged());