use of org.apache.wicket.MockPage in project wicket by apache.
the class AbstractPageStoreTest method removePage.
@Test
public void removePage() {
pageStore.storePage(sessionId, new MockPage(pageId));
assertNotNull(pageStore.getPage(sessionId, pageId));
pageStore.removePage(sessionId, pageId);
assertNull(pageStore.getPage(sessionId, pageId));
}
use of org.apache.wicket.MockPage in project wicket by apache.
the class AbstractPageStoreTest method maxSizeSameSession.
/**
* Verify that at most {@code maxEntries} per session can be put in the cache
*/
@Test
public void maxSizeSameSession() {
pageStore.storePage(sessionId, new MockPage(pageId));
assertNotNull(pageStore.getPage(sessionId, pageId));
int pageId2 = 234;
pageStore.storePage(sessionId, new MockPage(pageId2));
assertNull(pageStore.getPage(sessionId, pageId));
assertNotNull(pageStore.getPage(sessionId, pageId2));
}
use of org.apache.wicket.MockPage in project wicket by apache.
the class PerSessionPageStoreTest method maxSizeDifferentSessions.
/**
* Verify that it is OK to store more pages than {@code maxEntries}
* if they are in different sessions
*/
@Test
@Override
public void maxSizeDifferentSessions() {
String sessionId2 = "0987654321";
pageStore.storePage(sessionId, new MockPage(pageId));
assertNotNull(pageStore.getPage(sessionId, pageId));
pageStore.storePage(sessionId2, new MockPage(pageId));
assertNotNull(pageStore.getPage(sessionId, pageId));
assertNotNull(pageStore.getPage(sessionId2, pageId));
}
Aggregations