Package com.google.jstestdriver.model

Examples of com.google.jstestdriver.model.ConcretePathPrefix


    List<Failure> failures = new FailureParser(new NullPathPrefix()).parse(jsonFailures);
    assertEquals(failure1, failures.get(0));
  }

  public void testParsePrefixedPathStack() throws Exception {
    ConcretePathPrefix prefix = new ConcretePathPrefix("/jstd");
    String name1 = "TypeError";
    String message1 = "Whut?";
    List<String> stack1 =
        Lists.newArrayList(
          "http://someweb.com:8080" + prefix.prefixPath("/static/asserts.js"),
          "http://someweb.com:8080" + prefix.prefixPath("/test/foo.js"));
    Failure failure1 =
        new Failure(String.format("%s: %s", name1, message1), Lists.newArrayList(stack1.get(1)));

    String jsonFailures =
        gson.toJson(Lists.newArrayList(new JsException(name1, message1, "doof.js", 1l, Joiner.on(
View Full Code Here


  public void testGetServerFromFlag() throws Exception {
    // String configServer = "configServer";
    String flagServer = "flagServer";
    final DefaultConfiguration config = new DefaultConfiguration(new BasePaths(new File(".")));
    assertEquals(flagServer, config.getServer(flagServer, -1, new NullPathPrefix()));
    final ConcretePathPrefix prefix = new ConcretePathPrefix("jstd");
    assertEquals(prefix.suffixServer(flagServer), config.getServer(flagServer, -1, prefix));
  }
View Full Code Here

    Map<String, String> parameters = ImmutableMap.<String, String>builder()
      .put(SlavePageRequest.ID, "1")
      .put(CaptureHandler.RUNNER_TYPE, RunnerType.CLIENT.toString())
      .build();
    String jstd = "jstd";
    HandlerPathPrefix prefix = new ConcretePathPrefix(jstd);
    CapturedBrowsers capturedBrowsers = new CapturedBrowsers(new BrowserIdStrategy(new MockTime(0l)));
    capturedBrowsers.addSlave(new SlaveBrowser(new MockTime(0l), "123", null, 0l, prefix, null, null, null, null));
    SlavePageRequest request = new SlavePageRequest(parameters, null, prefix, capturedBrowsers);
    CharArrayWriter writer = new CharArrayWriter();
    final HtmlWriter htmlWriter =
View Full Code Here

    String flagServer = "flagServer";
    final ParsedConfiguration config =
        new ParsedConfiguration(null, null, null, configServer, 0, null, null, null, null);
    assertEquals(flagServer, config.getServer(flagServer, -1, new NullPathPrefix()));
    assertEquals(configServer, config.getServer("", -1, new NullPathPrefix()));
    final ConcretePathPrefix prefix = new ConcretePathPrefix("jstd");
    assertEquals(prefix.suffixServer(flagServer), config.getServer(flagServer, -1, prefix));
    assertEquals(prefix.suffixServer(configServer), config.getServer("", -1, prefix));
  }
View Full Code Here

  }

  @Option(name="--serverHandlerPrefix",
      usage="Whether the handlers will be prefixed with jstd")
  public void setServerHandlerPrefix(String serverHandlerPrefix) {
    this.serverHandlerPrefix = new ConcretePathPrefix(serverHandlerPrefix.startsWith("/") ?
        serverHandlerPrefix.substring(1) : serverHandlerPrefix);
  }
View Full Code Here

  public void stopServer() {
    // TODO(corysmith): refactor these to do less hacking.
    CmdLineFlag handlerPrefixFlag = findServerHandlerPrefixFlag();
    HandlerPathPrefix prefix = new NullPathPrefix();
    if (handlerPrefixFlag != null) {
      prefix = new ConcretePathPrefix(handlerPrefixFlag.value);
    }
    StringBuilder urlBuilder =
        new StringBuilder(defaultConfiguration.getServer(serverAddress, port, prefix));
    urlBuilder.append("/");
    urlBuilder.append("quit");
View Full Code Here

TOP

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

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.