use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class FilenameWithVersionResourceCachingStrategyTest method testUrlVersionStoredInRequestCycle.
@Test
public void testUrlVersionStoredInRequestCycle() {
WicketTester tester = new WicketTester();
tester.getApplication().getResourceSettings().setCachingStrategy(strategy);
try {
ResourceUrl resourceUrl = new ResourceUrl("some-resource--vers--" + TEST_RESOURCE_VERSION + ".txt", new PageParameters());
strategy.undecorateUrl(resourceUrl);
String version = tester.getRequestCycle().getMetaData(IResourceCachingStrategy.URL_VERSION);
assertEquals(TEST_RESOURCE_VERSION, version);
} finally {
tester.destroy();
}
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class CustomHomePageTest method customHomePage.
/**
* Tests mounting of a custom home page via {@link WebApplication#mountPage(String, Class)}
*/
@Test
public void customHomePage() {
final WebApplication dummyApplication = new DummyApplication() {
/**
* @see org.apache.wicket.protocol.http.WebApplication#init()
*/
@Override
protected void init() {
super.init();
// the following two lines do identical things
// getRootRequestMapperAsCompound().add(new HomePageMapper(CustomHomePage.class));
mountPage("/", CustomHomePage.class);
}
};
final WicketTester tester = new WicketTester(dummyApplication);
requestHomePage(tester);
tester.assertRenderedPage(CustomHomePage.class);
tester.destroy();
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class StringResourceLoaderTestBase method before.
/**
* @throws Exception
*/
@Before
public void before() throws Exception {
tester = new WicketTester(new DummyApplication());
component = new DummyComponent("test", tester.getApplication());
DummyPage page = new DummyPage();
page.add(component);
loader = createLoader();
}
use of org.apache.wicket.util.tester.WicketTester in project wicket-orientdb by OrienteerBAP.
the class WicketOrientDbFilterTesterScope method apply.
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
WicketTester tester = create();
List<OClass> testClasses = Lists.newArrayList();
try {
testClasses = initTestClasses();
base.evaluate();
} finally {
deleteClassesAndDocuments(testClasses);
tester.destroy();
}
}
};
}
use of org.apache.wicket.util.tester.WicketTester in project openmeetings by apache.
the class AbstractWicketTester method getWicketTester.
public static WicketTester getWicketTester(Application app, long langId) {
// to ensure WebSession is attached
ensureApplication(langId);
WicketTester tester = new WicketTester(app, app.getServletContext(), false);
return tester;
}
Aggregations