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 10:50:47 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-2.6 32b34e7ef -> 4a442662d


IGNITE-8722 REST: Fixed BinaryObject serialization to JSON.

(cherry picked from commit e539a0c)


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

Branch: refs/heads/ignite-2.6
Commit: 4a442662dd16e0000b057ff938ef1e6129de7d32
Parents: 32b34e7
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 17:50:45 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/4a442662/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 0285f3a..44550ba 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
@@ -483,6 +483,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);
 
@@ -2781,6 +2782,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/4a442662/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