use of org.apache.wicket.mock.MockApplication in project wicket by apache.
the class CssUrlReplacerTest method newApplication.
@Override
protected WebApplication newApplication() {
return new MockApplication() {
@Override
protected void init() {
super.init();
getResourceSettings().setCachingStrategy(new FilenameWithVersionResourceCachingStrategy("=VER=", new MessageDigestResourceVersion()) {
@Override
public void decorateUrl(ResourceUrl url, IStaticCacheableResource resource) {
url.setFileName(url.getFileName() + DECORATION_SUFFIX);
}
});
}
@Override
public Session newSession(Request request, Response response) {
Session newSession = super.newSession(request, response);
newSession.setLocale(Locale.ROOT);
return newSession;
}
};
}
use of org.apache.wicket.mock.MockApplication in project wicket by apache.
the class WebSocketTesterResourceTest method before.
@Before
public void before() {
TestWebSocketResource.ON_CONNECT_CALLED.set(false);
TestWebSocketResource.ON_CLOSE_CALLED.set(false);
ON_OUT_BINARY_CALLED.set(false);
ON_OUT_TEXT_CALLED.set(false);
WebApplication application = new MockApplication() {
@Override
protected void init() {
super.init();
getSharedResources().add(TestWebSocketResource.TEXT, new TestWebSocketResource(EXPECTED_TEXT));
getSharedResources().add(TestWebSocketResource.BINARY, new TestWebSocketResource(EXPECTED_BINARY, EXPECTED_OFFSET, EXPECTED_LENGTH));
}
};
tester = new WicketTester(application);
}
Aggregations