Beispiel #1
0
  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;
  }
Beispiel #2
0
  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);
  }
Beispiel #3
0
 public WindowOperationsHandler getWindowOperationsHandler() {
   return gwtModuleRunner.getWindowOperationsHandler();
 }
Beispiel #4
0
 public ServletConfig getServletConfig() {
   return gwtModuleRunner.getServletConfig();
 }
Beispiel #5
0
 public GwtLogHandler getLogHandler() {
   return gwtModuleRunner.getLogHandler();
 }
Beispiel #6
0
 public String getHostPagePath() {
   return gwtModuleRunner.getHostPagePath();
 }
Beispiel #7
0
 public BrowserErrorHandler getBrowserErrorHandler() {
   return gwtModuleRunner.getBrowserErrorHandler();
 }
Beispiel #8
0
  private void setupDebugIdImpl(GwtModuleRunner gwtModuleRunner) {
    DebugIdImpl debugIdImplToUse =
        gwtModuleRunner.ensureDebugId() ? enabledInstance : disabledInstance;

    GwtReflectionUtils.setStaticField(UIObject.class, "debugIdImpl", debugIdImplToUse);
  }