Package com.google.jstestdriver.model

Examples of com.google.jstestdriver.model.BasePaths


        .setPort(8082)
        .build();
    jstd.startServer();
    startLatch.await(10, TimeUnit.SECONDS);
    assertTrue(testServerListener.serverStarted);
    Configuration configuration = new UserConfigurationSource(new File("./jsTestDriver.conf")).parse(new BasePaths(new File(".")), new YamlParser());
    jstd.getTestCasesFor(configuration);
    jstd.stopServer();
    stopLatch.await(10, TimeUnit.SECONDS);
    assertTrue(testServerListener.serverStopped);
  }
View Full Code Here


    }
  }

  private final class TestConfiguration extends DefaultConfiguration {
    public TestConfiguration(File basePath) {
      super(new BasePaths(basePath));
    }
View Full Code Here

      + " - code/code2.js\n"
      + " - test/test2.js";
    ByteArrayInputStream bais = new ByteArrayInputStream(configFile.getBytes());
    ConfigurationParser parser = new YamlParser();
   
    Configuration config = parser.parse(new InputStreamReader(bais), new BasePaths());
    Set<FileInfo> serveFilesSet = config.getFilesList();
    List<FileInfo> serveFiles = Lists.newArrayList(serveFilesSet);
   
    assertEquals(2, serveFilesSet.size());
    assertTrue(serveFiles.get(0).getFilePath().replace(File.separatorChar, '/').endsWith("code/*.js"));
 
View Full Code Here

  public ConfigurationParser(File basePath, Reader configReader, PathRewriter pathRewriter) {
    this.basePath = basePath;
    this.configReader = configReader;
    this.pathRewriter = pathRewriter;
    pathResolver =
        new PathResolver(new BasePaths(basePath), Collections.<FileParsePostProcessor>emptySet(), new DisplayPathSanitizer());
  }
View Full Code Here

  }

  private BasePaths getBasePathNoDefault() throws IOException {
    for (CmdLineFlag cmdLineFlag : flags) {
      if ("--basePath".equals(cmdLineFlag.flag)) {
        BasePaths paths = new BasePaths();
        for (String stringPath : cmdLineFlag.valuesList()) {
          paths.add(new File(stringPath).getCanonicalFile());
        }
        return paths;
      }
    }
    return null;
View Full Code Here

    }
    return new DefaultConfigurationSource();
  }

  public BasePaths getBasePath() throws IOException {
    final BasePaths basePaths = getBasePathNoDefault();
    if (basePaths != null) {
      return basePaths;
    }
    return new BasePaths(getConfigurationSource().getParentFile());
  }
View Full Code Here

  private ResolvedConfiguration resolveConfiguration() throws ExecutionException {
    VirtualFile configVirtualFile = VfsUtil.findFileByIoFile(myConfigFile, false);
    if (configVirtualFile == null) {
      throw new ExecutionException("Cannot find JsTestDriver configuration file " + myConfigFile.getAbsolutePath());
    }
    BasePaths dirBasePaths = new BasePaths(myConfigFile.getParentFile());
    final byte[] content;
    try {
      content = configVirtualFile.contentsToByteArray();
    }
    catch (IOException e) {
View Full Code Here

  private static final String COVERAGE_MODULE_NAME = "com.google.jstestdriver.coverage.CoverageModule";

  private JstdConfigParsingUtils() {}

  public static ParsedConfiguration parseConfiguration(@NotNull File configFile) {
    BasePaths basePaths = new BasePaths(configFile.getParentFile());
    ConfigurationSource configurationSource = new UserConfigurationSource(configFile);
    Configuration configuration = configurationSource.parse(basePaths, new YamlParser());
    return (ParsedConfiguration) configuration;
  }
View Full Code Here

      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);
View Full Code Here

    return null;
  }

  // TODO(corysmith): make this go away by resolving the multiple basePath issue.
  private BasePaths getPathResolver(Configuration config) {
    BasePaths mergedPaths = new BasePaths();
   
    for (int i = 0; i < defaultFlags.length; i++) {
      if ("--basePath".equals(defaultFlags[i])) {
        if (i + 1 < defaultFlags.length) {
          for (String path : defaultFlags[i + 1].split(",")) {
            mergedPaths.add(new File(path));
          }
        }
        break;
      }
    }
    mergedPaths = mergedPaths.merge(basePaths);
    return mergedPaths.merge(config.getBasePaths());
  }
View Full Code Here

TOP

Related Classes of com.google.jstestdriver.model.BasePaths

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.