change
This commit is contained in:
parent
97945d8c68
commit
c6f6cd12be
|
@ -37,18 +37,6 @@ public class TSDBDriverTest {
|
||||||
islibLoaded = false;
|
islibLoaded = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// String libPath = null;
|
|
||||||
// switch (osName) {
|
|
||||||
// case "linux":
|
|
||||||
// libPath = "/usr/lib/libtaos.so";
|
|
||||||
// break;
|
|
||||||
// case "windows":
|
|
||||||
// libPath = "C:\\TDengine\\driver\\taos.dll";
|
|
||||||
// break;
|
|
||||||
// default:
|
|
||||||
// }
|
|
||||||
// if (libPath == null)
|
|
||||||
// return;
|
|
||||||
try {
|
try {
|
||||||
System.loadLibrary("taos");
|
System.loadLibrary("taos");
|
||||||
islibLoaded = true;
|
islibLoaded = true;
|
||||||
|
@ -58,7 +46,9 @@ public class TSDBDriverTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Process exec = Runtime.getRuntime().exec("ps -ef | grep taosd | grep -v \"grep\"");
|
if (osName.equals("linux")) {
|
||||||
|
String[] cmd = {"/bin/bash", "-c", "ps -ef | grep taosd | grep -v \"grep\""};
|
||||||
|
Process exec = Runtime.getRuntime().exec(cmd);
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(exec.getInputStream()));
|
BufferedReader reader = new BufferedReader(new InputStreamReader(exec.getInputStream()));
|
||||||
int lineCnt = 0;
|
int lineCnt = 0;
|
||||||
while (reader.readLine() != null) {
|
while (reader.readLine() != null) {
|
||||||
|
@ -68,6 +58,9 @@ public class TSDBDriverTest {
|
||||||
isTaosdActived = true;
|
isTaosdActived = true;
|
||||||
else
|
else
|
||||||
isTaosdActived = false;
|
isTaosdActived = false;
|
||||||
|
} else {
|
||||||
|
isTaosdActived = false;
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
isTaosdActived = false;
|
isTaosdActived = false;
|
||||||
}
|
}
|
||||||
|
@ -146,6 +139,7 @@ public class TSDBDriverTest {
|
||||||
assertEquals("failure - should throw SQLException", "TDengine Error: Unable to establish connection", e.getMessage());
|
assertEquals("failure - should throw SQLException", "TDengine Error: Unable to establish connection", e.getMessage());
|
||||||
else
|
else
|
||||||
fail("failure - should not throw Exception");
|
fail("failure - should not throw Exception");
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue