use of org.apache.wicket.IPageManagerProvider 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.IPageManagerProvider 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.IPageManagerProvider 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);
}
};
}
};
}
};
}
use of org.apache.wicket.IPageManagerProvider 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);
}
};
}
};
}
Aggregations