Package org.scotlandyard.engine.json

Examples of org.scotlandyard.engine.json.ExceptionJsonContainer


        try {
        out.println(processRequest(request, engine));

      } catch (Exception e) {

        out.print(new ExceptionJsonContainer(e).toJson());

        e.printStackTrace();

      } finally{
        out.close();
View Full Code Here


public class ExceptionJsonContainerTest {

  @Test  //TODO add description of what the test should do
  public void testNewExceptionJsonContainer()  {
    final Exception exp = new Exception("My Error");
    final ExceptionJsonContainer ejc = new ExceptionJsonContainer(exp);
    final String json = ejc.toJson();
   
    assertTrue("test json",json.contains("My Error"));
   
    final ExceptionJsonContainer conv = ejc.fromJson(json);
    assertEquals("test cast conversion 1",conv.message,"My Error");
    assertEquals("test cast conversion 2",conv.exceptionStack.size(),exp.getStackTrace().length);
    assertEquals("test cast conversion 3",conv.exceptionStack.get(1),exp.getStackTrace()[1].toString());
   
   
View Full Code Here

TOP

Related Classes of org.scotlandyard.engine.json.ExceptionJsonContainer

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.