Examples of BookWithValidation


Examples of org.apache.cxf.systest.jaxrs.validation.BookWithValidation

    @Path("/books")
    public Response addBook(@Context final UriInfo uriInfo,
            @NotNull @FormParam("id") String id,
            @FormParam("name") String name) {
       
        final BookWithValidation book = new BookWithValidation(name, id);
        provider.validateBean(book);
       
        return Response.created(uriInfo.getRequestUriBuilder().path(id).build()).build();
    }
View Full Code Here

Examples of org.apache.cxf.systest.jaxrs.validation.BookWithValidation

    public void testHelloRestValidationFailsIfNameIsNull() throws Exception {
        String address = "http://localhost:" + PORT + "/bwrest";
       
        BookWorld service = JAXRSClientFactory.create(address, BookWorld.class);
       
        BookWithValidation bw = service.echoBook(new BookWithValidation("RS", "123"));
        assertEquals("123", bw.getId());
       
        try {
            service.echoBook(new BookWithValidation(null, "123"));
            fail("Validation failure expected");
        } catch (BadRequestException ex) {
            // complete
        }
       
View Full Code Here

Examples of org.apache.cxf.systest.jaxrs.validation.BookWithValidation

       
        Service service = Service.create(serviceName);
        service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, address);
   
        BookWorld bwService = service.getPort(BookWorld.class);
        BookWithValidation bw = bwService.echoBook(new BookWithValidation("WS", "123"));
        assertEquals("123", bw.getId());
        try {
            bwService.echoBook(new BookWithValidation(null, "123"));
            fail("Validation failure expected");
        } catch (SOAPFaultException ex) {
            // complete
        }
    }
View Full Code Here

Examples of org.apache.cxf.systest.jaxrs.validation.BookWithValidation

    @Path("/books")
    public Response addBook(@Context final UriInfo uriInfo,
            @NotNull @FormParam("id") String id,
            @FormParam("name") String name) {
       
        final BookWithValidation book = new BookWithValidation(name, id);
        provider.validateBean(book);
       
        return Response.created(uriInfo.getRequestUriBuilder().path(id).build()).build();
    }
View Full Code Here

Examples of org.apache.cxf.systest.jaxrs.validation.BookWithValidation

    @POST
    @Path("/books")
    @Valid
    public BookWithValidation addBook(@NotNull @FormParam("id") String id,
            @FormParam("name") String name) {       
        return new BookWithValidation(name, id);
    }
View Full Code Here

Examples of org.apache.cxf.systest.jaxrs.validation.BookWithValidation

   
    @GET
    @Path("/book/{id}")
    @Valid
    public BookWithValidation getBook(@NotNull @PathParam("id") String id) {       
        return new BookWithValidation("", id);
    }
View Full Code Here

Examples of org.apache.cxf.systest.jaxrs.validation.BookWithValidation

    public void testThatClientDiscoversServiceProperly() throws Exception {
        BookStore bs = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class,
            "org/apache/cxf/systest/jaxrs/discovery/jaxrs-http-client.xml");
        assertEquals("http://localhost:" + PORT, WebClient.client(bs).getBaseURI().toString());
       
        BookWithValidation book = bs.getBook("123");
        assertEquals(book.getId(), "123");
    }
View Full Code Here

Examples of org.apache.cxf.systest.jaxrs.validation.BookWithValidation

    @POST
    @Path("/books")
    @Valid
    public BookWithValidation addBook(@NotNull @FormParam("id") String id,
            @FormParam("name") String name) {       
        return new BookWithValidation(name, id);
    }
View Full Code Here

Examples of org.apache.cxf.systest.jaxrs.validation.BookWithValidation

   
    @GET
    @Path("/book/{id}")
    @Valid
    public BookWithValidation getBook(@NotNull @PathParam("id") String id) {       
        return new BookWithValidation("", id);
    }
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.