Search in sources :

Example 6 with IPageManagerContext

use of org.apache.wicket.page.IPageManagerContext 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

IPageManagerContext (org.apache.wicket.page.IPageManagerContext)6 IPageManagerProvider (org.apache.wicket.IPageManagerProvider)4 IPageManager (org.apache.wicket.page.IPageManager)4 PageStoreManager (org.apache.wicket.page.PageStoreManager)4 DefaultPageStore (org.apache.wicket.pageStore.DefaultPageStore)4 JavaSerializer (org.apache.wicket.serialize.java.JavaSerializer)4 WicketTester (org.apache.wicket.util.tester.WicketTester)4 IDataStore (org.apache.wicket.pageStore.IDataStore)3 IPageStore (org.apache.wicket.pageStore.IPageStore)3 DefaultPageManagerProvider (org.apache.wicket.DefaultPageManagerProvider)2 DefaultButtonImageResource (org.apache.wicket.markup.html.image.resource.DefaultButtonImageResource)2 MockPageManager (org.apache.wicket.mock.MockPageManager)2 IManageablePage (org.apache.wicket.page.IManageablePage)2 HttpSessionDataStore (org.apache.wicket.pageStore.memory.HttpSessionDataStore)2 PageNumberEvictionStrategy (org.apache.wicket.pageStore.memory.PageNumberEvictionStrategy)2 Before (org.junit.Before)2 Component (org.apache.wicket.Component)1 IComponentInstantiationListener (org.apache.wicket.application.IComponentInstantiationListener)1 Behavior (org.apache.wicket.behavior.Behavior)1 MockApplication (org.apache.wicket.mock.MockApplication)1