use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class AnnotationsRoleTest method testAuthorized.
/**
* @throws Exception
*/
@Test
public void testAuthorized() throws Exception {
WicketTester tester = new WicketTester();
tester.getApplication().getSecuritySettings().setAuthorizationStrategy(new RoleAuthorizationStrategy(new UserRolesAuthorizer("ADMIN")));
tester.startPage(AdminPage.class);
tester.assertRenderedPage(AdminPage.class);
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class ArquillianContainerProvidedTest method testNullApplication.
/**
* Null application to test error.
*/
@Test
public void testNullApplication() {
try {
log.info("Trying to use a null application.");
setWicketTester(new WicketTester(null, false));
fail("WebApplication cannot be null");
} catch (IllegalArgumentException iax) {
assertEquals("Argument 'application' may not be null.", iax.getMessage());
}
assertNull(wicketTester);
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class ArquillianContainerProvidedTest method testFindResourcesServletContextFromContainer.
/**
* Using container's servlet context and/or filter provided configured in web.xml and using Arquillian.
*/
@Test
public void testFindResourcesServletContextFromContainer() throws MalformedURLException {
WebApplication webApplication = useServletContextContainer();
setWicketTester(new WicketTester(webApplication, webApplication.getServletContext(), false));
findResourcesServletContext();
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class ArquillianContainerProvidedTest method testFindResourcesWebApplicationFromContainer.
/**
* Using container's servlet context and/or filter provided configured in web.xml and using Arquillian.
*/
@Test
public void testFindResourcesWebApplicationFromContainer() throws MalformedURLException {
WebApplication webApplication = useServletContextContainer();
setWicketTester(new WicketTester(webApplication, false));
findResourcesServletContext();
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class LocalizerTest method setUp.
/**
* @throws Exception
*/
@Before
public void setUp() throws Exception {
tester = new WicketTester(new DummyApplication());
settings = tester.getApplication().getResourceSettings();
localizer = tester.getApplication().getResourceSettings().getLocalizer();
}
Aggregations