cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject cxf git commit: Remove usage of json.org stff in systests/jaxrs
Date Wed, 24 May 2017 17:38:10 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 7f07dac41 -> 74cba28db


Remove usage of json.org stff in systests/jaxrs


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/74cba28d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/74cba28d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/74cba28d

Branch: refs/heads/master
Commit: 74cba28dbb550cfa25fa833f1593677cecd316c0
Parents: 7f07dac
Author: Daniel Kulp <dkulp@apache.org>
Authored: Wed May 24 13:37:52 2017 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Wed May 24 13:37:52 2017 -0400

----------------------------------------------------------------------
 systests/jaxrs/pom.xml                          |  6 --
 .../AbstractSwaggerServiceDescriptionTest.java  | 72 ++++++++++----------
 2 files changed, 36 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/74cba28d/systests/jaxrs/pom.xml
----------------------------------------------------------------------
diff --git a/systests/jaxrs/pom.xml b/systests/jaxrs/pom.xml
index d4327d6..02820f4 100644
--- a/systests/jaxrs/pom.xml
+++ b/systests/jaxrs/pom.xml
@@ -527,12 +527,6 @@
                 <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.skyscreamer</groupId>
-            <artifactId>jsonassert</artifactId>
-            <version>1.2.3</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.15</version>

http://git-wip-us.apache.org/repos/asf/cxf/blob/74cba28d/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwaggerServiceDescriptionTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwaggerServiceDescriptionTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwaggerServiceDescriptionTest.java
index 5f6d8df..10a2cec 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwaggerServiceDescriptionTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwaggerServiceDescriptionTest.java
@@ -29,7 +29,6 @@ import javax.ws.rs.core.Response.Status;
 
 import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
 
-import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
@@ -39,7 +38,6 @@ import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 import org.junit.Ignore;
 import org.junit.Test;
-import org.skyscreamer.jsonassert.JSONAssert;
 
 public abstract class AbstractSwaggerServiceDescriptionTest extends AbstractBusClientServerTestBase
{
     private static final JsonObject DELETE_METHOD_SPEC = Json.createObjectBuilder()
@@ -164,24 +162,24 @@ public abstract class AbstractSwaggerServiceDescriptionTest extends
AbstractBusC
             final Response r = client.get();
             assertEquals(Status.OK.getStatusCode(), r.getStatus());
 
-            JSONAssert.assertEquals(
-                Json.createObjectBuilder()
-                    .add("apiVersion", "1.0.0")
-                    .add("swaggerVersion", "1.2")
-                    .add("apis", Json.createArrayBuilder()
-                        .add(Json.createObjectBuilder()
-                            .add("path", "/bookstore")
-                            .add("description", "Sample JAX-RS service with Swagger documentation")
-                        )
+            JsonObject expected = Json.createObjectBuilder()
+                .add("apiVersion", "1.0.0")
+                .add("swaggerVersion", "1.2")
+                .add("apis", Json.createArrayBuilder()
+                    .add(Json.createObjectBuilder()
+                        .add("path", "/bookstore")
+                        .add("description", "Sample JAX-RS service with Swagger documentation")
                     )
-                    .add("info", Json.createObjectBuilder()
-                        .add("title", "Sample REST Application")
-                        .add("description", "The Application")
-                        .add("contact", "users@cxf.apache.org")
-                        .add("license", "Apache 2.0 License")
-                        .add("licenseUrl", "http://www.apache.org/licenses/LICENSE-2.0.html")
-                    ).build().toString(),
-                    IOUtils.readStringFromStream((InputStream)r.getEntity()), false);
+                )
+                .add("info", Json.createObjectBuilder()
+                    .add("title", "Sample REST Application")
+                    .add("description", "The Application")
+                    .add("contact", "users@cxf.apache.org")
+                    .add("license", "Apache 2.0 License")
+                    .add("licenseUrl", "http://www.apache.org/licenses/LICENSE-2.0.html")
+                ).build();
+            JsonObject received = Json.createReader((InputStream)r.getEntity()).readObject();
+            assertEquals(expected, received);
         } finally {
             client.close();
         }
@@ -194,24 +192,26 @@ public abstract class AbstractSwaggerServiceDescriptionTest extends
AbstractBusC
         try {
             final Response r = client.get();
             assertEquals(Status.OK.getStatusCode(), r.getStatus());
+            
+            JsonObject expected = Json.createObjectBuilder()
+                .add("apiVersion", "1.0.0")
+                .add("swaggerVersion", "1.2")
+                .add("basePath", "http://localhost:" + getPort() + "/")
+                .add("resourcePath", "/bookstore")
+                .add("apis", Json.createArrayBuilder()
+                    .add(Json.createObjectBuilder()
+                        .add("path", "/bookstore/{id}")
+                        .add("operations", Json.createArrayBuilder()
+                            .add(DELETE_METHOD_SPEC)
+                            .add(GET_BY_ID_METHOD_SPEC)))
+                    .add(Json.createObjectBuilder()
+                        .add("path", "/bookstore")
+                        .add("operations", Json.createArrayBuilder().add(GET_METHOD_SPEC))))
+                .add("models", BOOK_MODEL_SPEC).build();
+            
+            JsonObject received = Json.createReader((InputStream)r.getEntity()).readObject();
+            assertEquals(expected, received);
 
-            JSONAssert.assertEquals(
-                Json.createObjectBuilder()
-                    .add("apiVersion", "1.0.0")
-                    .add("swaggerVersion", "1.2")
-                    .add("basePath", "http://localhost:" + getPort() + "/")
-                    .add("resourcePath", "/bookstore")
-                    .add("apis", Json.createArrayBuilder()
-                        .add(Json.createObjectBuilder()
-                            .add("path", "/bookstore/{id}")
-                            .add("operations", Json.createArrayBuilder()
-                                .add(DELETE_METHOD_SPEC)
-                                .add(GET_BY_ID_METHOD_SPEC)))
-                        .add(Json.createObjectBuilder()
-                            .add("path", "/bookstore")
-                            .add("operations", Json.createArrayBuilder().add(GET_METHOD_SPEC))))
-                    .add("models", BOOK_MODEL_SPEC).build().toString(),
-                    IOUtils.readStringFromStream((InputStream)r.getEntity()), false);
         } finally {
             client.close();
         }


Mime
View raw message