Package com.linkedin.parseq.trace.codec.json

Examples of com.linkedin.parseq.trace.codec.json.JsonTraceCodec


    System.out.println();
    System.out.println("JSON Trace:");

    try
    {
      System.out.println(new JsonTraceCodec().encode(trace));
    }
    catch (IOException e)
    {
      System.err.println("Failed to encode JSON");
      e.printStackTrace();
View Full Code Here


                                                               RequestExecutionCallback<RestResponse> callback)
                                    {
                                      RestResponse response = EasyMock.createMock(RestResponse.class);
                                      RequestExecutionReportBuilder executionReportBuilder =
                                         new RequestExecutionReportBuilder();
                                      JsonTraceCodec jsonTraceCodec = new JsonTraceCodec();
                                      Trace t = null;

                                      try
                                      {
                                        t = jsonTraceCodec.decode(TEST_TRACE);
                                        executionReportBuilder.setParseqTrace(t);
                                      }
                                      catch (IOException exc)
                                      {
                                        //test will fail later
View Full Code Here

      Trace trace = executionReport.getParseqTrace();

      if (trace != null)
      {
        //Serialize the Parseq trace into JSON.
        JsonTraceCodec traceCodec = new JsonTraceCodec();
        traceCodec.encode(trace, outputStream);
      }
    }
    catch (IOException exception)
    {
      callback.onError(new RestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR, exception));
View Full Code Here

      if (trace != null)
      {
        //Serialize the Parseq trace into JSON and then inject a javascript into the response
        //which will call the corresponding render function on the entry page html with the JSON
        //string.
        JsonTraceCodec traceCodec = new JsonTraceCodec();
        IOUtils.write(createTraceRenderScript(traceCodec.encode(trace)),
                      outputStream);
      }
    }
    catch (IOException exception)
    {
View Full Code Here

    List<String> contentTypeValues = restResponse.getHeaderValues(RestConstants.HEADER_CONTENT_TYPE);
    Assert.assertTrue(contentTypeValues.size() == 1);
    Assert.assertEquals(contentTypeValues.get(0), HEADER_VALUE_APPLICATION_JSON);
    InputStream traceRawStream = restResponse.getEntity().asInputStream();

    JsonTraceCodec codec = new JsonTraceCodec();

    try
    {
      Trace trace = codec.decode(traceRawStream);
      Assert.assertNotNull(trace);
      Assert.assertNotNull(trace.getValue());
      Assert.assertNotEquals(trace.getValue(), "");
    }
    catch (IOException exc)
View Full Code Here

TOP

Related Classes of com.linkedin.parseq.trace.codec.json.JsonTraceCodec

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.