use of org.apache.wicket.mock.MockApplication in project wicket by apache.
the class ApplicationSettingsTest method testUseDefaultOnMissingResourceDefaultValue.
/**
* @throws Exception
*/
@Test
public void testUseDefaultOnMissingResourceDefaultValue() throws Exception {
ResourceSettings settings = new ResourceSettings(new MockApplication());
Assert.assertTrue("useDefaultOnMissingResource should default to true", settings.getUseDefaultOnMissingResource());
}
use of org.apache.wicket.mock.MockApplication in project wicket by apache.
the class ApplicationSettingsTest method testUseDefaultOnMissingResourceSetsCorrectly.
/**
* @throws Exception
*/
@Test
public void testUseDefaultOnMissingResourceSetsCorrectly() throws Exception {
ResourceSettings settings = new ResourceSettings(new MockApplication());
settings.setUseDefaultOnMissingResource(false);
Assert.assertFalse("useDefaultOnMissingResource should have been set to false", settings.getUseDefaultOnMissingResource());
}
use of org.apache.wicket.mock.MockApplication in project wicket by apache.
the class EnclosureTest method testRenderPage13.
/**
* @throws Exception
*/
@Test
public void testRenderPage13() throws Exception {
tester = new WicketTester(new MockApplication() {
@Override
protected void init() {
super.init();
// This should cause all SecuredContainer components to be hidden
getSecuritySettings().setAuthorizationStrategy(new IAuthorizationStrategy.AllowAllAuthorizationStrategy() {
@Override
public boolean isActionAuthorized(Component component, Action action) {
return !(component instanceof SecuredContainer_13);
}
});
}
});
executeTest(EnclosurePage_13.class, "EnclosurePageExpectedResult_13.html");
}
use of org.apache.wicket.mock.MockApplication in project wicket by apache.
the class CssPackageResourceTest method newApplication.
@Override
protected WebApplication newApplication() {
return new MockApplication() {
@Override
protected void init() {
super.init();
getResourceSettings().setCssCompressor(new ICssCompressor() {
@Override
public String compress(String original) {
return APP_COMPRESSED;
}
});
}
};
}
use of org.apache.wicket.mock.MockApplication in project wicket by apache.
the class CompressBundlesTest method newApplication.
@Override
protected WebApplication newApplication() {
return new MockApplication() {
@Override
protected void init() {
super.init();
// remove that setting to see the original (non-compressed) version of the bundle
getResourceSettings().setJavaScriptCompressor(new DefaultJavaScriptCompressor());
getResourceBundles().addJavaScriptBundle(CompressBundlesTest.class, "bundle.js", new JavaScriptResourceReference(CompressBundlesTest.class, "two.js"), new JavaScriptResourceReference(CompressBundlesTest.class, "one.js"));
}
};
}
Aggregations