Search in sources :

Example 1 with InMemoryPageStore

use of org.apache.wicket.versioning.InMemoryPageStore in project wicket by apache.

the class PersistentPageManagerTest method newPersistentPageManager.

private PageStoreManager newPersistentPageManager(String appName) {
    IDataStore dataStore = new InMemoryPageStore();
    IPageStore pageStore = new DefaultPageStore(new JavaSerializer(appName), dataStore, 4);
    IPageManagerContext pageManagerContext = new DummyPageManagerContext();
    return new PageStoreManager(appName, pageStore, pageManagerContext);
}
Also used : IPageStore(org.apache.wicket.pageStore.IPageStore) DummyPageManagerContext(org.apache.wicket.pageStore.memory.DummyPageManagerContext) JavaSerializer(org.apache.wicket.serialize.java.JavaSerializer) IDataStore(org.apache.wicket.pageStore.IDataStore) InMemoryPageStore(org.apache.wicket.versioning.InMemoryPageStore) DefaultPageStore(org.apache.wicket.pageStore.DefaultPageStore)

Example 2 with InMemoryPageStore

use of org.apache.wicket.versioning.InMemoryPageStore in project wicket by apache.

the class PageIdPoliticTest method setUp.

@Before
public void setUp() throws Exception {
    application = new MockApplication();
    dataStore = new InMemoryPageStore() {

        @Override
        public void storeData(String sessionId, int pageId, byte[] pageAsBytes) {
            super.storeData(sessionId, pageId, pageAsBytes);
            storeCount++;
        }
    };
    tester = new WicketTester(application) {

        @Override
        protected IPageManagerProvider newTestPageManagerProvider() {
            return new IPageManagerProvider() {

                @Override
                public IPageManager apply(IPageManagerContext pageManagerContext) {
                    IPageStore pageStore = new DefaultPageStore(new JavaSerializer(application.getApplicationKey()), dataStore, 4);
                    return new PageStoreManager(application.getName(), pageStore, pageManagerContext);
                }
            };
        }
    };
}
Also used : IPageStore(org.apache.wicket.pageStore.IPageStore) IPageManager(org.apache.wicket.page.IPageManager) MockApplication(org.apache.wicket.mock.MockApplication) IPageManagerProvider(org.apache.wicket.IPageManagerProvider) JavaSerializer(org.apache.wicket.serialize.java.JavaSerializer) DefaultPageStore(org.apache.wicket.pageStore.DefaultPageStore) PageStoreManager(org.apache.wicket.page.PageStoreManager) WicketTester(org.apache.wicket.util.tester.WicketTester) IPageManagerContext(org.apache.wicket.page.IPageManagerContext) InMemoryPageStore(org.apache.wicket.versioning.InMemoryPageStore) Before(org.junit.Before)

Aggregations

DefaultPageStore (org.apache.wicket.pageStore.DefaultPageStore)2 IPageStore (org.apache.wicket.pageStore.IPageStore)2 JavaSerializer (org.apache.wicket.serialize.java.JavaSerializer)2 InMemoryPageStore (org.apache.wicket.versioning.InMemoryPageStore)2 IPageManagerProvider (org.apache.wicket.IPageManagerProvider)1 MockApplication (org.apache.wicket.mock.MockApplication)1 IPageManager (org.apache.wicket.page.IPageManager)1 IPageManagerContext (org.apache.wicket.page.IPageManagerContext)1 PageStoreManager (org.apache.wicket.page.PageStoreManager)1 IDataStore (org.apache.wicket.pageStore.IDataStore)1 DummyPageManagerContext (org.apache.wicket.pageStore.memory.DummyPageManagerContext)1 WicketTester (org.apache.wicket.util.tester.WicketTester)1 Before (org.junit.Before)1