Package com.google.jstestdriver

Examples of com.google.jstestdriver.TestResult


    Response response = new Response();
    response.setType(ResponseType.TEST_RESULT.name());
    Gson gson = new Gson();
    BrowserInfo browser = new BrowserInfo();
    browser.setName(browserId);
    TestResult testResult = new TestResult(browser, "passed", "passed", "log",
        "test.Foo", "Foo", 1f);
   
    List<FileCoverage> expectedFileCoverage =
        Arrays.asList(new FileCoverage(-1, Lists.newArrayList(new CoveredLine(1, 1))));
    CoverageAccumulator expected = new CoverageAccumulator();
    expected.add(browserId, expectedFileCoverage);
    testResult.getData().put(CoverageTestResponseStream.COVERAGE_DATA_KEY,
        "[[-1,[[1,1]]]]");
    response.setResponse(gson.toJson(Arrays.asList(testResult)));

    stream.stream(response);
    assertEquals(expected, accumulator);
View Full Code Here


    Response response = new Response();
    response.setType(ResponseType.TEST_RESULT.name());
    Gson gson = new Gson();
    BrowserInfo browser = new BrowserInfo();
    browser.setName(browserId);
    TestResult testResult = new TestResult(browser, "passed", "passed", "log",
      "test.Foo", "Foo", 1f);
   
    CoverageAccumulator expected = new CoverageAccumulator();
    response.setResponse(gson.toJson(Arrays.asList(testResult)));
   
View Full Code Here

    browser.setName("TB");
    browser.setVersion("1");
    browser.setOs("os");
    printer.setLineLength(1);
    TestResult result = new TestResult(browser, "passed", "", "", "", "", 0);

    printer.onTestComplete(result);
    printer.onTestComplete(result);
    printer.onTestComplete(result);
    assertEquals("." + NEW_LINE + "." + NEW_LINE + "." + NEW_LINE, buf.toString());
View Full Code Here

        "      [LOG] error log" + NEW_LINE, buf.toString());
  }
 
  private TestResult testResult(BrowserInfo browser, String result, String message, String log,
      String testCaseName, String testName, float time) {
    final TestResult testResult =
      new TestResult(browser, result, message, log, testCaseName, testName, time);
    if (!"passed".equals(result)) {
      final JsException exception = gson.fromJson(message, JsException.class);
     
      testResult.setParsedMessage(exception.getMessage());
      testResult.setStack(exception.getStack());
    }
    return testResult;
  }
View Full Code Here

TOP

Related Classes of com.google.jstestdriver.TestResult

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.