diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-03-13 17:43:27 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-03-17 15:21:43 +0100 |
commit | 5e691b5d2c39e58a626b8ed29207cdcab1bb1223 (patch) | |
tree | fe762b7abf7784550fd4cae800d2c2345eef76f1 /sonar-plugin-api/src/test | |
parent | 698475e10b0f3cfedb87399cae0711eded0d416b (diff) | |
download | sonarqube-5e691b5d2c39e58a626b8ed29207cdcab1bb1223.tar.gz sonarqube-5e691b5d2c39e58a626b8ed29207cdcab1bb1223.zip |
Improve db migration from 5.0 and indexing step at server startup
* Parallel bulk indexing of documents into Elasticsearch
* reduce memory consumption when building JSON requests
* no need to change type of column PROJECT_MEASURES.MEASURE_DATE as it is not used
* fix created_at/updated_at fields of manual_measure when saved from Rails
* remove usage of deprecated delete-by-query
Diffstat (limited to 'sonar-plugin-api/src/test')
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/utils/text/JsonWriterTest.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/text/JsonWriterTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/text/JsonWriterTest.java index 45280508abb..f0de3de0434 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/text/JsonWriterTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/text/JsonWriterTest.java @@ -101,7 +101,7 @@ public class JsonWriterTest { } @Test - public void ignore_null_values() throws Exception { + public void ignore_null_values_by_default() throws Exception { writer.beginObject() .prop("nullNumber", (Number) null) .prop("nullString", (String) null) @@ -114,6 +114,20 @@ public class JsonWriterTest { } @Test + public void serialize_null_values() throws Exception { + writer.setSerializeNulls(true); + writer.beginObject() + .prop("nullNumber", (Number) null) + .prop("nullString", (String) null) + .name("nullNumber").value((Number) null) + .name("nullString").value((String) null) + .name("nullDate").valueDate(null) + .name("nullDateTime").valueDate(null) + .endObject().close(); + expect("{\"nullNumber\":null,\"nullString\":null,\"nullNumber\":null,\"nullString\":null,\"nullDate\":null,\"nullDateTime\":null}"); + } + + @Test public void escape_values() throws Exception { writer.beginObject() .prop("foo", "<hello \"world\">") |