You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by on...@apache.org on 2021/04/02 04:46:11 UTC

[geode] branch develop updated: Revert "GEODE-9104: Removed ESCAPE_NON_ASCII feature so non-ASCII characters are displayed" (#6249)

This is an automated email from the ASF dual-hosted git repository.

onichols pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 1b2fe6d  Revert "GEODE-9104: Removed ESCAPE_NON_ASCII feature so non-ASCII characters are displayed" (#6249)
1b2fe6d is described below

commit 1b2fe6d185edf578aa764c49e85a766526c8ca68
Author: Barry Oglesby <bo...@users.noreply.github.com>
AuthorDate: Thu Apr 1 18:44:37 2021 -1000

    Revert "GEODE-9104: Removed ESCAPE_NON_ASCII feature so non-ASCII characters are displayed" (#6249)
    
    This reverts commit b7299661375ed0926303f63484cb46dae1e12ffa.
---
 .../web/controllers/RestAccessControllerTest.java  | 42 ----------------------
 ...tomer-containing-chinese-query-full-result.json |  7 ----
 ...mer-containing-chinese-query-struct-result.json |  6 ----
 .../controllers/customer-containing-chinese.json   |  5 ---
 .../geode/rest/internal/web/util/JSONUtils.java    |  2 ++
 5 files changed, 2 insertions(+), 60 deletions(-)

diff --git a/geode-web-api/src/integrationTest/java/org/apache/geode/rest/internal/web/controllers/RestAccessControllerTest.java b/geode-web-api/src/integrationTest/java/org/apache/geode/rest/internal/web/controllers/RestAccessControllerTest.java
index 84e0a8b..5ea7510 100644
--- a/geode-web-api/src/integrationTest/java/org/apache/geode/rest/internal/web/controllers/RestAccessControllerTest.java
+++ b/geode-web-api/src/integrationTest/java/org/apache/geode/rest/internal/web/controllers/RestAccessControllerTest.java
@@ -105,12 +105,6 @@ public class RestAccessControllerTest {
   private static final String ORDER_CAS_OLD_JSON = "order-cas-old.json";
   private static final String ORDER_CAS_NEW_JSON = "order-cas-new.json";
   private static final String ORDER_CAS_WRONG_OLD_JSON = "order-cas-wrong-old.json";
-  private static final String CUSTOMER_CONTAINING_CHINESE_JSON =
-      "customer-containing-chinese.json";
-  private static final String CUSTOMER_CONTAINING_CHINESE_QUERY_FULL_RESULT_JSON =
-      "customer-containing-chinese-query-full-result.json";
-  private static final String CUSTOMER_CONTAINING_CHINESE_QUERY_STRUCT_RESULT_JSON =
-      "customer-containing-chinese-query-struct-result.json";
 
   private static final String SLASH = "/";
   private static final String KEY_PREFIX = "/?+ @&./";
@@ -173,9 +167,6 @@ public class RestAccessControllerTest {
     loadResource(ORDER_CAS_OLD_JSON);
     loadResource(ORDER_CAS_NEW_JSON);
     loadResource(ORDER_CAS_WRONG_OLD_JSON);
-    loadResource(CUSTOMER_CONTAINING_CHINESE_JSON);
-    loadResource(CUSTOMER_CONTAINING_CHINESE_QUERY_FULL_RESULT_JSON);
-    loadResource(CUSTOMER_CONTAINING_CHINESE_QUERY_STRUCT_RESULT_JSON);
 
     RestAgent.createParameterizedQueryRegion();
 
@@ -1366,39 +1357,6 @@ public class RestAccessControllerTest {
   }
 
 
-  @Test
-  @WithMockUser
-  public void putGetQueryCustomerContainingMandarin() throws Exception {
-    // Put customer containing mandarin
-    mockMvc.perform(put("/v1/customers/1")
-        .content(jsonResources.get(CUSTOMER_CONTAINING_CHINESE_JSON))
-        .with(POST_PROCESSOR))
-        .andExpect(status().isOk())
-        .andExpect(header().string("Location", BASE_URL + "/customers/1"));
-
-    // Get customer containing mandarin
-    mockMvc.perform(get("/v1/customers/1")
-        .with(POST_PROCESSOR))
-        .andExpect(status().isOk())
-        .andExpect(content().json(jsonResources.get(CUSTOMER_CONTAINING_CHINESE_JSON)));
-
-    // Query full customer containing mandarin
-    mockMvc.perform(
-        get("/v1/queries/adhoc?q=SELECT * FROM " + SEPARATOR + "customers WHERE customerId = 1")
-            .with(POST_PROCESSOR))
-        .andExpect(status().isOk())
-        .andExpect(
-            content().json(jsonResources.get(CUSTOMER_CONTAINING_CHINESE_QUERY_FULL_RESULT_JSON)));
-
-    // Query struct customer containing mandarin
-    mockMvc.perform(get("/v1/queries/adhoc?q=SELECT firstName, lastName FROM " + SEPARATOR
-        + "customers WHERE customerId = 1")
-            .with(POST_PROCESSOR))
-        .andExpect(status().isOk())
-        .andExpect(content()
-            .json(jsonResources.get(CUSTOMER_CONTAINING_CHINESE_QUERY_STRUCT_RESULT_JSON)));
-  }
-
   private void deleteAllQueries() throws Exception {
     MvcResult result = mockMvc.perform(get("/v1/queries")
         .with(POST_PROCESSOR))
diff --git a/geode-web-api/src/integrationTest/resources/org/apache/geode/rest/internal/web/controllers/customer-containing-chinese-query-full-result.json b/geode-web-api/src/integrationTest/resources/org/apache/geode/rest/internal/web/controllers/customer-containing-chinese-query-full-result.json
deleted file mode 100644
index a7d63cf..0000000
--- a/geode-web-api/src/integrationTest/resources/org/apache/geode/rest/internal/web/controllers/customer-containing-chinese-query-full-result.json
+++ /dev/null
@@ -1,7 +0,0 @@
-[
-  {
-    "customerId": 1,
-    "firstName": "名",
-    "lastName": "姓"
-  }
-]
\ No newline at end of file
diff --git a/geode-web-api/src/integrationTest/resources/org/apache/geode/rest/internal/web/controllers/customer-containing-chinese-query-struct-result.json b/geode-web-api/src/integrationTest/resources/org/apache/geode/rest/internal/web/controllers/customer-containing-chinese-query-struct-result.json
deleted file mode 100644
index c4f4c57..0000000
--- a/geode-web-api/src/integrationTest/resources/org/apache/geode/rest/internal/web/controllers/customer-containing-chinese-query-struct-result.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
-  {
-    "firstName": "名",
-    "lastName": "姓"
-  }
-]
\ No newline at end of file
diff --git a/geode-web-api/src/integrationTest/resources/org/apache/geode/rest/internal/web/controllers/customer-containing-chinese.json b/geode-web-api/src/integrationTest/resources/org/apache/geode/rest/internal/web/controllers/customer-containing-chinese.json
deleted file mode 100644
index 2d9bc5c..0000000
--- a/geode-web-api/src/integrationTest/resources/org/apache/geode/rest/internal/web/controllers/customer-containing-chinese.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "customerId": 1,
-  "firstName": "名",
-  "lastName": "姓"
-}
\ No newline at end of file
diff --git a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/util/JSONUtils.java b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/util/JSONUtils.java
index 392cd69..9f62470 100644
--- a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/util/JSONUtils.java
+++ b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/util/JSONUtils.java
@@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicReference;
 import com.fasterxml.jackson.core.JsonEncoding;
 import com.fasterxml.jackson.core.JsonGenerator;
 import com.fasterxml.jackson.core.JsonGenerator.Feature;
+import com.fasterxml.jackson.core.json.JsonWriteFeature;
 import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.springframework.util.Assert;
@@ -52,6 +53,7 @@ public abstract class JSONUtils {
   }
 
   public static JsonGenerator enableDisableJSONGeneratorFeature(JsonGenerator generator) {
+    generator.enable(JsonWriteFeature.ESCAPE_NON_ASCII.mappedFeature());
     generator.disable(Feature.AUTO_CLOSE_TARGET);
     generator.setPrettyPrinter(new DefaultPrettyPrinter());
     return generator;