Package org.apache.wink.itest.exceptionmappers.nomapper

Examples of org.apache.wink.itest.exceptionmappers.nomapper.CommentError


                                                      "<comment><author>Anonymous</author></comment>",
                                                      "text/xml", null));
        client.executeMethod(postMethod);
        assertEquals(Status.BAD_REQUEST.getStatusCode(), postMethod.getStatusCode());

        CommentError c =
            (CommentError)JAXBContext.newInstance(CommentError.class.getPackage().getName())
                .createUnmarshaller().unmarshal(postMethod.getResponseBodyAsStream());
        assertEquals("Missing the message in the comment.", c.getErrorMessage());
    }
View Full Code Here


                                                      "<comment><message></message><author></author></comment>",
                                                      "text/xml", null));
        client.executeMethod(postMethod);
        assertEquals(498, postMethod.getStatusCode());

        CommentError c =
            (CommentError)JAXBContext.newInstance(CommentError.class.getPackage().getName())
                .createUnmarshaller().unmarshal(postMethod.getResponseBodyAsStream());
        assertEquals("Cannot post an invalid message.", c.getErrorMessage());
    }
View Full Code Here

                                                                null));
            // postMethod.addRequestHeader("Accept", "text/xml");
            client.executeMethod(postMethod);
            assertEquals(Status.BAD_REQUEST.getStatusCode(), postMethod.getStatusCode());

            CommentError c =
                (CommentError)JAXBContext.newInstance(CommentError.class.getPackage().getName())
                    .createUnmarshaller().unmarshal(postMethod.getResponseBodyAsStream());
            assertEquals("Please include a comment ID, a message, and your name.", c
                .getErrorMessage());
        } finally {
            postMethod.releaseConnection();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.wink.itest.exceptionmappers.nomapper.CommentError

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.