|
24 | 24 | import org.apache.iotdb.itbase.category.LocalStandaloneTest; |
25 | 25 | import org.apache.iotdb.itbase.category.RemoteTest; |
26 | 26 |
|
27 | | -import com.google.gson.Gson; |
28 | | -import com.google.gson.JsonObject; |
29 | 27 | import org.junit.After; |
30 | 28 | import org.junit.Assert; |
31 | 29 | import org.junit.Before; |
|
45 | 43 | import java.util.HashSet; |
46 | 44 | import java.util.Set; |
47 | 45 |
|
48 | | -import static org.apache.iotdb.db.metadata.SchemaEngine.TIME_SERIES_TREE_HEADER; |
49 | 46 | import static org.junit.Assert.assertEquals; |
50 | 47 | import static org.junit.Assert.fail; |
51 | 48 |
|
@@ -222,19 +219,6 @@ public void showStorageGroupTest() throws SQLException { |
222 | 219 | } |
223 | 220 | } |
224 | 221 |
|
225 | | - @Test |
226 | | - @Category({LocalStandaloneTest.class}) |
227 | | - public void databaseMetaDataTest() throws SQLException { |
228 | | - try (Connection connection = EnvFactory.getEnv().getConnection()) { |
229 | | - databaseMetaData = connection.getMetaData(); |
230 | | - showTimeseriesInJson(); |
231 | | - |
232 | | - } catch (Exception e) { |
233 | | - logger.error("databaseMetaDataTest() failed", e); |
234 | | - fail(e.getMessage()); |
235 | | - } |
236 | | - } |
237 | | - |
238 | 222 | @Test |
239 | 223 | @Category({LocalStandaloneTest.class}) |
240 | 224 | public void showVersionTest() throws SQLException { |
@@ -605,25 +589,6 @@ public void showCountNodes() throws SQLException { |
605 | 589 | } |
606 | 590 | } |
607 | 591 |
|
608 | | - /** show metadata in json */ |
609 | | - private void showTimeseriesInJson() { |
610 | | - String metadataInJson = databaseMetaData.toString(); |
611 | | - String standard = |
612 | | - "=== Timeseries Tree ===\n" |
613 | | - + "\n" |
614 | | - + "{\"root\":{\"ln2\":{\"wf01\":{\"wt01\":{\"temperature\":{\"DataType\":\"FLOAT\",\"Encoding\":\"RLE\",\"Compressor\":\"SNAPPY\",\"args\":\"{max_point_number=3}\",\"StorageGroup\":\"root.ln2.wf01.wt01\"},\"status\":{\"DataType\":\"BOOLEAN\",\"Encoding\":\"PLAIN\",\"Compressor\":\"SNAPPY\",\"StorageGroup\":\"root.ln2.wf01.wt01\"}}}},\"ln\":{\"wf01\":{\"wt02\":{\"s1\":{\"DataType\":\"INT32\",\"Encoding\":\"RLE\",\"Compressor\":\"SNAPPY\",\"StorageGroup\":\"root.ln.wf01.wt02\"},\"s2\":{\"DataType\":\"DOUBLE\",\"Encoding\":\"GORILLA\",\"Compressor\":\"SNAPPY\",\"StorageGroup\":\"root.ln.wf01.wt02\"}},\"wt01\":{\"temperature\":{\"DataType\":\"FLOAT\",\"Encoding\":\"RLE\",\"Compressor\":\"SNAPPY\",\"args\":\"{max_point_number=3}\",\"StorageGroup\":\"root.ln.wf01.wt01\"},\"status\":{\"DataType\":\"BOOLEAN\",\"Encoding\":\"PLAIN\",\"Compressor\":\"SNAPPY\",\"StorageGroup\":\"root.ln.wf01.wt01\"}}}},\"ln1\":{\"wf01\":{\"wt01\":{\"temperature\":{\"DataType\":\"FLOAT\",\"Encoding\":\"RLE\",\"Compressor\":\"SNAPPY\",\"args\":\"{max_point_number=3}\",\"StorageGroup\":\"root.ln1.wf01.wt01\"},\"status\":{\"DataType\":\"BOOLEAN\",\"Encoding\":\"PLAIN\",\"Compressor\":\"SNAPPY\",\"StorageGroup\":\"root.ln1.wf01.wt01\"}}}}}}"; |
615 | | - // TODO Remove the constant json String. |
616 | | - // Do not depends on the sequence of property in json string if you do not |
617 | | - // explictly mark the sequence, when we use jackson, the json result may change again |
618 | | - String rawJsonString = metadataInJson.substring(TIME_SERIES_TREE_HEADER.length()); |
619 | | - Gson gson = new Gson(); |
620 | | - JsonObject actual = gson.fromJson(rawJsonString, JsonObject.class); |
621 | | - JsonObject expected = |
622 | | - gson.fromJson(standard.substring(TIME_SERIES_TREE_HEADER.length()), JsonObject.class); |
623 | | - |
624 | | - Assert.assertEquals(expected, actual); |
625 | | - } |
626 | | - |
627 | 592 | @Test |
628 | 593 | @Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class}) |
629 | 594 | public void showAlignedTimeseriesWithAliasAndTags() throws SQLException { |
|
0 commit comments