Examples of JsException


Examples of com.google.jstestdriver.JsException

    browser.setName("TB");
    browser.setVersion("1");
    browser.setOs("os");
    printer.onTestComplete(testResult(browser, "passed", "", "", "A", "d", 1));
    printer.onTestComplete(testResult(browser, "failed", gson.toJson(new JsException("name", "abc",
        "fileName", 1L, "stack")), "", "B", "e", 2));
    printer.onTestComplete(testResult(browser, "error", gson.toJson(new JsException("name", "abc",
        "fileName", 1L, "stack")), "", "C", "f", 3));
    printer.finish();
    assertEquals(".FE" + NEW_LINE +
        "Total 3 tests (Passed: 1; Fails: 1; Errors: 1) (6.00 ms)" + NEW_LINE +
        "  TB 1 os: Run 3 tests (Passed: 1; Fails: 1; Errors 1) (6.00 ms)" + NEW_LINE +
View Full Code Here

Examples of com.google.jstestdriver.JsException

    browser.setName("TB");
    browser.setVersion("1");
    browser.setOs("os");
    printer.onTestComplete(testResult(browser, "passed", "", "[LOG] some log", "A", "d", 1));
    printer.onTestComplete(testResult(browser, "failed", gson.toJson(new JsException("name", "abc",
        "fileName", 1L, "stack")), "[LOG] failed log", "B", "e", 2));
    printer.onTestComplete(testResult(browser, "error", gson.toJson(new JsException("name", "abc",
        "fileName", 1L, "stack")), "[LOG] error log", "C", "f", 3));
    printer.finish();
    assertEquals(".FE" + NEW_LINE +
        "Total 3 tests (Passed: 1; Fails: 1; Errors: 1) (6.00 ms)" + NEW_LINE +
        "  TB 1 os: Run 3 tests (Passed: 1; Fails: 1; Errors 1) (6.00 ms)" + NEW_LINE +
View Full Code Here

Examples of com.google.jstestdriver.JsException

  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

Examples of com.google.jstestdriver.JsException

    browser.setName("TB");
    browser.setVersion("1");
    browser.setOs("os");
    printer.onTestComplete(testResult(browser, "passed", "", "[LOG] some log", "A", "d", 1));
    printer.onTestComplete(testResult(browser, "failed", gson.toJson(new JsException("name", "abc",
        "fileName", 1L, "stack")), "[LOG] failed log", "B", "e", 2));
    printer.onTestComplete(testResult(browser, "error", gson.toJson(new JsException("name", "abc",
        "fileName", 1L, "stack")), "[LOG] error log", "C", "f", 3));
    printer.finish();
    assertEquals("TB 1 os [PASSED] A.d" + NEW_LINE +
        "  [LOG] some log" + NEW_LINE +
        "TB 1 os [FAILED] B.e" + NEW_LINE +
View Full Code Here

Examples of com.google.jstestdriver.JsException

      startTestCase(testCaseName, testResult.getTestName(), testResult.getTime());
      if (testResult.getResult() != Result.passed) {
        String message;

        try {
          JsException exception = gson.fromJson(testResult.getMessage(), JsException.class);

          message = exception.getMessage();
        } catch (Exception e) {
          message = testResult.getMessage();
        }
        if (testResult.getResult() == TestResult.Result.failed) {
          addFailure(testResult.getStack(), message);
View Full Code Here

Examples of org.apache.shindig.gadgets.js.JsException

    List<String> features = ImmutableList.of("unknown");
    Uri resUri = Uri.parse("http://server.com/gadgets/js/foo");
    Capture<JsUri> uriCapture = new Capture<JsUri>();
    expect(jsUriManager.makeExternJsUri(capture(uriCapture))).andReturn(resUri);
    expect(jsPipeline.execute(EasyMock.isA(JsRequest.class))).andThrow(
            new JsException(404, "error"));
    GadgetsHandlerApi.JsRequest request = createJsRequest(FakeProcessor.SPEC_URL.toString(),
            CONTAINER, fields, features, null);
    expect(request.getOnload()).andStubReturn("do this");
    expect(request.getContext()).andStubReturn(GadgetsHandlerApi.RenderingContext.CONTAINER);
    replay();
View Full Code Here

Examples of org.apache.shindig.gadgets.js.JsException

    JSONObject request = makeComplexJsRequest(features, loadedFeatures, onload, null);

    Capture<JsUri> captureUri = new Capture<JsUri>();
    EasyMock.expect(jsUriManager.makeExternJsUri(EasyMock.capture(captureUri))).andReturn(jsUri);
    EasyMock.expect(jsPipeline.execute(EasyMock.isA(JsRequest.class))).andThrow(
            new JsException(404, "not found"));
    replay();

    RpcHandler operation = registry.getRpcHandler(request);
    Object responseObj = operation.execute(emptyFormItems, authContext, converter).get();
    JSONObject results = new JSONObject(converter.convertToString(responseObj));
View Full Code Here

Examples of org.apache.shindig.gadgets.js.JsException

    JSONObject request = makeComplexJsRequest(features, loadedFeatures, onload, null);

    Capture<JsUri> captureUri = new Capture<JsUri>();
    EasyMock.expect(jsUriManager.makeExternJsUri(EasyMock.capture(captureUri))).andReturn(jsUri);
    EasyMock.expect(jsPipeline.execute(EasyMock.isA(JsRequest.class))).andThrow(
            new JsException(404, "not found"));
    replay();

    RpcHandler operation = registry.getRpcHandler(request);
    Object responseObj = operation.execute(emptyFormItems, authContext, converter).get();
    JSONObject results = new JSONObject(converter.convertToString(responseObj));
View Full Code Here

Examples of org.apache.shindig.gadgets.js.JsException

    List<String> features = ImmutableList.of("unknown");
    Uri resUri = Uri.parse("http://server.com/gadgets/js/foo");
    Capture<JsUri> uriCapture = new Capture<JsUri>();
    expect(jsUriManager.makeExternJsUri(capture(uriCapture))).andReturn(resUri);
    expect(jsPipeline.execute(EasyMock.isA(JsRequest.class))).andThrow(
            new JsException(404, "error"));
    GadgetsHandlerApi.JsRequest request = createJsRequest(FakeProcessor.SPEC_URL.toString(),
            CONTAINER, fields, features, null);
    expect(request.getOnload()).andStubReturn("do this");
    expect(request.getContext()).andStubReturn(GadgetsHandlerApi.RenderingContext.CONTAINER);
    replay();
View Full Code Here

Examples of org.apache.shindig.gadgets.js.JsException

    JSONObject request = makeComplexJsRequest(features, loadedFeatures, onload, null);

    Capture<JsUri> captureUri = new Capture<JsUri>();
    EasyMock.expect(jsUriManager.makeExternJsUri(EasyMock.capture(captureUri))).andReturn(jsUri);
    EasyMock.expect(jsPipeline.execute(EasyMock.isA(JsRequest.class))).andThrow(
            new JsException(404, "not found"));
    replay();

    RpcHandler operation = registry.getRpcHandler(request);
    Object responseObj = operation.execute(emptyFormItems, authContext, converter).get();
    JSONObject results = new JSONObject(converter.convertToString(responseObj));
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.