use of jetbrains.exodus.TestFor in project xodus by JetBrains.
the class BinaryOperatorsTests method testConcat2.
@TestFor(issue = "XD-566")
public void testConcat2() {
final StoreTransaction txn = getStoreTransaction();
Objects.requireNonNull(txn).newEntity("Issue");
Assert.assertEquals(1, toList(txn.getAll("User").concat(txn.getAll("Issue"))).size());
Assert.assertTrue(txn.flush());
txn.newEntity("User");
Assert.assertTrue(txn.flush());
Assert.assertEquals(2, toList(txn.getAll("User").concat(txn.getAll("Issue"))).size());
Objects.requireNonNull(txn.getAll("User").getFirst()).delete();
Assert.assertTrue(txn.flush());
while (true) {
txn.revert();
final EntityIterableBase concat = (EntityIterableBase) txn.getAll("User").concat(txn.getAll("Issue"));
Assert.assertEquals(1, toList(concat).size());
if (concat.isCached())
break;
Thread.yield();
}
txn.revert();
txn.newEntity("User");
Assert.assertTrue(txn.flush());
final EntityIterableBase concat = (EntityIterableBase) txn.getAll("User").concat(txn.getAll("Issue"));
Assert.assertFalse(concat.isCached());
Assert.assertEquals(2, toList(concat).size());
}
use of jetbrains.exodus.TestFor in project xodus by JetBrains.
the class TreeCursorNoDuplicatesTest method failingGetNextAndGetPrevDontInvalidateKeyValue.
@Test
@TestFor(issue = "XD-614")
public void failingGetNextAndGetPrevDontInvalidateKeyValue() {
tm = createMutableTree(false, 1);
tm.put(kv("0", "0"));
try (Cursor cursor = tm.openCursor()) {
Assert.assertTrue(cursor.getNext());
Assert.assertEquals(key("0"), cursor.getKey());
Assert.assertEquals(key("0"), cursor.getValue());
Assert.assertFalse(cursor.getNext());
Assert.assertEquals(key("0"), cursor.getKey());
Assert.assertEquals(key("0"), cursor.getValue());
}
try (Cursor cursor = tm.openCursor()) {
Assert.assertTrue(cursor.getPrev());
Assert.assertEquals(key("0"), cursor.getKey());
Assert.assertEquals(key("0"), cursor.getValue());
Assert.assertFalse(cursor.getPrev());
Assert.assertEquals(key("0"), cursor.getKey());
Assert.assertEquals(key("0"), cursor.getValue());
}
}
Aggregations