Examples of PathResolver


Examples of com.google.jstestdriver.PathResolver

      + "exclude:\n" + "- code/code2.js\n" + "- test/test2.js";
    ByteArrayInputStream bais = new ByteArrayInputStream(configFile.getBytes());
    ConfigurationParser parser = new YamlParser();
    try {
      parser.parse(new InputStreamReader(bais), null).resolvePaths(
          new PathResolver(tmpDirs, Collections.<FileParsePostProcessor>emptySet(),
              new DisplayPathSanitizer()), createFlags());
      fail("should have thrown an exception due to patching a non-existant file");
    } catch (IllegalStateException e) {
      // pass
    }
View Full Code Here

Examples of com.google.jstestdriver.PathResolver

    ByteArrayInputStream bais = new ByteArrayInputStream(configFile.getBytes());
    ConfigurationParser parser = new YamlParser();

    Configuration config =
        parser.parse(new InputStreamReader(bais), null).resolvePaths(
            new PathResolver(tmpDirs, Collections.<FileParsePostProcessor>emptySet(),
                new DisplayPathSanitizer()), createFlags());
    List<Plugin> plugins = config.getPlugins();
    assertEquals(expected, plugins.get(0));
  }
View Full Code Here

Examples of com.google.jstestdriver.PathResolver

      + "    args: hello, world, some/file.js\n", jarPath, jarPath2);
    ByteArrayInputStream bais = new ByteArrayInputStream(configFile.getBytes());
    ConfigurationParser parser = new YamlParser();

    Configuration config = parser.parse(new InputStreamReader(bais), null)
        .resolvePaths(new PathResolver(tmpDirs, Collections.<FileParsePostProcessor> emptySet(), new DisplayPathSanitizer()), createFlags());
    List<Plugin> plugins = config.getPlugins();

    assertEquals(2, plugins.size());
    assertEquals(expected, plugins);
    assertEquals(0, plugins.get(0).getArgs().size());
View Full Code Here

Examples of com.google.jstestdriver.PathResolver

      + "    args: hello, mooh, some/file.js, another/file.js";
    ByteArrayInputStream bais = new ByteArrayInputStream(configFile.getBytes());
    ConfigurationParser parser = new YamlParser();

    Configuration config = parser.parse(new InputStreamReader(bais), null).resolvePaths(
        new PathResolver(tmpDirs, Collections.<FileParsePostProcessor> emptySet(), new DisplayPathSanitizer()), createFlags());
    List<Plugin> plugins = config.getPlugins();
    Plugin plugin = plugins.get(0);
    List<String> args = plugin.getArgs();

    assertEquals(4, args.size());
View Full Code Here

Examples of com.google.jstestdriver.PathResolver

      + "    jar: \"pathtojar\"\n" + "    module: \"com.test.PluginModule\"\n";
    ByteArrayInputStream bais = new ByteArrayInputStream(configFile.getBytes());
    ConfigurationParser parser = new YamlParser();

    Configuration config = parser.parse(new InputStreamReader(bais), null).resolvePaths(
        new PathResolver(tmpDirs, Collections.<FileParsePostProcessor> emptySet(), new DisplayPathSanitizer()), createFlags());
    List<Plugin> plugins = config.getPlugins();
    Plugin plugin = plugins.get(0);
    List<String> args = plugin.getArgs();

    assertEquals(0, args.size());
View Full Code Here

Examples of com.google.jstestdriver.PathResolver

      + " - code/code2.js\n" + " - test/test2.js";
    ByteArrayInputStream bais = new ByteArrayInputStream(configFile.getBytes());
    ConfigurationParser parser = new YamlParser();

    Configuration config = parser.parse(new InputStreamReader(bais), null).resolvePaths(
        new PathResolver(tmpDirs, Collections.<FileParsePostProcessor> emptySet(), new DisplayPathSanitizer()), createFlags());
    Set<FileInfo> serveFilesSet = config.getFilesList();
    List<FileInfo> serveFiles = new ArrayList<FileInfo>(serveFilesSet);

    assertEquals(4, serveFilesSet.size());
    assertTrue(serveFiles.get(0).getFilePath().replace(File.separatorChar, '/').endsWith("code/code.js"));
View Full Code Here

Examples of com.google.jstestdriver.PathResolver

      + " - code/code2.js\n - test/test2.js";
    ByteArrayInputStream bais = new ByteArrayInputStream(configFile.getBytes());
    ConfigurationParser parser = new YamlParser();

    Configuration config = parser.parse(new InputStreamReader(bais), null).resolvePaths(
        new PathResolver(tmpDirs, Collections.<FileParsePostProcessor> emptySet(), new DisplayPathSanitizer()), createFlags());
    Set<FileInfo> files = config.getFilesList();
    List<FileInfo> listFiles = new ArrayList<FileInfo>(files);

    assertEquals(3, files.size());
    assertTrue(listFiles.get(0).getTimestamp() > 0);
View Full Code Here

Examples of com.google.jstestdriver.PathResolver

    ByteArrayInputStream bais = new ByteArrayInputStream(configFile.getBytes());
    ConfigurationParser parser = new YamlParser();

    try {
      parser.parse(new InputStreamReader(bais), null)
          .resolvePaths(new PathResolver(tmpDirs, Collections.<FileParsePostProcessor> emptySet(), new DisplayPathSanitizer()), createFlags());
      fail("Exception not caught");
    } catch (UnreadableFilesException e) {
    }
  }
View Full Code Here

Examples of com.google.jstestdriver.PathResolver

    // test dir and file reside outside the base directory
    File absoluteDir = createTmpSubDir("absolute", tmpDirs.iterator().next());
    File absoluteFile = new File(absoluteDir, "file.js");
    absoluteFile.createNewFile();

    PathResolver pathResolver = new PathResolver(tmpDirs,
        Collections.<FileParsePostProcessor>emptySet(),
        new DisplayPathSanitizer());

    File result1 = pathResolver.resolvePath(absoluteFile.getAbsolutePath());
    assertEquals(absoluteFile, result1);
  }
View Full Code Here

Examples of com.google.jstestdriver.PathResolver

    subDir.mkdir();
    subDir.deleteOnExit();
   
    File otherDir = createTmpSubDir("other", tmpDirs.iterator().next());

    PathResolver pathResolver = new PathResolver(tmpDirs,
        Collections.<FileParsePostProcessor>emptySet(),
        new DisplayPathSanitizer());

    {
      File file = new File(dir, "../file.js");
      file.createNewFile();
      File result = pathResolver.resolvePath(file.getAbsolutePath());
      assertEquals(new File(tmpDirs.iterator().next(), "file.js"), result);
    }
    {
      File file = new File(subDir, "../../other/file.js");
      file.createNewFile();
      File result = pathResolver.resolvePath(file.getAbsolutePath());
      assertEquals(new File(otherDir, "file.js"), result);
    }

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.