ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-8722 REST: Fixed BinaryObject serialization to JSON.
Date Thu, 14 Jun 2018 09:20:22 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 4be6773ea -> e539a0cbd


IGNITE-8722 REST: Fixed BinaryObject serialization to JSON.


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

Branch: refs/heads/master
Commit: e539a0cbde417e718cd4f6840dca8429907e09c5
Parents: 4be6773
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Thu Jun 14 16:20:19 2018 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Thu Jun 14 16:20:19 2018 +0700

----------------------------------------------------------------------
 .../rest/JettyRestProcessorAbstractSelfTest.java      | 14 ++++++++++++++
 .../protocols/http/jetty/GridJettyObjectMapper.java   |  4 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e539a0cb/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
index 426d391..42f95db 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
@@ -481,6 +481,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         JsonNode json = assertResponseSucceeded(ret, false);
         assertEquals(ref1.name, json.get("name").asText());
+        assertEquals(ref1.ref.toString(), json.get("ref").toString());
 
         ref2.ref(ref1);
 
@@ -2758,6 +2759,19 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         public void ref(CircularRef ref) {
             this.ref = ref;
         }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            SB sb = new SB();
+
+            sb.a('{')
+                .a('"').a("id").a('"').a(':').a(id).a(',')
+                .a('"').a("name").a('"').a(':').a('"').a(name).a('"').a(',')
+                .a('"').a("ref").a('"').a(':').a(ref)
+                .a('}');
+
+            return sb.toString();
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/e539a0cb/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyObjectMapper.java
----------------------------------------------------------------------
diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyObjectMapper.java
b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyObjectMapper.java
index d8b79cf..92ee5c0 100644
--- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyObjectMapper.java
+++ b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyObjectMapper.java
@@ -246,8 +246,8 @@ public class GridJettyObjectMapper extends ObjectMapper {
                             if (ref.hasCircularReferences())
                                 throw ser.mappingException("Failed convert to JSON object
for circular references");
                         }
-                        else
-                            gen.writeObjectField(name, val);
+
+                        gen.writeObjectField(name, val);
                     }
 
                     gen.writeEndObject();


Mime
View raw message