List of usage examples for org.apache.wicket.protocol.http WebApplication getName
public final String getName()
From source file:org.dcm4chee.web.war.WASPTestUtil.java
License:LGPL
public static WicketTester getWicketTester(WebApplication testApplicaton) throws URISyntaxException { if (actionKey != null) { HiveMind.unregisterHive(hiveKey); Actions.unregisterActionFactory(actionKey); actionKey = hiveKey = null;/*from www. j a v a 2s .co m*/ } String contextPath = new java.io.File(WASPTestUtil.class.getResource("WASPTestUtil.class").toURI()) .getParent(); WicketTester wicketTester = new WicketTester(testApplicaton, contextPath); if (actionKey == null) { hiveKey = "hive_" + testApplicaton.getName(); actionKey = testApplicaton.getClass().getName() + ":" + hiveKey; } MockServletContext ctx = (MockServletContext) wicketTester.getApplication().getServletContext(); ctx.addInitParameter("securityDomainName", "dcm4chee"); ctx.addInitParameter("rolesGroupName", "Roles"); URL url = WASPTestUtil.class.getResource("/wicket.login.file"); //Set login configuration file! '=' means: overwrite other login configuration given in Java security properties file. System.setProperty("java.security.auth.login.config", "=" + url.getPath()); return wicketTester; }