Package com.google.jstestdriver

Examples of com.google.jstestdriver.Plugin


  }

  public void testParsePlugin() throws IOException {
    String jarPath = "pathto.jar";
    File jar = createTmpFile(this.tmpDirs.iterator().next(), jarPath);
    Plugin expected = new Plugin("test", jar.getAbsolutePath(), "com.test.PluginModule",
        Lists.<String>newArrayList());
    String configFile =
        String.format("plugin:\n  - name: %s\n    jar: \"%s\"\n    module: \"%s\"\n",
            "test",
            jarPath,
View Full Code Here


    String jarPath = "pathto.jar";
    String jarPath2 = "pathto.jar2";
    File jar = createTmpFile(this.tmpDirs.iterator().next(), jarPath);
    File jar2 = createTmpFile(this.tmpDirs.iterator().next(), jarPath2);
    List<Plugin> expected = new LinkedList<Plugin>(Arrays.asList(
      new Plugin("test", jar.getAbsolutePath(), "com.test.PluginModule",
        Lists.<String> newArrayList()),
      new Plugin("test2", jar2.getAbsolutePath(), "com.test.PluginModule2",
        Lists.<String> newArrayList("hello", "world", "some/file.js"))));
    String configFile = String.format("plugin:\n" + "  - name: test\n"
      + "    jar: \"%s\"\n" + "    module: \"com.test.PluginModule\"\n"
      + "  - name: test2\n" + "    jar: \"%s\"\n"
      + "    module: \"com.test.PluginModule2\"\n"
View Full Code Here

    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());
    assertEquals("hello", args.get(0));
    assertEquals("mooh", args.get(1));
    assertEquals("some/file.js", args.get(2));
View Full Code Here

    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

    assertTrue(listFiles.get(1).toString(),
        listFiles.get(1).getFilePath().replace(File.separatorChar, '/').endsWith("code/patch.js"));
  }

  public void testParsePlugin() {
    Plugin expected = new Plugin("test", "pathtojar", "com.test.PluginModule",
      Lists.<String> newArrayList());
    String configFile = "plugin:\n" + "  - name: test\n"
      + "    jar: \"pathtojar\"\n" + "    module: \"com.test.PluginModule\"\n";
    ByteArrayInputStream bais = new ByteArrayInputStream(configFile.getBytes());
    ConfigurationParser parser = new YamlParser();
View Full Code Here

    List<Plugin> plugins = config.getPlugins();
    assertEquals(expected, plugins.get(0));
  }

  public void testParsePlugins() {
    List<Plugin> expected = new LinkedList<Plugin>(Arrays.asList(new Plugin(
      "test", "pathtojar", "com.test.PluginModule", Lists
        .<String> newArrayList()), new Plugin("test2", "pathtojar2",
      "com.test.PluginModule2", Lists.<String> newArrayList("hello", "world",
        "some/file.js"))));
    String configFile = "plugin:\n" + "  - name: test\n"
      + "    jar: \"pathtojar\"\n" + "    module: \"com.test.PluginModule\"\n"
      + "  - name: test2\n" + "    jar: \"pathtojar2\"\n"
View Full Code Here

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

    Configuration config = parser.parse(new InputStreamReader(bais), null);
    List<Plugin> plugins = config.getPlugins();
    Plugin plugin = plugins.get(0);
    List<String> args = plugin.getArgs();

    assertEquals(4, args.size());
    assertEquals("hello", args.get(0));
    assertEquals("mooh", args.get(1));
    assertEquals("some/file.js", args.get(2));
View Full Code Here

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

    Configuration config = parser.parse(new InputStreamReader(bais), null);
    List<Plugin> plugins = config.getPlugins();
    Plugin plugin = plugins.get(0);
    List<String> args = plugin.getArgs();

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

  public List<Plugin> getPlugins() throws IOException {
    for (CmdLineFlag cmdLineFlag : flags) {
      if ("--plugins".equals(cmdLineFlag.flag)) {
        List<Plugin> plugins = Lists.newLinkedList();
        for (String pluginPath : cmdLineFlag.valuesList()) {
          plugins.add(new Plugin(null, pluginPath, null,
              Collections.<String> emptyList()));
        }
        return plugins;
      }
    }
View Full Code Here

   */
  public static void wipeCoveragePlugin(@NotNull ParsedConfiguration configuration) {
    ManifestLoader manifestLoader = new ManifestLoader();
    Iterator<Plugin> iterator = configuration.getPlugins().iterator();
    while (iterator.hasNext()) {
      Plugin plugin = iterator.next();
      if (isCoveragePlugin(plugin, manifestLoader)) {
        iterator.remove();
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.google.jstestdriver.Plugin

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.