use of jetbrains.exodus.entitystore.iterate.ConstantEntityIterableHandle in project xodus by JetBrains.
the class EntityIterableHandleTests method testTrivial.
public void testTrivial() {
final EntityIterableHandleBase h = new ConstantEntityIterableHandle(getEntityStore(), EntityIterableType.EMPTY) {
@Override
public void toString(@NotNull final StringBuilder builder) {
super.toString(builder);
for (int i = 0; i < 31; ++i) {
builder.append('0');
}
}
@Override
public void hashCode(@NotNull final EntityIterableHandleHash hash) {
for (int i = 0; i < 31; ++i) {
hash.apply("0");
}
}
};
Assert.assertEquals("00000000000000000000000000000000", h.toString());
}
use of jetbrains.exodus.entitystore.iterate.ConstantEntityIterableHandle in project xodus by JetBrains.
the class EntityIterableHandleTests method test_XD_438.
public void test_XD_438() {
final EntityIterableHandleBase h = new ConstantEntityIterableHandle(getEntityStore(), EntityIterableType.REVERSE) {
@Override
public void toString(@NotNull final StringBuilder builder) {
super.toString(builder);
builder.append(EntityIterableType.SINGLE_ENTITY.getType());
builder.append('-');
new PersistentEntityId(1000000000, 10000000000000000L).toString(builder);
}
@Override
public void hashCode(@NotNull final EntityIterableHandleHash hash) {
hash.apply(EntityIterableType.SINGLE_ENTITY.getType());
hash.applyDelimiter();
new PersistentEntityId(1000000000, 10000000000000000L).toHash(hash);
}
};
Assert.assertEquals("Reversed iterable\n" + "| Single entity 1000000000 10000000000000000", EntityIterableBase.getHumanReadablePresentation(h));
}
Aggregations