Package org.apache.wink.itest.exceptionmappers.mapped

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


                                                      "<comment><author>Anonymous</author></comment>",
                                                      "text/xml", null));
        client.executeMethod(postMethod);
        assertEquals(400, 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


        assertEquals(491, postMethod.getStatusCode());
        assertEquals("Some message", postMethod
            .getResponseHeader("throwemptyentitywebappexception").getValue());
        assertEquals(getBaseURI(), postMethod.getResponseHeader("ExceptionPage").getValue());

        CommentError c =
            (CommentError)JAXBContext.newInstance(CommentError.class.getPackage().getName())
                .createUnmarshaller().unmarshal(postMethod.getResponseBodyAsStream());
        assertEquals("WebApplicationExceptionMapProvider set message", 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

         */
        DeleteMethod postMethod = new DeleteMethod(getBaseURI() + "/abcd");
        client.executeMethod(postMethod);
        assertEquals(450, postMethod.getStatusCode());

        CommentError c =
            (CommentError)JAXBContext.newInstance(CommentError.class.getPackage().getName())
                .createUnmarshaller().unmarshal(postMethod.getResponseBodyAsStream());
        assertEquals("For input string: \"abcd\"", c.getErrorMessage());
    }
View Full Code Here

        DeleteMethod postMethod = new DeleteMethod(getBaseURI() + "/10000");
        client.executeMethod(postMethod);
        assertEquals(451, postMethod.getStatusCode());

        CommentError c =
            (CommentError)JAXBContext.newInstance(CommentError.class.getPackage().getName())
                .createUnmarshaller().unmarshal(postMethod.getResponseBodyAsStream());
        assertEquals("The comment did not previously exist.", c.getErrorMessage());
    }
View Full Code Here

        DeleteMethod postMethod = new DeleteMethod(getBaseURI() + "/-99999");
        client.executeMethod(postMethod);
        assertEquals(453, postMethod.getStatusCode());

        CommentError c =
            (CommentError)JAXBContext.newInstance(CommentError.class.getPackage().getName())
                .createUnmarshaller().unmarshal(postMethod.getResponseBodyAsStream());
        assertEquals("Simulated error", c.getErrorMessage());
    }
View Full Code Here

                                                      "<comment><id></id><message></message><author></author></comment>",
                                                      "text/xml", null));
        client.executeMethod(putMethod);
        assertEquals(454, putMethod.getStatusCode());

        CommentError c =
            (CommentError)JAXBContext.newInstance(CommentError.class.getPackage().getName())
                .createUnmarshaller().unmarshal(putMethod.getResponseBodyAsStream());
        assertEquals("Unexpected ID.", c.getErrorMessage());
    }
View Full Code Here

TOP

Related Classes of org.apache.wink.itest.exceptionmappers.mapped.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.