Package com.google.jstestdriver.config

Examples of com.google.jstestdriver.config.ConfigurationException


      return DocType.STRICT;
    }
    if (unparsed.startsWith("<!DOCTYPE")) {
      return new DocType(unparsed);
    }
    throw new ConfigurationException("Invalid custom doctype: " + unparsed);
  }
View Full Code Here


          if (filteredFiles == null || filteredFiles.length == 0) {
            String error = "The patterns/paths " + f  + " used in the configuration"
                + " file didn't match any file, the files patterns/paths need to be relative to"
                + " the configuration file.";
            throw new ConfigurationException(error);
          }
          Arrays.sort(filteredFiles, String.CASE_INSENSITIVE_ORDER);

          for (String filteredFile : filteredFiles) {
            FileInfo resolvedFile =
View Full Code Here

   * Builds a configured JsTestDriver instance, and possibly validates the
   * configuration.
   */
  public JsTestDriver build() throws AssertionError {
    if (configuration == null) {
      throw new ConfigurationException("A default configuration is required.");
    }
    // TODO(corysmith): add check to resolve the serverAddress and port issues.
    List<Module> plugins = Lists.newArrayList(pluginModules);
    plugins.add(new ListenerBindingModule(serverListeners, testListeners));
    List<Module> initializers =
View Full Code Here

   */
  @Override
  public void startServer() {
    // TODO(corysmith): refactor these to do less hacking.
    if (port == -1) {
      throw new ConfigurationException("Port not defined, cannot start local server.");
    }
    if (preload) {
      runConfigurationWithFlags(defaultConfiguration,
        createFlagsArray("--port", String.valueOf(port), "--preloadFiles"));
    } else {
View Full Code Here

  }

  private Configuration parseConfiguration(String path) {
    File configFile = new File(path);
    if (!configFile.exists()) {
      throw new ConfigurationException("Could not find " + configFile);
    }
    UserConfigurationSource userConfigurationSource = new UserConfigurationSource(configFile);
    return userConfigurationSource.parse(basePaths, new YamlParser());
  }
View Full Code Here

  }

  private Injector createRunnerInjector(
      Configuration config, String[] flags, Module... additionalRunTimeModules) {
    if (config == null) {
      throw new ConfigurationException("Configuration cannot be null.");
    }
    List<Module> initializeModules = Lists.newArrayList(initializerModules);
    BasePaths basePaths;
    try {
      // configure logging before we start seriously processing.
      LogManager.getLogManager().readConfiguration(runnerMode.getLogConfig());
      System.out.println("setting runnermode " + runnerMode);
      basePaths = getPathResolver(config);
      initializeModules.add(new InitializeModule(pluginLoader, basePaths, flagsParser,
          runnerMode));
    } catch (IOException e) {
      throw new ConfigurationException("Could not find " + config.getBasePaths(), e);
    }
    Injector initializeInjector = Guice.createInjector(initializeModules);

    List<Module> actionRunnerModules;
    actionRunnerModules =
View Full Code Here

    final ParsedConfiguration parsedConfiguration;
    try {
      parsedConfiguration = JstdConfigParsingUtils.parseConfiguration(configFile);
    } catch (Exception e) {
      throw new ConfigurationException("Configuration file parsing failed.\n" +
                                       "See http://code.google.com/p/js-test-driver/wiki/ConfigurationFile for clarification.\n\n" +
                                       "Details:", e);
    }
    final File singleBasePath = JstdConfigParsingUtils.getSingleBasePath(parsedConfiguration.getBasePaths(), configFile);
    myTreeManager.setCurrentBasePath(singleBasePath.getAbsolutePath());
View Full Code Here

TOP

Related Classes of com.google.jstestdriver.config.ConfigurationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.