Package com.google.jstestdriver.util

Examples of com.google.jstestdriver.util.DisplayPathSanitizer


      + "    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


      + "    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

      + "    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

      + " - 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

      + " - 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

    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

    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

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

  public void testResolvePathFragment() throws Exception {
    File baseDir = createTmpSubDir("base", tmpDirs.iterator().next());

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

    File file = new File(baseDir, "file.js");
    file.createNewFile();
    File result1 = pathResolver.resolvePath("file.js");
    assertEquals(file.getAbsolutePath(), result1.getAbsolutePath());
View Full Code Here

    File baseDir = tmpDirs.iterator().next();
    File dir = createTmpSubDir("dir", 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("other/nowhere/../../dir/file.js");
    assertEquals(file, result);
View Full Code Here

TOP

Related Classes of com.google.jstestdriver.util.DisplayPathSanitizer

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.