cxf git commit: [CXF-7493] Adding another test
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 Authored: Wed Sep 6 12:21:39 2017 +0100 Committer: Sergey Beryozkin 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 lValue, + @QueryParam("value") List 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);
cxf git commit: [CXF-7493] Adding another test
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 Authored: Wed Sep 6 12:21:39 2017 +0100 Committer: Sergey Beryozkin 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 lValue, + @QueryParam("value") List 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);
cxf git commit: [CXF-7493] Adding another test
Repository: cxf Updated Branches: refs/heads/master 53479782d -> 6f588b0ce [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/6f588b0c Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6f588b0c Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6f588b0c Branch: refs/heads/master Commit: 6f588b0cef87d157864c52c140bec616f9c5f029 Parents: 5347978 Author: Sergey Beryozkin Authored: Wed Sep 6 12:21:39 2017 +0100 Committer: Sergey Beryozkin Committed: Wed Sep 6 12:21:39 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/6f588b0c/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 304b7fe..fe84366 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 lValue, + @QueryParam("value") List 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/6f588b0c/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 1d1fdf5..dc61df7 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 @@ -110,6 +110,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);