use of org.apache.wicket.page.IPageManagerContext in project wicket by apache.
the class TestApp1 method init.
@Override
protected void init() {
getSharedResources().add("cancelButton", new DefaultButtonImageResource("Cancel"));
setPageManagerProvider(new DefaultPageManagerProvider(this) {
@Override
public IPageManager get(IPageManagerContext pageManagerContext) {
IDataStore dataStore = new HttpSessionDataStore(pageManagerContext, new PageNumberEvictionStrategy(100));
IPageStore pageStore = new DefaultPageStore(new JavaSerializer(getApplicationKey()), dataStore, getStoreSettings().getInmemoryCacheSize());
return new PageStoreManager(getName(), pageStore, pageManagerContext);
}
});
}
use of org.apache.wicket.page.IPageManagerContext in project wicket by apache.
the class TransparentWebMarkupContainerTest method ajaxUpdate.
/**
* Test case for <a href="https://issues.apache.org/jira/browse/WICKET-3719">WICKET-3719</a>
*/
@Test
public void ajaxUpdate() {
WicketTester wicketTester = new WicketTester() {
@Override
protected IPageManagerProvider newTestPageManagerProvider() {
return new IPageManagerProvider() {
@Override
public IPageManager apply(IPageManagerContext context) {
return new MockPageManager() {
@Override
public void touchPage(IManageablePage page) {
page = WicketObjects.cloneObject(page);
super.touchPage(page);
}
};
}
};
}
};
wicketTester.startPage(TransparentWithAjaxUpdatePage.class);
wicketTester.clickLink("link", true);
wicketTester.destroy();
}
use of org.apache.wicket.page.IPageManagerContext in project wicket by apache.
the class PageVersioningTest method setup.
/**
* setup()
*/
@Before
public void setup() {
final PageVersioningApplication application = new PageVersioningApplication();
wicketTester = new WicketTester(application) {
/**
* @see org.apache.wicket.util.tester.BaseWicketTester#newTestPageManagerProvider()
*/
@Override
protected IPageManagerProvider newTestPageManagerProvider() {
return new IPageManagerProvider() {
@Override
public IPageManager apply(IPageManagerContext pageManagerContext) {
final IDataStore dataStore = new InMemoryPageStore();
final AsynchronousDataStore asyncDS = new AsynchronousDataStore(dataStore, 100);
final DefaultPageStore pageStore = new DefaultPageStore(new JavaSerializer(application.getApplicationKey()), asyncDS, 40);
return new PageStoreManager(application.getName(), pageStore, pageManagerContext);
}
};
}
};
}
use of org.apache.wicket.page.IPageManagerContext in project wicket by apache.
the class TestApp2 method init.
@Override
protected void init() {
getSharedResources().add("cancelButton", new DefaultButtonImageResource("Cancel"));
setPageManagerProvider(new DefaultPageManagerProvider(this) {
@Override
public IPageManager get(IPageManagerContext pageManagerContext) {
IDataStore dataStore = new HttpSessionDataStore(pageManagerContext, new PageNumberEvictionStrategy(100));
IPageStore pageStore = new DefaultPageStore(new JavaSerializer(getApplicationKey()), dataStore, getStoreSettings().getInmemoryCacheSize());
return new PageStoreManager(getName(), pageStore, pageManagerContext);
}
});
}
use of org.apache.wicket.page.IPageManagerContext in project wicket by apache.
the class DontStoreNotRenderedPageTestCase method newWicketTester.
@Override
protected WicketTester newWicketTester(WebApplication app) {
app.getComponentInstantiationListeners().add(new IComponentInstantiationListener() {
@Override
public void onInstantiation(Component component) {
// WICKET-5546 behavior added before Page#init()
component.add(new Behavior() {
});
}
});
return new WicketTester(app) {
@Override
protected IPageManagerProvider newTestPageManagerProvider() {
return new IPageManagerProvider() {
@Override
public IPageManager apply(IPageManagerContext context) {
return new MockPageManager() {
@Override
public void touchPage(IManageablePage page) {
Assert.assertFalse("PageB should not be touched!", page instanceof PageB);
super.touchPage(page);
}
};
}
};
}
};
}
Aggregations