You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/05/29 12:37:55 UTC
[incubator-iotdb] branch enhance_wal created (now f833242)
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a change to branch enhance_wal
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.
at f833242 add test but not take effect
This branch includes the following new commits:
new f833242 add test but not take effect
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[incubator-iotdb] 01/01: add test but not take effect
Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch enhance_wal
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit f833242f64d0e09727780987719ca4bf2a6f28cf
Author: qiaojialin <64...@qq.com>
AuthorDate: Fri May 29 20:38:05 2020 +0800
add test but not take effect
---
.../iotdb/db/integration/IoTDBRestartIT.java | 104 +++++++++++++++++++++
1 file changed, 104 insertions(+)
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBRestartIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBRestartIT.java
index e0a657e..e350b56 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBRestartIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBRestartIT.java
@@ -142,4 +142,108 @@ public class IoTDBRestartIT {
EnvironmentUtils.cleanEnv();
}
+
+
+ @Test
+ public void testRestartQueryLargerThanEndTime()
+ throws SQLException, ClassNotFoundException, IOException, StorageEngineException {
+ EnvironmentUtils.envSetUp();
+ Class.forName(Config.JDBC_DRIVER_NAME);
+
+ try(Connection connection = DriverManager
+ .getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root",
+ "root");
+ Statement statement = connection.createStatement()){
+ statement.execute("insert into root.turbine.d1(timestamp,s1) values(1,1)");
+ statement.execute("insert into root.turbine.d1(timestamp,s1) values(2,2)");
+ }
+
+ EnvironmentUtils.restartDaemon();
+
+ try(Connection connection = DriverManager
+ .getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root",
+ "root");
+ Statement statement = connection.createStatement()) {
+ statement.execute("insert into root.turbine.d1(timestamp,s1) values(3,1)");
+ statement.execute("insert into root.turbine.d1(timestamp,s1) values(4,2)");
+ }
+
+ EnvironmentUtils.restartDaemon();
+
+ try(Connection connection = DriverManager
+ .getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root",
+ "root");
+ Statement statement = connection.createStatement()) {
+
+ boolean hasResultSet = statement.execute("SELECT s1 FROM root.turbine.d1 where time > 3");
+ assertTrue(hasResultSet);
+ String[] exp = new String[]{
+ "4,2.0",
+ };
+ ResultSet resultSet = statement.getResultSet();
+ int cnt = 0;
+ while (resultSet.next()) {
+ String result = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(2);
+ assertEquals(exp[cnt], result);
+ cnt++;
+ }
+ assertEquals(1, cnt);
+
+ }
+
+ EnvironmentUtils.cleanEnv();
+ }
+
+
+
+ @Test
+ public void testRestartEndTIme()
+ throws SQLException, ClassNotFoundException, IOException, StorageEngineException {
+ EnvironmentUtils.envSetUp();
+ Class.forName(Config.JDBC_DRIVER_NAME);
+
+ try(Connection connection = DriverManager
+ .getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root",
+ "root");
+ Statement statement = connection.createStatement()){
+ statement.execute("insert into root.turbine.d1(timestamp,s1) values(1,1)");
+ statement.execute("insert into root.turbine.d1(timestamp,s1) values(2,2)");
+ }
+
+ EnvironmentUtils.restartDaemon();
+
+ try(Connection connection = DriverManager
+ .getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root",
+ "root");
+ Statement statement = connection.createStatement()) {
+ statement.execute("insert into root.turbine.d1(timestamp,s2) values(1,1)");
+ statement.execute("insert into root.turbine.d1(timestamp,s2) values(2,2)");
+ }
+
+ EnvironmentUtils.restartDaemon();
+
+ try(Connection connection = DriverManager
+ .getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root",
+ "root");
+ Statement statement = connection.createStatement()) {
+
+ boolean hasResultSet = statement.execute("SELECT s2 FROM root.turbine.d1");
+ assertTrue(hasResultSet);
+ String[] exp = new String[]{
+ "1,1.0",
+ "2,2.0"
+ };
+ ResultSet resultSet = statement.getResultSet();
+ int cnt = 0;
+ while (resultSet.next()) {
+ String result = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(2);
+ assertEquals(exp[cnt], result);
+ cnt++;
+ }
+ assertEquals(2, cnt);
+
+ }
+
+ EnvironmentUtils.cleanEnv();
+ }
}