Package org.spiffyui.client.rest

Examples of org.spiffyui.client.rest.RESTException


        JSONObject detail = new JSONObject();
        fault.put("Detail", detail);
        detail.put("Value1", new JSONString("First Value"));
        detail.put("Value2", new JSONString("Second Value"));
       
        RESTException exception = JSONUtil.getRESTException(obj, -1, "url");
       
        ok(null != exception, "Getting RESTException should be a value object.  It was " + exception);

        ok("Sender".equals(exception.getCode()), "Getting RESTException code should be Sender.  It was " + exception.getCode());

        ok("MessageSubcodeTest".equals(exception.getSubcode()),
           "Getting RESTException subcode should be MessageSubcodeTest.  It was " + exception.getSubcode());

        ok("Test Reason".equals(exception.getReason()),
           "Getting RESTException reason should be Test Reason.  It was " + exception.getReason());
       
        ok("First Value".equals(exception.getDetails().get("Value1")),
           "Getting RESTException details first value should be First Value.  It was " + exception.getDetails().get("Value1"));
       
        ok("Second Value".equals(exception.getDetails().get("Value2")),
           "Getting RESTException details first value should be Second Value.  It was " + exception.getDetails().get("Value2"));
       
        /*
         Now we'll test a value that isn't an NCAC fault
         */
        obj = new JSONObject();
View Full Code Here


                    detailMap.put(key, getIgnoreCase(details, key).isString().stringValue());
                }
            }
           
           
            return new RESTException(code, subcode, reason,
                                     detailMap, statusCode, url);
        } else {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of org.spiffyui.client.rest.RESTException

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.