You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by do...@apache.org on 2019/02/13 07:01:56 UTC

[incubator-iotdb] branch add_iotdb_env_script_test updated: add windows iotdb env script test

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

dope pushed a commit to branch add_iotdb_env_script_test
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/add_iotdb_env_script_test by this push:
     new ee147a1  add windows iotdb env script test
ee147a1 is described below

commit ee147a1551d81d546e6e5a93e890a33750abd772
Author: xuyi556677@163.com <xu...@163.com>
AuthorDate: Wed Feb 13 15:01:26 2019 +0800

    add windows iotdb env script test
---
 iotdb/iotdb/conf/iotdb-env.bat                     |  4 ++--
 .../org/apache/iotdb/db/script/EnvScriptIT.java    | 24 +++++++++-------------
 2 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/iotdb/iotdb/conf/iotdb-env.bat b/iotdb/iotdb/conf/iotdb-env.bat
index 49ba776..a7ef891 100644
--- a/iotdb/iotdb/conf/iotdb-env.bat
+++ b/iotdb/iotdb/conf/iotdb-env.bat
@@ -28,8 +28,8 @@ if "%LOCAL_JMX%" == "yes" (
 	)
 
 IF ["%IOTDB_HEAP_OPTS%"] EQU [""] (
-	rem detect Java 32 or 64 bit
-	IF %JAVA_VERSION% == 8 (
+	rem detect Java 8 or 11
+	IF %%JAVA_VERSION%% == 8 (
 		java -d64 -version >nul 2>&1
 		IF NOT ERRORLEVEL 1 (
 			rem 64-bit Java
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java b/iotdb/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java
index 3e5ceb9..49c735e 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java
@@ -44,25 +44,21 @@ public class EnvScriptIT {
   public void test() throws IOException, InterruptedException {
     String os = System.getProperty("os.name").toLowerCase();
     if (os.startsWith("windows")) {
-//      testStartClientOnWindows(".bat", os);
+      testStartClientOnWindows(".bat", os);
     } else {
       testStartClientOnUnix(".sh", os);
     }
   }
 
-//  private void testStartClientOnWindows(String suffix, String os) throws IOException {
-//    final String[] output = {"execute iotdb-env.bat successfully!"};
-//    String dir = getCurrentPath("cmd.exe", "/c", "echo %cd%");
-//    String startCMD =
-//        dir + File.separator + "iotdb" + File.separator + "bin" + File.separator + "start-server"
-//            + suffix;
-//    ProcessBuilder startBuilder = new ProcessBuilder("cmd.exe", "/c", startCMD);
-//    String stopCMD =
-//        dir + File.separator + "iotdb" + File.separator + "bin" + File.separator + "stop-server"
-//            + suffix;
-//    ProcessBuilder stopBuilder = new ProcessBuilder("cmd.exe", "/c", stopCMD);
-//    testOutput(dir, suffix, startBuilder, stopBuilder, output, os);
-//  }
+  private void testStartClientOnWindows(String suffix, String os) throws IOException {
+    String dir = getCurrentPath("cmd.exe", "/c", "echo %cd%");
+    final String output = "If you want to change this configuration, please check conf/iotdb-env.sh(Unix or OS X, if you use Windows, check conf/iotdb-env.bat).";
+    String cmd =
+        dir + File.separator + "iotdb" + File.separator + "conf" + File.separator + "iotdb-env"
+            + suffix;
+    ProcessBuilder startBuilder = new ProcessBuilder("cmd.exe", "/c", cmd);
+    testOutput(dir, suffix, startBuilder, output, os);
+  }
 
   private void testStartClientOnUnix(String suffix, String os) throws IOException {
     String dir = getCurrentPath("pwd");