You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/12/21 16:21:38 UTC

[iotdb] branch master updated: add export-tsfile it on integration-test (#8531)

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

haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 4a1c246384 add export-tsfile it on integration-test (#8531)
4a1c246384 is described below

commit 4a1c246384f7d66b4fedd78d67e1958174b74540
Author: Zhijia Cao <ca...@126.com>
AuthorDate: Thu Dec 22 00:21:32 2022 +0800

    add export-tsfile it on integration-test (#8531)
---
 cli/src/assembly/resources/tools/export-csv.bat    |   2 +-
 cli/src/assembly/resources/tools/export-csv.sh     |   1 -
 cli/src/assembly/resources/tools/export-tsfile.bat |   2 +-
 cli/src/assembly/resources/tools/export-tsfile.sh  |   1 -
 cli/src/assembly/resources/tools/import-csv.bat    |   2 +-
 cli/src/assembly/resources/tools/import-csv.sh     |   1 -
 .../java/org/apache/iotdb/tool/ExportTsFile.java   |   4 +-
 integration-test/import-control.xml                |   5 +
 .../java/org/apache/iotdb/it/env/AbstractEnv.java  |   8 +-
 .../org/apache/iotdb/it/env/RemoteServerEnv.java   |   5 +
 .../java/org/apache/iotdb/itbase/env/BaseEnv.java  |   2 +
 .../org/apache/iotdb/cli/it/AbstractScript.java    |   4 +-
 .../org/apache/iotdb/db/it/env/StandaloneEnv.java  |   5 +
 .../org/apache/iotdb/tools/ExportCsvTestIT.java    | 198 +++++++++++++++++++++
 .../org/apache/iotdb/tools/ExportTsFileTestIT.java | 198 +++++++++++++++++++++
 pom.xml                                            |   1 -
 16 files changed, 428 insertions(+), 11 deletions(-)

diff --git a/cli/src/assembly/resources/tools/export-csv.bat b/cli/src/assembly/resources/tools/export-csv.bat
index 5c0fefa005..7d0a438fad 100644
--- a/cli/src/assembly/resources/tools/export-csv.bat
+++ b/cli/src/assembly/resources/tools/export-csv.bat
@@ -37,7 +37,7 @@ set JAVA_OPTS=-ea^
  -DIOTDB_HOME=%IOTDB_HOME%
 
 @REM ***** CLASSPATH library setting *****
-set CLASSPATH=%IOTDB_HOME%\lib\*
+set CLASSPATH=%CLASSPATH%;%IOTDB_HOME%\lib\*
 
 REM -----------------------------------------------------------------------------
 
diff --git a/cli/src/assembly/resources/tools/export-csv.sh b/cli/src/assembly/resources/tools/export-csv.sh
index 2e532928e4..51bed92344 100644
--- a/cli/src/assembly/resources/tools/export-csv.sh
+++ b/cli/src/assembly/resources/tools/export-csv.sh
@@ -49,7 +49,6 @@ if [ -z $JAVA ] ; then
     exit 1;
 fi
 
-CLASSPATH=""
 for f in ${IOTDB_HOME}/lib/*.jar; do
     CLASSPATH=${CLASSPATH}":"$f
 done
diff --git a/cli/src/assembly/resources/tools/export-tsfile.bat b/cli/src/assembly/resources/tools/export-tsfile.bat
index 9e3531455b..c946ac81b8 100644
--- a/cli/src/assembly/resources/tools/export-tsfile.bat
+++ b/cli/src/assembly/resources/tools/export-tsfile.bat
@@ -37,7 +37,7 @@ set JAVA_OPTS=-ea^
  -DIOTDB_HOME=%IOTDB_HOME%
 
 @REM ***** CLASSPATH library setting *****
-set CLASSPATH=%IOTDB_HOME%\lib\*
+set CLASSPATH=%CLASSPATH%;%IOTDB_HOME%\lib\*
 
 REM -----------------------------------------------------------------------------
 
diff --git a/cli/src/assembly/resources/tools/export-tsfile.sh b/cli/src/assembly/resources/tools/export-tsfile.sh
index e0705dee06..cb9d74765e 100644
--- a/cli/src/assembly/resources/tools/export-tsfile.sh
+++ b/cli/src/assembly/resources/tools/export-tsfile.sh
@@ -49,7 +49,6 @@ if [ -z $JAVA ] ; then
     exit 1;
 fi
 
-CLASSPATH=""
 for f in ${IOTDB_HOME}/lib/*.jar; do
     CLASSPATH=${CLASSPATH}":"$f
 done
diff --git a/cli/src/assembly/resources/tools/import-csv.bat b/cli/src/assembly/resources/tools/import-csv.bat
index 7991891efa..7c911eec1d 100644
--- a/cli/src/assembly/resources/tools/import-csv.bat
+++ b/cli/src/assembly/resources/tools/import-csv.bat
@@ -37,7 +37,7 @@ set JAVA_OPTS=-ea^
  -DIOTDB_HOME=%IOTDB_HOME%
 
 @REM ***** CLASSPATH library setting *****
-set CLASSPATH=%IOTDB_HOME%\lib\*
+set CLASSPATH=%CLASSPATH%;%IOTDB_HOME%\lib\*
 
 REM -----------------------------------------------------------------------------
 
diff --git a/cli/src/assembly/resources/tools/import-csv.sh b/cli/src/assembly/resources/tools/import-csv.sh
index 1ff18e0bf0..e64643456a 100644
--- a/cli/src/assembly/resources/tools/import-csv.sh
+++ b/cli/src/assembly/resources/tools/import-csv.sh
@@ -49,7 +49,6 @@ if [ -z $JAVA ] ; then
     exit 1;
 fi
 
-CLASSPATH=""
 for f in ${IOTDB_HOME}/lib/*.jar; do
     CLASSPATH=${CLASSPATH}":"$f
 done
diff --git a/cli/src/main/java/org/apache/iotdb/tool/ExportTsFile.java b/cli/src/main/java/org/apache/iotdb/tool/ExportTsFile.java
index 3bad8f1982..606c032ada 100644
--- a/cli/src/main/java/org/apache/iotdb/tool/ExportTsFile.java
+++ b/cli/src/main/java/org/apache/iotdb/tool/ExportTsFile.java
@@ -274,9 +274,9 @@ public class ExportTsFile extends AbstractTsFileTool {
       SessionDataSet sessionDataSet = session.executeQueryStatement(sql, timeout);
       long start = System.currentTimeMillis();
       writeTsFileFile(sessionDataSet, path);
-      long end = System.currentTimeMillis();
       sessionDataSet.closeOperationHandle();
-      System.out.println("Export completely!cost:" + (end - start) + "ms.");
+      long end = System.currentTimeMillis();
+      System.out.println("Export completely!cost: " + (end - start) + " ms.");
     } catch (StatementExecutionException
         | IoTDBConnectionException
         | IOException
diff --git a/integration-test/import-control.xml b/integration-test/import-control.xml
index 9ee6e0aac2..37b049b48d 100644
--- a/integration-test/import-control.xml
+++ b/integration-test/import-control.xml
@@ -35,6 +35,7 @@
   <allow pkg="org\.apache\.iotdb\.rpc.*" regex="true"/>
   <allow pkg="org\.apache\.commons\.lang3.*" regex="true"/>
   <allow pkg="org\.slf4j.*" regex="true" />
+  <allow pkg="org\.apache\.iotdb\.tools.*" regex="true"/>
   <subpackage name="db.it">
     <disallow pkg="org.apache.iotdb.jdbc.*"/>
     <allow class="org.apache.iotdb.db.constant.TestConstant" />
@@ -104,4 +105,8 @@
     <allow class="org.apache.zeppelin.interpreter.InterpreterResult.Code" />
     <allow class="org.apache.zeppelin.iotdb.IoTDBInterpreter" />
   </subpackage>
+  <subpackage name="tools">
+    <allow class="org.apache.iotdb.cli.it.AbstractScript" />
+    <allow class="org.apache.iotdb.session.ISession" />
+  </subpackage>
 </import-control>
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/AbstractEnv.java b/integration-test/src/main/java/org/apache/iotdb/it/env/AbstractEnv.java
index e1979b48b2..6444c9e4b3 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/AbstractEnv.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/AbstractEnv.java
@@ -60,7 +60,6 @@ import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 import static org.apache.iotdb.it.env.AbstractNodeWrapper.templateNodeLibPath;
-import static org.apache.iotdb.it.env.AbstractNodeWrapper.templateNodePath;
 import static org.apache.iotdb.jdbc.Config.VERSION;
 import static org.junit.Assert.fail;
 
@@ -73,6 +72,8 @@ public abstract class AbstractEnv implements BaseEnv {
   protected List<ConfigNodeWrapper> configNodeWrapperList = Collections.emptyList();
   protected List<DataNodeWrapper> dataNodeWrapperList = Collections.emptyList();
   protected String testMethodName = null;
+  public static final String templateNodePath =
+      System.getProperty("user.dir") + File.separator + "target" + File.separator + "template-node";
 
   protected void initEnvironment(int configNodesNum, int dataNodesNum) {
     this.configNodeWrapperList = new ArrayList<>();
@@ -643,6 +644,11 @@ public abstract class AbstractEnv implements BaseEnv {
     return templateNodePath + File.separator + "sbin";
   }
 
+  @Override
+  public String getToolsPath() {
+    return templateNodePath + File.separator + "tools";
+  }
+
   @Override
   public String getLibPath() {
     return templateNodeLibPath;
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerEnv.java b/integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerEnv.java
index 83ab667eb9..062f161222 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerEnv.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerEnv.java
@@ -254,6 +254,11 @@ public class RemoteServerEnv implements BaseEnv {
     throw new UnsupportedOperationException();
   }
 
+  @Override
+  public String getToolsPath() {
+    throw new UnsupportedOperationException();
+  }
+
   @Override
   public String getLibPath() {
     throw new UnsupportedOperationException();
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java
index d0ba65b3b1..a2557c6c34 100644
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java
@@ -233,5 +233,7 @@ public interface BaseEnv {
 
   String getSbinPath();
 
+  String getToolsPath();
+
   String getLibPath();
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/cli/it/AbstractScript.java b/integration-test/src/test/java/org/apache/iotdb/cli/it/AbstractScript.java
index 646df15582..b7ab000758 100644
--- a/integration-test/src/test/java/org/apache/iotdb/cli/it/AbstractScript.java
+++ b/integration-test/src/test/java/org/apache/iotdb/cli/it/AbstractScript.java
@@ -33,6 +33,7 @@ import java.util.List;
 import java.util.Properties;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 @RunWith(IoTDBTestRunner.class)
@@ -63,7 +64,8 @@ public abstract class AbstractScript {
 
     if (output != null) {
       for (int i = 0; i < output.length; i++) {
-        assertEquals(output[output.length - 1 - i], outputList.get(outputList.size() - 1 - i));
+        assertTrue(
+            outputList.get(outputList.size() - 1 - i).contains(output[output.length - 1 - i]));
       }
     }
     while (p.isAlive()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnv.java b/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnv.java
index 42781a16e2..2297e885dd 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnv.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnv.java
@@ -263,6 +263,11 @@ public class StandaloneEnv implements BaseEnv {
     throw new UnsupportedOperationException();
   }
 
+  @Override
+  public String getToolsPath() {
+    throw new UnsupportedOperationException();
+  }
+
   @Override
   public String getLibPath() {
     throw new UnsupportedOperationException();
diff --git a/integration-test/src/test/java/org/apache/iotdb/tools/ExportCsvTestIT.java b/integration-test/src/test/java/org/apache/iotdb/tools/ExportCsvTestIT.java
new file mode 100644
index 0000000000..af22a766d2
--- /dev/null
+++ b/integration-test/src/test/java/org/apache/iotdb/tools/ExportCsvTestIT.java
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.tools;
+
+import org.apache.iotdb.cli.it.AbstractScript;
+import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.framework.IoTDBTestRunner;
+import org.apache.iotdb.itbase.category.ClusterIT;
+import org.apache.iotdb.itbase.category.LocalStandaloneIT;
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+import org.apache.iotdb.session.ISession;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+@RunWith(IoTDBTestRunner.class)
+@Category({LocalStandaloneIT.class, ClusterIT.class})
+public class ExportCsvTestIT extends AbstractScript {
+  private static String ip;
+
+  private static String port;
+
+  private static String sbinPath;
+
+  private static String toolsPath;
+
+  private static String libPath;
+
+  @BeforeClass
+  public static void setUp() throws Exception {
+    EnvFactory.getEnv().initBeforeClass();
+    ip = EnvFactory.getEnv().getIP();
+    port = EnvFactory.getEnv().getPort();
+    sbinPath = EnvFactory.getEnv().getSbinPath();
+    toolsPath = EnvFactory.getEnv().getToolsPath();
+    libPath = EnvFactory.getEnv().getLibPath();
+  }
+
+  @AfterClass
+  public static void tearDown() throws Exception {
+    EnvFactory.getEnv().cleanAfterClass();
+  }
+
+  @Test
+  public void test() throws IOException {
+    String os = System.getProperty("os.name").toLowerCase();
+    if (os.startsWith("windows")) {
+      testOnWindows();
+    } else {
+      testOnUnix();
+    }
+  }
+
+  @Override
+  protected void testOnWindows() throws IOException {
+    final String[] output = {"Export completely!"};
+    ProcessBuilder builder =
+        new ProcessBuilder(
+            "cmd.exe",
+            "/c",
+            toolsPath + File.separator + "export-csv.bat",
+            "-h",
+            ip,
+            "-p",
+            port,
+            "-u",
+            "root",
+            "-pw",
+            "root",
+            "-td",
+            "target",
+            "-q",
+            "select * from root.test.t2 where time > 1 and time < 1000000000000",
+            "&",
+            "exit",
+            "%^errorlevel%");
+    builder.environment().put("CLASSPATH", libPath);
+    testOutput(builder, output, 0);
+
+    prepareData();
+
+    final String[] output1 = {"Export completely!"};
+    ProcessBuilder builder1 =
+        new ProcessBuilder(
+            "cmd.exe",
+            "/c",
+            toolsPath + File.separator + "export-csv.bat",
+            "-h",
+            ip,
+            "-p",
+            port,
+            "-u",
+            "root",
+            "-pw",
+            "root",
+            "-td",
+            "target",
+            "-q",
+            "select * from root.test.t2 where time > 1 and time < 1000000000000",
+            "&",
+            "exit",
+            "%^errorlevel%");
+    builder1.environment().put("CLASSPATH", libPath);
+    testOutput(builder1, output1, 0);
+  }
+
+  @Override
+  protected void testOnUnix() throws IOException {
+    final String[] output = {"Export completely!"};
+    // -h 127.0.0.1 -p 6667 -u root -pw root -td ./ -q "select * from root.**"
+    ProcessBuilder builder =
+        new ProcessBuilder(
+            "sh",
+            toolsPath + File.separator + "export-csv.sh",
+            "-h",
+            ip,
+            "-p",
+            port,
+            "-u",
+            "root",
+            "-pw",
+            "root",
+            "-td",
+            "target",
+            "-q",
+            "select * from root.**");
+    builder.environment().put("CLASSPATH", libPath);
+    testOutput(builder, output, 0);
+
+    prepareData();
+
+    final String[] output1 = {"Export completely!"};
+    // -h 127.0.0.1 -p 6667 -u root -pw root -td ./ -q "select * from root.**"
+    ProcessBuilder builder1 =
+        new ProcessBuilder(
+            "sh",
+            toolsPath + File.separator + "export-tsfile.sh",
+            "-h",
+            ip,
+            "-p",
+            port,
+            "-u",
+            "root",
+            "-pw",
+            "root",
+            "-td",
+            "target",
+            "-q",
+            "select * from root.**");
+    builder1.environment().put("CLASSPATH", libPath);
+    testOutput(builder1, output1, 0);
+  }
+
+  public void prepareData() {
+    try (ISession session = EnvFactory.getEnv().getSessionConnection()) {
+      session.open();
+
+      String deviceId = "root.test.t2";
+      List<String> measurements = new ArrayList<>();
+      measurements.add("c1");
+      measurements.add("c2");
+      measurements.add("c3");
+
+      List<String> values = new ArrayList<>();
+      values.add("1.0");
+      values.add("bbbbb");
+      values.add("abbes");
+      session.insertRecord(deviceId, 1L, measurements, values);
+    } catch (IoTDBConnectionException | StatementExecutionException e) {
+      throw new RuntimeException(e);
+    }
+  }
+}
diff --git a/integration-test/src/test/java/org/apache/iotdb/tools/ExportTsFileTestIT.java b/integration-test/src/test/java/org/apache/iotdb/tools/ExportTsFileTestIT.java
new file mode 100644
index 0000000000..eebe95f5a1
--- /dev/null
+++ b/integration-test/src/test/java/org/apache/iotdb/tools/ExportTsFileTestIT.java
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.tools;
+
+import org.apache.iotdb.cli.it.AbstractScript;
+import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.framework.IoTDBTestRunner;
+import org.apache.iotdb.itbase.category.ClusterIT;
+import org.apache.iotdb.itbase.category.LocalStandaloneIT;
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+import org.apache.iotdb.session.ISession;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+@RunWith(IoTDBTestRunner.class)
+@Category({LocalStandaloneIT.class, ClusterIT.class})
+public class ExportTsFileTestIT extends AbstractScript {
+  private static String ip;
+
+  private static String port;
+
+  private static String sbinPath;
+
+  private static String toolsPath;
+
+  private static String libPath;
+
+  @BeforeClass
+  public static void setUp() throws Exception {
+    EnvFactory.getEnv().initBeforeClass();
+    ip = EnvFactory.getEnv().getIP();
+    port = EnvFactory.getEnv().getPort();
+    sbinPath = EnvFactory.getEnv().getSbinPath();
+    toolsPath = EnvFactory.getEnv().getToolsPath();
+    libPath = EnvFactory.getEnv().getLibPath();
+  }
+
+  @AfterClass
+  public static void tearDown() throws Exception {
+    EnvFactory.getEnv().cleanAfterClass();
+  }
+
+  @Test
+  public void test() throws IOException {
+    String os = System.getProperty("os.name").toLowerCase();
+    if (os.startsWith("windows")) {
+      testOnWindows();
+    } else {
+      testOnUnix();
+    }
+  }
+
+  @Override
+  protected void testOnWindows() throws IOException {
+    final String[] output = {"!!!Warning:Tablet is empty,no data can be exported."};
+    ProcessBuilder builder =
+        new ProcessBuilder(
+            "cmd.exe",
+            "/c",
+            toolsPath + File.separator + "export-tsfile.bat",
+            "-h",
+            ip,
+            "-p",
+            port,
+            "-u",
+            "root",
+            "-pw",
+            "root",
+            "-td",
+            "target",
+            "-q",
+            "select * from root.test.t2 where time > 1 and time < 1000000000000",
+            "&",
+            "exit",
+            "%^errorlevel%");
+    builder.environment().put("CLASSPATH", libPath);
+    testOutput(builder, output, 1);
+
+    prepareData();
+
+    final String[] output1 = {"Export completely!"};
+    ProcessBuilder builder1 =
+        new ProcessBuilder(
+            "cmd.exe",
+            "/c",
+            toolsPath + File.separator + "export-tsfile.bat",
+            "-h",
+            ip,
+            "-p",
+            port,
+            "-u",
+            "root",
+            "-pw",
+            "root",
+            "-td",
+            "target",
+            "-q",
+            "select * from root.test.t2 where time > 1 and time < 1000000000000",
+            "&",
+            "exit",
+            "%^errorlevel%");
+    builder1.environment().put("CLASSPATH", libPath);
+    testOutput(builder1, output1, 0);
+  }
+
+  @Override
+  protected void testOnUnix() throws IOException {
+    final String[] output = {"!!!Warning:Tablet is empty,no data can be exported."};
+    // -h 127.0.0.1 -p 6667 -u root -pw root -td ./ -q "select * from root.**"
+    ProcessBuilder builder =
+        new ProcessBuilder(
+            "sh",
+            toolsPath + File.separator + "export-tsfile.sh",
+            "-h",
+            ip,
+            "-p",
+            port,
+            "-u",
+            "root",
+            "-pw",
+            "root",
+            "-td",
+            "target",
+            "-q",
+            "select * from root.**");
+    builder.environment().put("CLASSPATH", libPath);
+    testOutput(builder, output, 1);
+
+    prepareData();
+
+    final String[] output1 = {"Export completely!"};
+    // -h 127.0.0.1 -p 6667 -u root -pw root -td ./ -q "select * from root.**"
+    ProcessBuilder builder1 =
+        new ProcessBuilder(
+            "sh",
+            toolsPath + File.separator + "export-tsfile.sh",
+            "-h",
+            ip,
+            "-p",
+            port,
+            "-u",
+            "root",
+            "-pw",
+            "root",
+            "-td",
+            "target",
+            "-q",
+            "select * from root.**");
+    builder1.environment().put("CLASSPATH", libPath);
+    testOutput(builder1, output1, 0);
+  }
+
+  public void prepareData() {
+    try (ISession session = EnvFactory.getEnv().getSessionConnection()) {
+      session.open();
+
+      String deviceId = "root.test.t2";
+      List<String> measurements = new ArrayList<>();
+      measurements.add("c1");
+      measurements.add("c2");
+      measurements.add("c3");
+
+      List<String> values = new ArrayList<>();
+      values.add("1.0");
+      values.add("bbbbb");
+      values.add("abbes");
+      session.insertRecord(deviceId, 1L, measurements, values);
+    } catch (IoTDBConnectionException | StatementExecutionException e) {
+      throw new RuntimeException(e);
+    }
+  }
+}
diff --git a/pom.xml b/pom.xml
index 289f527ccc..31a0c8bccd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -105,7 +105,6 @@
         <module>hive-connector</module>
         <module>node-commons</module>
         <module>confignode</module>
-        <module>cross-tests</module>
         <module>zeppelin-interpreter</module>
         <module>client-py</module>
         <module>compile-tools</module>