@Test public void long_stack_page_deleted_after_take() throws IOException { engine.lock.writeLock().lock(); engine.longStackPut(TEST_LS_RECID, 111); engine.commit(); assertEquals(111L, engine.longStackTake(TEST_LS_RECID)); engine.commit(); assertEquals(0L, engine.index.getLong(TEST_LS_RECID * 8)); }
@Test public void test_long_stack_put_take() throws IOException { engine.lock.writeLock().lock(); final long max = 150; for (long i = 1; i < max; i++) { engine.longStackPut(TEST_LS_RECID, i); } for (long i = max - 1; i > 0; i--) { assertEquals(i, engine.longStackTake(TEST_LS_RECID)); } assertEquals(0, getLongStack(TEST_LS_RECID).size()); }
@Test public void test_long_stack_put_take_simple() throws IOException { engine.lock.writeLock().lock(); engine.longStackPut(TEST_LS_RECID, 111); assertEquals(111L, engine.longStackTake(TEST_LS_RECID)); }