private String getCheckedModuleName() { String moduleName = gwtModuleRunner.getModuleName(); if (moduleName == null || "".equals(moduleName.trim())) { throw new GwtTestConfigurationException( "The tested module name returned by " + gwtModuleRunner.getClass().getName() + ".getModuleName() should not be null or empty"); } String moduleAlias = ModuleData.get().getModuleAlias(moduleName); if (moduleAlias == null) { throw new GwtTestConfigurationException( "The tested module '" + moduleName + "' has not been found. Did you forget to declare a 'module-file' property in your 'META-INF/gwt-test-utils.properties' configuration file ?"); } return moduleAlias; }
private void setupInstance(GwtModuleRunner gwtModuleRunner) { if (this.gwtModuleRunner != null) { throw new GwtTestException( "Because of the single-threaded nature of the GWT environment, gwt-test-utils tests can not be run in multiple thread at the same time"); } this.gwtModuleRunner = gwtModuleRunner; this.checkedModuleName = getCheckedModuleName(); setLocale(gwtModuleRunner.getLocale()); setupDebugIdImpl(gwtModuleRunner); if (gwtModuleRunner.getHostPagePath() == null) { LOGGER.warn( "Cannot find the actual HTML host page for module '" + gwtModuleRunner.getModuleName() + "'. You should override " + GwtModuleRunner.class.getName() + ".getHostPagePath(String moduleFullQualifiedName) method to specify it."); } AfterTestCallbackManager.get().registerCallback(this); }
public WindowOperationsHandler getWindowOperationsHandler() { return gwtModuleRunner.getWindowOperationsHandler(); }
public ServletConfig getServletConfig() { return gwtModuleRunner.getServletConfig(); }
public GwtLogHandler getLogHandler() { return gwtModuleRunner.getLogHandler(); }
public String getHostPagePath() { return gwtModuleRunner.getHostPagePath(); }
public BrowserErrorHandler getBrowserErrorHandler() { return gwtModuleRunner.getBrowserErrorHandler(); }
private void setupDebugIdImpl(GwtModuleRunner gwtModuleRunner) { DebugIdImpl debugIdImplToUse = gwtModuleRunner.ensureDebugId() ? enabledInstance : disabledInstance; GwtReflectionUtils.setStaticField(UIObject.class, "debugIdImpl", debugIdImplToUse); }