Repository: cxf Updated Branches: refs/heads/3.1.x-fixes a6bd0f9c0 -> ca4c39818
[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/ca4c3981 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ca4c3981 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ca4c3981 Branch: refs/heads/3.1.x-fixes Commit: ca4c398182361d530e1c518f7bdf2694d0373b08 Parents: a6bd0f9 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:23:07 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/ca4c3981/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 f8b07a7..49b173f 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/ca4c3981/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 45a09e0..b9b6fe4 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);