use of org.apache.wicket.mock.MockApplication in project wicket by apache.
the class ApplicationSettingsTest method testLocalizer.
/**
*/
@Test
public void testLocalizer() {
MockApplication dummy = new MockApplication();
dummy.setName("test-app");
dummy.setServletContext(new MockServletContext(dummy, ""));
ThreadContext.setApplication(dummy);
dummy.initApplication();
Localizer localizer = dummy.getResourceSettings().getLocalizer();
Assert.assertNotNull("Localizer should be available", localizer);
dummy.internalDestroy();
}
use of org.apache.wicket.mock.MockApplication in project wicket by apache.
the class ApplicationSettingsTest method testFrameworkVersion.
/**
*/
@Test
public void testFrameworkVersion() {
FrameworkSettings settings = new FrameworkSettings(new MockApplication());
assertEquals("n/a", settings.getVersion());
}
use of org.apache.wicket.mock.MockApplication in project wicket by apache.
the class RestartResponseAtInterceptPageExceptionTest method newApplication.
@Override
protected WebApplication newApplication() {
return new MockApplication() {
@Override
protected void init() {
super.init();
getSecuritySettings().setAuthorizationStrategy(new AbstractPageAuthorizationStrategy() {
@Override
protected <T extends Page> boolean isPageAuthorized(Class<T> pageClass) {
if (pageClass != RedirectPage.class) {
RedirectPage intercept = new RedirectPage("http://example.com/path");
throw new RestartResponseAtInterceptPageException(intercept);
}
return true;
}
});
}
};
}
use of org.apache.wicket.mock.MockApplication in project wicket by apache.
the class AjaxEnclosureTest method newApplication.
@Override
protected WebApplication newApplication() {
WebApplication webApplication = new MockApplication() {
@Override
protected void init() {
super.init();
getMarkupSettings().setStripWicketTags(true);
}
};
return webApplication;
}
use of org.apache.wicket.mock.MockApplication in project wicket by apache.
the class TogglePageTest method newApplication.
@Override
protected WebApplication newApplication() {
WebApplication webApplication = new MockApplication() {
@Override
protected void init() {
super.init();
getMarkupSettings().setStripWicketTags(true);
}
};
return webApplication;
}
Aggregations