Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
5b089ae3
提交
5b089ae3
authored
6月 21, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use current JVM in all tests
上级
f3bc4ccf
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
22 行增加
和
21 行删除
+22
-21
TestBase.java
h2/src/test/org/h2/test/TestBase.java
+11
-0
TestDb.java
h2/src/test/org/h2/test/TestDb.java
+0
-11
TaskProcess.java
h2/src/test/org/h2/test/db/TaskProcess.java
+3
-1
TestRecoverKillLoop.java
h2/src/test/org/h2/test/poweroff/TestRecoverKillLoop.java
+1
-1
TestHalt.java
h2/src/test/org/h2/test/synth/TestHalt.java
+1
-1
TestKill.java
h2/src/test/org/h2/test/synth/TestKill.java
+1
-1
TestKillRestart.java
h2/src/test/org/h2/test/synth/TestKillRestart.java
+1
-2
TestKillRestartMulti.java
h2/src/test/org/h2/test/synth/TestKillRestartMulti.java
+1
-1
TestExit.java
h2/src/test/org/h2/test/unit/TestExit.java
+2
-2
TestFileLockProcess.java
h2/src/test/org/h2/test/unit/TestFileLockProcess.java
+1
-1
没有找到文件。
h2/src/test/org/h2/test/TestBase.java
浏览文件 @
5b089ae3
...
...
@@ -6,6 +6,7 @@
package
org
.
h2
.
test
;
import
java.io.ByteArrayInputStream
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.InputStream
;
...
...
@@ -1317,6 +1318,16 @@ public abstract class TestBase {
return
System
.
getProperty
(
"java.class.path"
);
}
/**
* Get the path to a java executable of the current process
*
* @return the path to java
*/
public
static
String
getJVM
()
{
return
System
.
getProperty
(
"java.home"
)
+
File
.
separatorChar
+
"bin"
+
File
.
separator
+
"java"
;
}
/**
* Use up almost all memory.
*
...
...
h2/src/test/org/h2/test/TestDb.java
浏览文件 @
5b089ae3
...
...
@@ -5,7 +5,6 @@
*/
package
org
.
h2
.
test
;
import
java.io.File
;
import
java.sql.Connection
;
import
java.sql.DriverManager
;
import
java.sql.SQLException
;
...
...
@@ -191,16 +190,6 @@ public abstract class TestDb extends TestBase {
// }
}
/**
* Get the path to a java executable of the current process
*
* @return the path to java
*/
private
static
String
getJVM
()
{
return
System
.
getProperty
(
"java.home"
)
+
File
.
separatorChar
+
"bin"
+
File
.
separator
+
"java"
;
}
/**
* Build a child process.
*
...
...
h2/src/test/org/h2/test/db/TaskProcess.java
浏览文件 @
5b089ae3
...
...
@@ -15,6 +15,8 @@ import java.io.OutputStream;
import
java.io.OutputStreamWriter
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
org.h2.test.TestBase
;
import
org.h2.test.utils.SelfDestructor
;
import
org.h2.util.StringUtils
;
import
org.h2.util.Task
;
...
...
@@ -48,7 +50,7 @@ public class TaskProcess {
try
{
String
selfDestruct
=
SelfDestructor
.
getPropertyString
(
60
);
ArrayList
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
"java"
);
list
.
add
(
TestBase
.
getJVM
()
);
list
.
add
(
selfDestruct
);
list
.
add
(
"-cp"
);
list
.
add
(
"bin"
+
File
.
pathSeparator
+
"."
);
...
...
h2/src/test/org/h2/test/poweroff/TestRecoverKillLoop.java
浏览文件 @
5b089ae3
...
...
@@ -37,7 +37,7 @@ public class TestRecoverKillLoop extends TestBase {
Random
random
=
new
Random
(
1
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
String
[]
procDef
=
{
"java"
,
"-cp"
,
getClassPath
(),
getJVM
()
,
"-cp"
,
getClassPath
(),
"-Dtest.dir=data/db"
,
TestRecover
.
class
.
getName
()
};
...
...
h2/src/test/org/h2/test/synth/TestHalt.java
浏览文件 @
5b089ae3
...
...
@@ -226,7 +226,7 @@ public abstract class TestHalt extends TestBase {
// String classPath = "-cp
// .;D:/data/java/hsqldb.jar;D:/data/java/derby.jar";
String
selfDestruct
=
SelfDestructor
.
getPropertyString
(
60
);
String
[]
procDef
=
{
"java"
,
selfDestruct
,
String
[]
procDef
=
{
getJVM
()
,
selfDestruct
,
"-cp"
,
getClassPath
(),
getClass
().
getName
(),
""
+
operations
,
""
+
flags
,
""
+
testValue
};
traceOperation
(
"start: "
+
StringUtils
.
arrayCombine
(
procDef
,
' '
));
...
...
h2/src/test/org/h2/test/synth/TestKill.java
浏览文件 @
5b089ae3
...
...
@@ -50,7 +50,7 @@ public class TestKill extends TestDb {
String
password
=
getPassword
();
String
selfDestruct
=
SelfDestructor
.
getPropertyString
(
60
);
String
[]
procDef
=
{
"java"
,
selfDestruct
,
getJVM
()
,
selfDestruct
,
"-cp"
,
getClassPath
(),
"org.h2.test.synth.TestKillProcess"
,
url
,
user
,
password
,
getBaseDir
(),
""
+
ACCOUNTS
};
...
...
h2/src/test/org/h2/test/synth/TestKillRestart.java
浏览文件 @
5b089ae3
...
...
@@ -16,7 +16,6 @@ import java.sql.Statement;
import
java.util.Random
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.TimeUnit
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestDb
;
import
org.h2.test.utils.SelfDestructor
;
...
...
@@ -40,7 +39,7 @@ public class TestKillRestart extends TestDb {
// "killRestart;CACHE_SIZE=2048;WRITE_DELAY=0", true);
String
user
=
getUser
(),
password
=
getPassword
();
String
selfDestruct
=
SelfDestructor
.
getPropertyString
(
60
);
String
[]
procDef
=
{
"java"
,
selfDestruct
,
String
[]
procDef
=
{
getJVM
()
,
selfDestruct
,
"-cp"
,
getClassPath
(),
getClass
().
getName
(),
"-url"
,
url
,
"-user"
,
user
,
"-password"
,
password
};
...
...
h2/src/test/org/h2/test/synth/TestKillRestartMulti.java
浏览文件 @
5b089ae3
...
...
@@ -83,7 +83,7 @@ public class TestKillRestartMulti extends TestDb {
// Inherit error so that the stacktraces reported from SelfDestructor
// show up in our log.
ProcessBuilder
pb
=
new
ProcessBuilder
().
redirectError
(
Redirect
.
INHERIT
)
.
command
(
"java"
,
selfDestruct
,
"-cp"
,
getClassPath
(),
.
command
(
getJVM
()
,
selfDestruct
,
"-cp"
,
getClassPath
(),
"-ea"
,
getClass
().
getName
(),
"-url"
,
url
,
"-user"
,
user
,
"-password"
,
password
);
...
...
h2/src/test/org/h2/test/unit/TestExit.java
浏览文件 @
5b089ae3
...
...
@@ -37,7 +37,7 @@ public class TestExit extends TestDb {
deleteDb
(
"exit"
);
String
url
=
getURL
(
OPEN_WITH_CLOSE_ON_EXIT
);
String
selfDestruct
=
SelfDestructor
.
getPropertyString
(
60
);
String
[]
procDef
=
{
"java"
,
selfDestruct
,
"-cp"
,
getClassPath
(),
String
[]
procDef
=
{
getJVM
()
,
selfDestruct
,
"-cp"
,
getClassPath
(),
getClass
().
getName
(),
url
};
Process
proc
=
Runtime
.
getRuntime
().
exec
(
procDef
);
while
(
true
)
{
...
...
@@ -60,7 +60,7 @@ public class TestExit extends TestDb {
fail
(
"did not close database"
);
}
url
=
getURL
(
OPEN_WITHOUT_CLOSE_ON_EXIT
);
procDef
=
new
String
[]
{
"java"
,
"-cp"
,
getClassPath
(),
procDef
=
new
String
[]
{
getJVM
()
,
"-cp"
,
getClassPath
(),
getClass
().
getName
(),
url
};
proc
=
Runtime
.
getRuntime
().
exec
(
procDef
);
proc
.
waitFor
();
...
...
h2/src/test/org/h2/test/unit/TestFileLockProcess.java
浏览文件 @
5b089ae3
...
...
@@ -74,7 +74,7 @@ public class TestFileLockProcess extends TestDb {
url
=
getURL
(
url
,
true
);
Connection
conn
=
getConnection
(
url
);
String
selfDestruct
=
SelfDestructor
.
getPropertyString
(
60
);
String
[]
procDef
=
{
"java"
,
selfDestruct
,
String
[]
procDef
=
{
getJVM
()
,
selfDestruct
,
"-cp"
,
getClassPath
(),
getClass
().
getName
(),
url
};
ArrayList
<
Process
>
processes
=
new
ArrayList
<>(
count
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论