Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 21c1f81d0 -> 2d6e4e9cb
[CXF-7493] Adding another test Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2d6e4e9c Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2d6e4e9c Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2d6e4e9c Branch: refs/heads/3.0.x-fixes Commit: 2d6e4e9cbe40e21903117498496d42ee3ae30364 Parents: 21c1f81 Author: Sergey Beryozkin <sberyoz...@gmail.com> Authored: Wed Sep 6 12:21:39 2017 +0100 Committer: Sergey Beryozkin <sberyoz...@gmail.com> Committed: Wed Sep 6 12:24:43 2017 +0100 ---------------------------------------------------------------------- .../org/apache/cxf/systest/jaxrs/BookStore.java | 21 ++++++++++++++++++++ .../jaxrs/JAXRS20ClientServerBookTest.java | 11 ++++++++++ 2 files changed, 32 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/2d6e4e9c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java ---------------------------------------------------------------------- diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java index 557b6da..aee5a6f 100644 --- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java +++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java @@ -50,6 +50,7 @@ import javax.ws.rs.Encoded; import javax.ws.rs.GET; import javax.ws.rs.HEAD; import javax.ws.rs.HeaderParam; +import javax.ws.rs.InternalServerErrorException; import javax.ws.rs.MatrixParam; import javax.ws.rs.OPTIONS; import javax.ws.rs.POST; @@ -166,6 +167,26 @@ public class BookStore { return new BookType("root", 124L); } @GET + @Path("/listoflonganddouble") + @Produces("text/xml") + public Book getBookFromListOfLongAndDouble(@QueryParam("value") List<Long> lValue, + @QueryParam("value") List<Double> dValue) { + StringBuilder lBuilder = new StringBuilder(); + for (Long v : lValue) { + lBuilder.append(v.longValue()); + } + StringBuilder dBuilder = new StringBuilder(); + for (Double v : dValue) { + dBuilder.append(v.longValue()); + } + String lStr = lBuilder.toString(); + String dStr = dBuilder.toString(); + if (!lStr.equals(dStr)) { + throw new InternalServerErrorException(); + } + return new Book("cxf", Long.parseLong(lStr)); + } + @GET @Path("/") public Book getBookRoot() { return new Book("root", 124L); http://git-wip-us.apache.org/repos/asf/cxf/blob/2d6e4e9c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java ---------------------------------------------------------------------- diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java index 036ce25..65fbb35 100644 --- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java +++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java @@ -108,6 +108,17 @@ public class JAXRS20ClientServerBookTest extends AbstractBusClientServerTestBase } @Test + public void testListOfLongAndDoubleQuery() throws Exception { + WebTarget echoEndpointTarget = ClientBuilder + .newClient() + .target("http://localhost:" + PORT + "/bookstore/listoflonganddouble") + .queryParam("value", 1, 0, 2, 3); + + Book book = echoEndpointTarget.request().accept("text/xml").get(Book.class); + assertEquals(1023L, book.getId()); + } + + @Test public void testGetGenericBook() throws Exception { String address = "http://localhost:" + PORT + "/bookstore/genericbooks/123"; doTestGetGenericBook(address, 124L, false);