Search in sources :

Example 6 with DefaultPageStore

use of org.apache.wicket.pageStore.DefaultPageStore 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)6 JavaSerializer (org.apache.wicket.serialize.java.JavaSerializer)5 IPageManager (org.apache.wicket.page.IPageManager)4 IPageManagerContext (org.apache.wicket.page.IPageManagerContext)4 PageStoreManager (org.apache.wicket.page.PageStoreManager)4 IDataStore (org.apache.wicket.pageStore.IDataStore)4 IPageStore (org.apache.wicket.pageStore.IPageStore)4 DefaultPageManagerProvider (org.apache.wicket.DefaultPageManagerProvider)2 IPageManagerProvider (org.apache.wicket.IPageManagerProvider)2 DefaultButtonImageResource (org.apache.wicket.markup.html.image.resource.DefaultButtonImageResource)2 HttpSessionDataStore (org.apache.wicket.pageStore.memory.HttpSessionDataStore)2 PageNumberEvictionStrategy (org.apache.wicket.pageStore.memory.PageNumberEvictionStrategy)2 WicketTester (org.apache.wicket.util.tester.WicketTester)2 InMemoryPageStore (org.apache.wicket.versioning.InMemoryPageStore)2 Before (org.junit.Before)2 MockApplication (org.apache.wicket.mock.MockApplication)1 AsynchronousDataStore (org.apache.wicket.pageStore.AsynchronousDataStore)1 DummyPageManagerContext (org.apache.wicket.pageStore.memory.DummyPageManagerContext)1 ISerializer (org.apache.wicket.serialize.ISerializer)1