Examples of CommentError


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

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

        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

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

                                                      "<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

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

         */
        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

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

        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

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

        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

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

                                                      "<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

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

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

                                                      "<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

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

                                                                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
Copyright © 2018 www.massapi.com. 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.