Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
aad6a418
Unverified
提交
aad6a418
authored
6月 26, 2018
作者:
Evgenij Ryazanov
提交者:
GitHub
6月 26, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1246 from katzyn/tests
Detect disabled tests
上级
144f743e
ccee8abf
隐藏空白字符变更
内嵌
并排
正在显示
54 个修改的文件
包含
402 行增加
和
145 行删除
+402
-145
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+9
-0
TestBase.java
h2/src/test/org/h2/test/TestBase.java
+15
-9
TestBackup.java
h2/src/test/org/h2/test/db/TestBackup.java
+7
-2
TestBigDb.java
h2/src/test/org/h2/test/db/TestBigDb.java
+8
-3
TestBigResult.java
h2/src/test/org/h2/test/db/TestBigResult.java
+7
-2
TestCluster.java
h2/src/test/org/h2/test/db/TestCluster.java
+8
-21
TestEncryptedDb.java
h2/src/test/org/h2/test/db/TestEncryptedDb.java
+7
-2
TestLargeBlob.java
h2/src/test/org/h2/test/db/TestLargeBlob.java
+6
-2
TestListener.java
h2/src/test/org/h2/test/db/TestListener.java
+7
-2
TestMergeUsing.java
h2/src/test/org/h2/test/db/TestMergeUsing.java
+6
-2
TestMultiThread.java
h2/src/test/org/h2/test/db/TestMultiThread.java
+7
-2
TestMultiThreadedKernel.java
h2/src/test/org/h2/test/db/TestMultiThreadedKernel.java
+7
-2
TestOutOfMemory.java
h2/src/test/org/h2/test/db/TestOutOfMemory.java
+7
-2
TestPowerOff.java
h2/src/test/org/h2/test/db/TestPowerOff.java
+7
-2
TestReadOnly.java
h2/src/test/org/h2/test/db/TestReadOnly.java
+7
-2
TestSQLInjection.java
h2/src/test/org/h2/test/db/TestSQLInjection.java
+7
-2
TestSessionsLocks.java
h2/src/test/org/h2/test/db/TestSessionsLocks.java
+7
-2
TestSpaceReuse.java
h2/src/test/org/h2/test/db/TestSpaceReuse.java
+7
-2
TestSpatial.java
h2/src/test/org/h2/test/db/TestSpatial.java
+12
-6
TestTwoPhaseCommit.java
h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java
+6
-2
TestUpgrade.java
h2/src/test/org/h2/test/db/TestUpgrade.java
+8
-3
TestTransactionIsolation.java
h2/src/test/org/h2/test/jdbc/TestTransactionIsolation.java
+8
-3
TestMvcc1.java
h2/src/test/org/h2/test/mvcc/TestMvcc1.java
+8
-3
TestMvcc2.java
h2/src/test/org/h2/test/mvcc/TestMvcc2.java
+7
-2
TestMvcc4.java
h2/src/test/org/h2/test/mvcc/TestMvcc4.java
+7
-2
TestMvccMultiThreaded.java
h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded.java
+7
-2
TestMvccMultiThreaded2.java
h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded2.java
+7
-2
RecoverLobTest.java
h2/src/test/org/h2/test/recover/RecoverLobTest.java
+7
-2
TestScript.java
h2/src/test/org/h2/test/scripts/TestScript.java
+7
-2
TestScriptSimple.java
h2/src/test/org/h2/test/scripts/TestScriptSimple.java
+7
-2
TestMVStoreBenchmark.java
h2/src/test/org/h2/test/store/TestMVStoreBenchmark.java
+7
-3
TestMVStoreStopCompact.java
h2/src/test/org/h2/test/store/TestMVStoreStopCompact.java
+7
-2
TestMVStoreTool.java
h2/src/test/org/h2/test/store/TestMVStoreTool.java
+8
-3
TestMVTableEngine.java
h2/src/test/org/h2/test/store/TestMVTableEngine.java
+7
-2
TestCrashAPI.java
h2/src/test/org/h2/test/synth/TestCrashAPI.java
+8
-0
TestKillRestart.java
h2/src/test/org/h2/test/synth/TestKillRestart.java
+8
-3
TestKillRestartMulti.java
h2/src/test/org/h2/test/synth/TestKillRestartMulti.java
+8
-3
TestMultiThreaded.java
h2/src/test/org/h2/test/synth/TestMultiThreaded.java
+7
-2
TestRandomSQL.java
h2/src/test/org/h2/test/synth/TestRandomSQL.java
+7
-2
TestExit.java
h2/src/test/org/h2/test/unit/TestExit.java
+8
-3
TestFileLock.java
h2/src/test/org/h2/test/unit/TestFileLock.java
+7
-2
TestFileLockProcess.java
h2/src/test/org/h2/test/unit/TestFileLockProcess.java
+8
-3
TestFileLockSerialized.java
h2/src/test/org/h2/test/unit/TestFileLockSerialized.java
+7
-2
TestFtp.java
h2/src/test/org/h2/test/unit/TestFtp.java
+7
-2
TestModifyOnWrite.java
h2/src/test/org/h2/test/unit/TestModifyOnWrite.java
+7
-2
TestMultiThreadedKernel.java
h2/src/test/org/h2/test/unit/TestMultiThreadedKernel.java
+7
-2
TestOldVersion.java
h2/src/test/org/h2/test/unit/TestOldVersion.java
+7
-2
TestPageStore.java
h2/src/test/org/h2/test/unit/TestPageStore.java
+7
-2
TestPageStoreCoverage.java
h2/src/test/org/h2/test/unit/TestPageStoreCoverage.java
+8
-3
TestPgServer.java
h2/src/test/org/h2/test/unit/TestPgServer.java
+7
-2
TestRecovery.java
h2/src/test/org/h2/test/unit/TestRecovery.java
+7
-2
TestSampleApps.java
h2/src/test/org/h2/test/unit/TestSampleApps.java
+7
-2
TestServlet.java
h2/src/test/org/h2/test/unit/TestServlet.java
+7
-2
TestTools.java
h2/src/test/org/h2/test/unit/TestTools.java
+7
-2
没有找到文件。
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
aad6a418
...
@@ -8,6 +8,8 @@ package org.h2.test;
...
@@ -8,6 +8,8 @@ package org.h2.test;
import
java.lang.management.ManagementFactory
;
import
java.lang.management.ManagementFactory
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Map.Entry
;
import
java.util.Properties
;
import
java.util.Properties
;
import
java.util.TimerTask
;
import
java.util.TimerTask
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -430,6 +432,7 @@ java org.h2.test.TestAll timer
...
@@ -430,6 +432,7 @@ java org.h2.test.TestAll timer
private
Server
server
;
private
Server
server
;
HashMap
<
Class
<?
extends
TestBase
>,
Boolean
>
executedTests
=
new
HashMap
<>();
/**
/**
* Run all tests.
* Run all tests.
...
@@ -689,6 +692,12 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
...
@@ -689,6 +692,12 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
cipher
=
null
;
cipher
=
null
;
test
();
test
();
}
}
for
(
Entry
<
Class
<?
extends
TestBase
>,
Boolean
>
entry
:
executedTests
.
entrySet
())
{
if
(!
entry
.
getValue
())
{
System
.
out
.
println
(
"Warning: test "
+
entry
.
getKey
().
getName
()
+
" was not executed."
);
}
}
}
}
private
void
runCoverage
()
throws
SQLException
{
private
void
runCoverage
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/TestBase.java
浏览文件 @
aad6a418
...
@@ -41,7 +41,6 @@ import org.h2.store.fs.FilePath;
...
@@ -41,7 +41,6 @@ import org.h2.store.fs.FilePath;
import
org.h2.store.fs.FileUtils
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.test.utils.ProxyCodeGenerator
;
import
org.h2.test.utils.ProxyCodeGenerator
;
import
org.h2.test.utils.ResultVerifier
;
import
org.h2.test.utils.ResultVerifier
;
import
org.h2.util.Utils
;
/**
/**
* The base class for all tests.
* The base class for all tests.
...
@@ -128,16 +127,16 @@ public abstract class TestBase {
...
@@ -128,16 +127,16 @@ public abstract class TestBase {
}
}
try
{
try
{
init
(
conf
);
init
(
conf
);
if
(!
isEnabled
())
{
if
(!
conf
.
executedTests
.
containsKey
(
getClass
()))
{
conf
.
executedTests
.
put
(
getClass
(),
false
);
}
return
;
}
conf
.
executedTests
.
put
(
getClass
(),
true
);
start
=
System
.
nanoTime
();
start
=
System
.
nanoTime
();
test
();
test
();
if
(!
config
.
mvStore
)
{
println
(
""
);
/*
* This code is here to debug memory issues with PageStore testing on Travis.
*/
println
(
"("
+
(
Utils
.
getMemoryUsed
()
>>
10
)
+
" MiB used after)"
);
}
else
{
println
(
""
);
}
}
catch
(
Throwable
e
)
{
}
catch
(
Throwable
e
)
{
println
(
"FAIL "
+
e
.
toString
());
println
(
"FAIL "
+
e
.
toString
());
logError
(
"FAIL ("
+
conf
+
") "
+
e
.
toString
(),
e
);
logError
(
"FAIL ("
+
conf
+
") "
+
e
.
toString
(),
e
);
...
@@ -438,6 +437,13 @@ public abstract class TestBase {
...
@@ -438,6 +437,13 @@ public abstract class TestBase {
return
s
;
return
s
;
}
}
/**
* @return whether this test is enabled in the current configuration
*/
public
boolean
isEnabled
()
{
return
true
;
}
/**
/**
* This method will be called by the test framework.
* This method will be called by the test framework.
*
*
...
...
h2/src/test/org/h2/test/db/TestBackup.java
浏览文件 @
aad6a418
...
@@ -35,10 +35,15 @@ public class TestBackup extends TestDb {
...
@@ -35,10 +35,15 @@ public class TestBackup extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
testConcurrentBackup
();
testConcurrentBackup
();
testBackupRestoreLobStatement
();
testBackupRestoreLobStatement
();
testBackupRestoreLob
();
testBackupRestoreLob
();
...
...
h2/src/test/org/h2/test/db/TestBigDb.java
浏览文件 @
aad6a418
...
@@ -31,13 +31,18 @@ public class TestBigDb extends TestDb {
...
@@ -31,13 +31,18 @@ public class TestBigDb extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
}
if
(
config
.
networked
&&
config
.
big
)
{
if
(
config
.
networked
&&
config
.
big
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
testLargeTable
();
testLargeTable
();
testInsert
();
testInsert
();
testLeftSummary
();
testLeftSummary
();
...
...
h2/src/test/org/h2/test/db/TestBigResult.java
浏览文件 @
aad6a418
...
@@ -38,10 +38,15 @@ public class TestBigResult extends TestDb {
...
@@ -38,10 +38,15 @@ public class TestBigResult extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
testLargeSubquery
();
testLargeSubquery
();
testSortingAndDistinct
();
testSortingAndDistinct
();
testLOB
();
testLOB
();
...
...
h2/src/test/org/h2/test/db/TestCluster.java
浏览文件 @
aad6a418
...
@@ -35,6 +35,14 @@ public class TestCluster extends TestDb {
...
@@ -35,6 +35,14 @@ public class TestCluster extends TestDb {
TestBase
.
createCaller
().
init
().
test
();
TestBase
.
createCaller
().
init
().
test
();
}
}
@Override
public
boolean
isEnabled
()
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
false
;
}
return
true
;
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
testClob
();
testClob
();
...
@@ -47,9 +55,6 @@ public class TestCluster extends TestDb {
...
@@ -47,9 +55,6 @@ public class TestCluster extends TestDb {
}
}
private
void
testClob
()
throws
SQLException
{
private
void
testClob
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
deleteFiles
();
deleteFiles
();
org
.
h2
.
Driver
.
load
();
org
.
h2
.
Driver
.
load
();
...
@@ -86,9 +91,6 @@ public class TestCluster extends TestDb {
...
@@ -86,9 +91,6 @@ public class TestCluster extends TestDb {
}
}
private
void
testRecover
()
throws
SQLException
{
private
void
testRecover
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
deleteFiles
();
deleteFiles
();
org
.
h2
.
Driver
.
load
();
org
.
h2
.
Driver
.
load
();
...
@@ -149,9 +151,6 @@ public class TestCluster extends TestDb {
...
@@ -149,9 +151,6 @@ public class TestCluster extends TestDb {
}
}
private
void
testRollback
()
throws
SQLException
{
private
void
testRollback
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
deleteFiles
();
deleteFiles
();
org
.
h2
.
Driver
.
load
();
org
.
h2
.
Driver
.
load
();
...
@@ -196,9 +195,6 @@ public class TestCluster extends TestDb {
...
@@ -196,9 +195,6 @@ public class TestCluster extends TestDb {
}
}
private
void
testCase
()
throws
SQLException
{
private
void
testCase
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
deleteFiles
();
deleteFiles
();
org
.
h2
.
Driver
.
load
();
org
.
h2
.
Driver
.
load
();
...
@@ -252,9 +248,6 @@ public class TestCluster extends TestDb {
...
@@ -252,9 +248,6 @@ public class TestCluster extends TestDb {
}
}
private
void
testClientInfo
()
throws
SQLException
{
private
void
testClientInfo
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
deleteFiles
();
deleteFiles
();
org
.
h2
.
Driver
.
load
();
org
.
h2
.
Driver
.
load
();
...
@@ -304,9 +297,6 @@ public class TestCluster extends TestDb {
...
@@ -304,9 +297,6 @@ public class TestCluster extends TestDb {
}
}
private
void
testCreateClusterAtRuntime
()
throws
SQLException
{
private
void
testCreateClusterAtRuntime
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
deleteFiles
();
deleteFiles
();
org
.
h2
.
Driver
.
load
();
org
.
h2
.
Driver
.
load
();
...
@@ -396,9 +386,6 @@ public class TestCluster extends TestDb {
...
@@ -396,9 +386,6 @@ public class TestCluster extends TestDb {
}
}
private
void
testStartStopCluster
()
throws
SQLException
{
private
void
testStartStopCluster
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
int
port1
=
9193
,
port2
=
9194
;
int
port1
=
9193
,
port2
=
9194
;
String
serverList
=
"localhost:"
+
port1
+
",localhost:"
+
port2
;
String
serverList
=
"localhost:"
+
port1
+
",localhost:"
+
port2
;
deleteFiles
();
deleteFiles
();
...
...
h2/src/test/org/h2/test/db/TestEncryptedDb.java
浏览文件 @
aad6a418
...
@@ -29,10 +29,15 @@ public class TestEncryptedDb extends TestDb {
...
@@ -29,10 +29,15 @@ public class TestEncryptedDb extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
||
config
.
cipher
!=
null
)
{
if
(
config
.
memory
||
config
.
cipher
!=
null
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
deleteDb
(
"encrypted"
);
deleteDb
(
"encrypted"
);
Connection
conn
=
getConnection
(
"encrypted;CIPHER=AES"
,
"sa"
,
"123 123"
);
Connection
conn
=
getConnection
(
"encrypted;CIPHER=AES"
,
"sa"
,
"123 123"
);
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
...
...
h2/src/test/org/h2/test/db/TestLargeBlob.java
浏览文件 @
aad6a418
...
@@ -28,11 +28,15 @@ public class TestLargeBlob extends TestDb {
...
@@ -28,11 +28,15 @@ public class TestLargeBlob extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
big
||
config
.
memory
||
config
.
mvStore
||
config
.
networked
)
{
if
(!
config
.
big
||
config
.
memory
||
config
.
mvStore
||
config
.
networked
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"largeBlob"
);
deleteDb
(
"largeBlob"
);
String
url
=
getURL
(
"largeBlob;TRACE_LEVEL_FILE=0"
,
true
);
String
url
=
getURL
(
"largeBlob;TRACE_LEVEL_FILE=0"
,
true
);
Connection
conn
=
getConnection
(
url
);
Connection
conn
=
getConnection
(
url
);
...
...
h2/src/test/org/h2/test/db/TestListener.java
浏览文件 @
aad6a418
...
@@ -39,10 +39,15 @@ public class TestListener extends TestDb implements DatabaseEventListener {
...
@@ -39,10 +39,15 @@ public class TestListener extends TestDb implements DatabaseEventListener {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
||
config
.
cipher
!=
null
)
{
if
(
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
deleteDb
(
"listener"
);
deleteDb
(
"listener"
);
Connection
conn
;
Connection
conn
;
conn
=
getConnection
(
"listener"
);
conn
=
getConnection
(
"listener"
);
...
...
h2/src/test/org/h2/test/db/TestMergeUsing.java
浏览文件 @
aad6a418
...
@@ -34,12 +34,16 @@ public class TestMergeUsing extends TestDb implements Trigger {
...
@@ -34,12 +34,16 @@ public class TestMergeUsing extends TestDb implements Trigger {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
// TODO breaks in pagestore case
// TODO breaks in pagestore case
if
(!
config
.
mvStore
)
{
if
(!
config
.
mvStore
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
// Simple ID,NAME inserts, target table with PK initially empty
// Simple ID,NAME inserts, target table with PK initially empty
testMergeUsing
(
testMergeUsing
(
"CREATE TABLE PARENT(ID INT, NAME VARCHAR, PRIMARY KEY(ID) );"
,
"CREATE TABLE PARENT(ID INT, NAME VARCHAR, PRIMARY KEY(ID) );"
,
...
...
h2/src/test/org/h2/test/db/TestMultiThread.java
浏览文件 @
aad6a418
...
@@ -60,11 +60,16 @@ public class TestMultiThread extends TestDb implements Runnable {
...
@@ -60,11 +60,16 @@ public class TestMultiThread extends TestDb implements Runnable {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
// pagestore and multithreaded was always experimental, we're not going to fix that
// pagestore and multithreaded was always experimental, we're not going to fix that
if
(!
config
.
mvStore
)
{
if
(!
config
.
mvStore
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testConcurrentSchemaChange
();
testConcurrentSchemaChange
();
testConcurrentLobAdd
();
testConcurrentLobAdd
();
testConcurrentView
();
testConcurrentView
();
...
...
h2/src/test/org/h2/test/db/TestMultiThreadedKernel.java
浏览文件 @
aad6a418
...
@@ -43,10 +43,15 @@ public class TestMultiThreadedKernel extends TestDb {
...
@@ -43,10 +43,15 @@ public class TestMultiThreadedKernel extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
)
{
// FIXME can't see why test should not work in MVStore mode
if
(
config
.
mvStore
)
{
// FIXME can't see why test should not work in MVStore mode
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"multiThreadedKernel"
);
deleteDb
(
"multiThreadedKernel"
);
testConcurrentRead
();
testConcurrentRead
();
testCache
();
testCache
();
...
...
h2/src/test/org/h2/test/db/TestOutOfMemory.java
浏览文件 @
aad6a418
...
@@ -40,11 +40,16 @@ public class TestOutOfMemory extends TestDb {
...
@@ -40,11 +40,16 @@ public class TestOutOfMemory extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
vmlens
)
{
if
(
config
.
vmlens
)
{
// running out of memory will cause the vmlens agent to stop working
// running out of memory will cause the vmlens agent to stop working
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
try
{
try
{
if
(!
config
.
travis
)
{
if
(!
config
.
travis
)
{
System
.
gc
();
System
.
gc
();
...
...
h2/src/test/org/h2/test/db/TestPowerOff.java
浏览文件 @
aad6a418
...
@@ -39,10 +39,15 @@ public class TestPowerOff extends TestDb {
...
@@ -39,10 +39,15 @@ public class TestPowerOff extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
if
(
config
.
big
||
config
.
googleAppEngine
)
{
if
(
config
.
big
||
config
.
googleAppEngine
)
{
dir
=
getBaseDir
();
dir
=
getBaseDir
();
url
=
DB_NAME
;
url
=
DB_NAME
;
...
...
h2/src/test/org/h2/test/db/TestReadOnly.java
浏览文件 @
aad6a418
...
@@ -37,10 +37,15 @@ public class TestReadOnly extends TestDb {
...
@@ -37,10 +37,15 @@ public class TestReadOnly extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testReadOnlyInZip
();
testReadOnlyInZip
();
testReadOnlyTempTableResult
();
testReadOnlyTempTableResult
();
testReadOnlyConnect
();
testReadOnlyConnect
();
...
...
h2/src/test/org/h2/test/db/TestSQLInjection.java
浏览文件 @
aad6a418
...
@@ -33,10 +33,15 @@ public class TestSQLInjection extends TestDb {
...
@@ -33,10 +33,15 @@ public class TestSQLInjection extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
reopen
)
{
if
(
config
.
reopen
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
deleteDb
(
"sqlInjection"
);
deleteDb
(
"sqlInjection"
);
reconnect
(
"sqlInjection"
);
reconnect
(
"sqlInjection"
);
stat
.
execute
(
"DROP TABLE IF EXISTS USERS"
);
stat
.
execute
(
"DROP TABLE IF EXISTS USERS"
);
...
...
h2/src/test/org/h2/test/db/TestSessionsLocks.java
浏览文件 @
aad6a418
...
@@ -27,10 +27,15 @@ public class TestSessionsLocks extends TestDb {
...
@@ -27,10 +27,15 @@ public class TestSessionsLocks extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
multiThreaded
)
{
if
(!
config
.
multiThreaded
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testCancelStatement
();
testCancelStatement
();
if
(!
config
.
mvStore
)
{
if
(!
config
.
mvStore
)
{
testLocks
();
testLocks
();
...
...
h2/src/test/org/h2/test/db/TestSpaceReuse.java
浏览文件 @
aad6a418
...
@@ -28,10 +28,15 @@ public class TestSpaceReuse extends TestDb {
...
@@ -28,10 +28,15 @@ public class TestSpaceReuse extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
deleteDb
(
"spaceReuse"
);
deleteDb
(
"spaceReuse"
);
long
max
=
0
,
now
=
0
,
min
=
Long
.
MAX_VALUE
;
long
max
=
0
,
now
=
0
,
min
=
Long
.
MAX_VALUE
;
for
(
int
i
=
0
;
i
<
20
;
i
++)
{
for
(
int
i
=
0
;
i
<
20
;
i
++)
{
...
...
h2/src/test/org/h2/test/db/TestSpatial.java
浏览文件 @
aad6a418
...
@@ -53,15 +53,21 @@ public class TestSpatial extends TestDb {
...
@@ -53,15 +53,21 @@ public class TestSpatial extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
&&
config
.
mvStore
)
{
if
(
config
.
memory
&&
config
.
mvStore
)
{
return
;
return
false
;
}
}
if
(
DataType
.
GEOMETRY_CLASS
!=
null
)
{
if
(
DataType
.
GEOMETRY_CLASS
==
null
)
{
deleteDb
(
"spatial"
);
return
false
;
testSpatial
();
deleteDb
(
"spatial"
);
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
deleteDb
(
"spatial"
);
testSpatial
();
deleteDb
(
"spatial"
);
}
}
private
void
testSpatial
()
throws
SQLException
{
private
void
testSpatial
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java
浏览文件 @
aad6a418
...
@@ -28,11 +28,15 @@ public class TestTwoPhaseCommit extends TestDb {
...
@@ -28,11 +28,15 @@ public class TestTwoPhaseCommit extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
||
config
.
networked
)
{
if
(
config
.
memory
||
config
.
networked
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
deleteDb
(
"twoPhaseCommit"
);
deleteDb
(
"twoPhaseCommit"
);
prepare
();
prepare
();
...
...
h2/src/test/org/h2/test/db/TestUpgrade.java
浏览文件 @
aad6a418
...
@@ -35,13 +35,18 @@ public class TestUpgrade extends TestDb {
...
@@ -35,13 +35,18 @@ public class TestUpgrade extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
)
{
if
(
config
.
mvStore
)
{
return
;
return
false
;
}
}
if
(!
Utils
.
isClassPresent
(
"org.h2.upgrade.v1_1.Driver"
))
{
if
(!
Utils
.
isClassPresent
(
"org.h2.upgrade.v1_1.Driver"
))
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testLobs
();
testLobs
();
testErrorUpgrading
();
testErrorUpgrading
();
testNoDb
();
testNoDb
();
...
...
h2/src/test/org/h2/test/jdbc/TestTransactionIsolation.java
浏览文件 @
aad6a418
...
@@ -28,12 +28,17 @@ public class TestTransactionIsolation extends TestDb {
...
@@ -28,12 +28,17 @@ public class TestTransactionIsolation extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
)
{
if
(
config
.
mvStore
)
{
// no tests yet
// no tests yet
}
else
{
return
false
;
testTableLevelLocking
();
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
testTableLevelLocking
();
}
}
private
void
testTableLevelLocking
()
throws
SQLException
{
private
void
testTableLevelLocking
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/mvcc/TestMvcc1.java
浏览文件 @
aad6a418
...
@@ -34,6 +34,14 @@ public class TestMvcc1 extends TestDb {
...
@@ -34,6 +34,14 @@ public class TestMvcc1 extends TestDb {
test
.
test
();
test
.
test
();
}
}
@Override
public
boolean
isEnabled
()
{
if
(!
config
.
mvStore
)
{
return
false
;
}
return
true
;
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
testCases
();
testCases
();
...
@@ -41,9 +49,6 @@ public class TestMvcc1 extends TestDb {
...
@@ -41,9 +49,6 @@ public class TestMvcc1 extends TestDb {
}
}
private
void
testCases
()
throws
SQLException
{
private
void
testCases
()
throws
SQLException
{
if
(!
config
.
mvStore
)
{
return
;
}
ResultSet
rs
;
ResultSet
rs
;
// TODO Prio 1: document: exclusive table lock still used when altering
// TODO Prio 1: document: exclusive table lock still used when altering
...
...
h2/src/test/org/h2/test/mvcc/TestMvcc2.java
浏览文件 @
aad6a418
...
@@ -39,10 +39,15 @@ public class TestMvcc2 extends TestDb {
...
@@ -39,10 +39,15 @@ public class TestMvcc2 extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
mvStore
)
{
if
(!
config
.
mvStore
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"mvcc2"
);
deleteDb
(
"mvcc2"
);
testConcurrentInsert
();
testConcurrentInsert
();
testConcurrentUpdate
();
testConcurrentUpdate
();
...
...
h2/src/test/org/h2/test/mvcc/TestMvcc4.java
浏览文件 @
aad6a418
...
@@ -33,10 +33,15 @@ public class TestMvcc4 extends TestDb {
...
@@ -33,10 +33,15 @@ public class TestMvcc4 extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
||
!
config
.
mvStore
)
{
if
(
config
.
networked
||
!
config
.
mvStore
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
testSelectForUpdateAndUpdateConcurrency
();
testSelectForUpdateAndUpdateConcurrency
();
}
}
...
...
h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded.java
浏览文件 @
aad6a418
...
@@ -30,10 +30,15 @@ public class TestMvccMultiThreaded extends TestDb {
...
@@ -30,10 +30,15 @@ public class TestMvccMultiThreaded extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
mvStore
)
{
if
(!
config
.
mvStore
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testConcurrentSelectForUpdate
();
testConcurrentSelectForUpdate
();
testMergeWithUniqueKeyViolation
();
testMergeWithUniqueKeyViolation
();
testConcurrentMerge
();
testConcurrentMerge
();
...
...
h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded2.java
浏览文件 @
aad6a418
...
@@ -46,10 +46,15 @@ public class TestMvccMultiThreaded2 extends TestDb {
...
@@ -46,10 +46,15 @@ public class TestMvccMultiThreaded2 extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
,
InterruptedException
{
public
boolean
isEnabled
()
{
if
(!
config
.
mvStore
)
{
if
(!
config
.
mvStore
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
,
InterruptedException
{
testSelectForUpdateConcurrency
();
testSelectForUpdateConcurrency
();
}
}
...
...
h2/src/test/org/h2/test/recover/RecoverLobTest.java
浏览文件 @
aad6a418
...
@@ -28,10 +28,15 @@ public class RecoverLobTest extends TestDb {
...
@@ -28,10 +28,15 @@ public class RecoverLobTest extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
||
config
.
memory
)
{
if
(
config
.
mvStore
||
config
.
memory
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testRecoverClob
();
testRecoverClob
();
}
}
...
...
h2/src/test/org/h2/test/scripts/TestScript.java
浏览文件 @
aad6a418
...
@@ -85,10 +85,15 @@ public class TestScript extends TestDb {
...
@@ -85,10 +85,15 @@ public class TestScript extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
&&
config
.
big
)
{
if
(
config
.
networked
&&
config
.
big
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
reconnectOften
=
!
config
.
memory
&&
config
.
big
;
reconnectOften
=
!
config
.
memory
&&
config
.
big
;
testScript
(
"testScript.sql"
);
testScript
(
"testScript.sql"
);
...
...
h2/src/test/org/h2/test/scripts/TestScriptSimple.java
浏览文件 @
aad6a418
...
@@ -33,10 +33,15 @@ public class TestScriptSimple extends TestDb {
...
@@ -33,10 +33,15 @@ public class TestScriptSimple extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
||
config
.
big
||
config
.
networked
)
{
if
(
config
.
memory
||
config
.
big
||
config
.
networked
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"scriptSimple"
);
deleteDb
(
"scriptSimple"
);
reconnect
();
reconnect
();
String
inFile
=
"org/h2/test/scripts/testSimple.in.txt"
;
String
inFile
=
"org/h2/test/scripts/testSimple.in.txt"
;
...
...
h2/src/test/org/h2/test/store/TestMVStoreBenchmark.java
浏览文件 @
aad6a418
...
@@ -34,17 +34,21 @@ public class TestMVStoreBenchmark extends TestBase {
...
@@ -34,17 +34,21 @@ public class TestMVStoreBenchmark extends TestBase {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
big
)
{
if
(!
config
.
big
)
{
return
;
return
false
;
}
}
if
(
config
.
codeCoverage
)
{
if
(
config
.
codeCoverage
)
{
// run only when _not_ using a code coverage tool,
// run only when _not_ using a code coverage tool,
// because the tool might instrument our code but not
// because the tool might instrument our code but not
// java.util.*
// java.util.*
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testPerformanceComparison
();
testPerformanceComparison
();
testMemoryUsageComparison
();
testMemoryUsageComparison
();
}
}
...
...
h2/src/test/org/h2/test/store/TestMVStoreStopCompact.java
浏览文件 @
aad6a418
...
@@ -29,10 +29,15 @@ public class TestMVStoreStopCompact extends TestBase {
...
@@ -29,10 +29,15 @@ public class TestMVStoreStopCompact extends TestBase {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
big
)
{
if
(!
config
.
big
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
for
(
int
retentionTime
=
10
;
retentionTime
<
1000
;
retentionTime
*=
10
)
{
for
(
int
retentionTime
=
10
;
retentionTime
<
1000
;
retentionTime
*=
10
)
{
for
(
int
timeout
=
100
;
timeout
<=
1000
;
timeout
*=
10
)
{
for
(
int
timeout
=
100
;
timeout
<=
1000
;
timeout
*=
10
)
{
testStopCompact
(
retentionTime
,
timeout
);
testStopCompact
(
retentionTime
,
timeout
);
...
...
h2/src/test/org/h2/test/store/TestMVStoreTool.java
浏览文件 @
aad6a418
...
@@ -33,15 +33,20 @@ public class TestMVStoreTool extends TestBase {
...
@@ -33,15 +33,20 @@ public class TestMVStoreTool extends TestBase {
test
.
test
();
test
.
test
();
}
}
@Override
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
return
false
;
}
return
true
;
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
testCompact
();
testCompact
();
}
}
private
void
testCompact
()
{
private
void
testCompact
()
{
if
(
config
.
memory
)
{
return
;
}
String
fileName
=
getBaseDir
()
+
"/testCompact.h3"
;
String
fileName
=
getBaseDir
()
+
"/testCompact.h3"
;
String
fileNameNew
=
fileName
+
".new"
;
String
fileNameNew
=
fileName
+
".new"
;
String
fileNameCompressed
=
fileNameNew
+
".compress"
;
String
fileNameCompressed
=
fileNameNew
+
".compress"
;
...
...
h2/src/test/org/h2/test/store/TestMVTableEngine.java
浏览文件 @
aad6a418
...
@@ -50,10 +50,15 @@ public class TestMVTableEngine extends TestDb {
...
@@ -50,10 +50,15 @@ public class TestMVTableEngine extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
mvStore
)
{
if
(!
config
.
mvStore
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testLobCopy
();
testLobCopy
();
testLobReuse
();
testLobReuse
();
testShutdownDuringLobCreation
();
testShutdownDuringLobCreation
();
...
...
h2/src/test/org/h2/test/synth/TestCrashAPI.java
浏览文件 @
aad6a418
...
@@ -148,6 +148,14 @@ public class TestCrashAPI extends TestDb implements Runnable {
...
@@ -148,6 +148,14 @@ public class TestCrashAPI extends TestDb implements Runnable {
}
}
}
}
@Override
public
boolean
isEnabled
()
{
if
(
config
.
networked
)
{
return
false
;
}
return
true
;
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
if
(
RECOVER_ALL
)
{
if
(
RECOVER_ALL
)
{
...
...
h2/src/test/org/h2/test/synth/TestKillRestart.java
浏览文件 @
aad6a418
...
@@ -26,13 +26,18 @@ import org.h2.test.utils.SelfDestructor;
...
@@ -26,13 +26,18 @@ import org.h2.test.utils.SelfDestructor;
public
class
TestKillRestart
extends
TestDb
{
public
class
TestKillRestart
extends
TestDb
{
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
)
{
if
(
config
.
networked
)
{
return
;
return
false
;
}
}
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"killRestart"
);
deleteDb
(
"killRestart"
);
String
url
=
getURL
(
"killRestart"
,
true
);
String
url
=
getURL
(
"killRestart"
,
true
);
// String url = getURL(
// String url = getURL(
...
...
h2/src/test/org/h2/test/synth/TestKillRestartMulti.java
浏览文件 @
aad6a418
...
@@ -68,13 +68,18 @@ public class TestKillRestartMulti extends TestDb {
...
@@ -68,13 +68,18 @@ public class TestKillRestartMulti extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
)
{
if
(
config
.
networked
)
{
return
;
return
false
;
}
}
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"killRestartMulti"
);
deleteDb
(
"killRestartMulti"
);
url
=
getURL
(
"killRestartMulti"
,
true
);
url
=
getURL
(
"killRestartMulti"
,
true
);
user
=
getUser
();
user
=
getUser
();
...
...
h2/src/test/org/h2/test/synth/TestMultiThreaded.java
浏览文件 @
aad6a418
...
@@ -123,10 +123,15 @@ public class TestMultiThreaded extends TestDb {
...
@@ -123,10 +123,15 @@ public class TestMultiThreaded extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
)
{
if
(
config
.
mvStore
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"multiThreaded"
);
deleteDb
(
"multiThreaded"
);
int
size
=
getSize
(
2
,
4
);
int
size
=
getSize
(
2
,
4
);
Connection
[]
connList
=
new
Connection
[
size
];
Connection
[]
connList
=
new
Connection
[
size
];
...
...
h2/src/test/org/h2/test/synth/TestRandomSQL.java
浏览文件 @
aad6a418
...
@@ -31,10 +31,15 @@ public class TestRandomSQL extends TestDb {
...
@@ -31,10 +31,15 @@ public class TestRandomSQL extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
)
{
if
(
config
.
networked
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
int
len
=
getSize
(
2
,
6
);
int
len
=
getSize
(
2
,
6
);
for
(
int
a
=
0
;
a
<
len
;
a
++)
{
for
(
int
a
=
0
;
a
<
len
;
a
++)
{
int
s
=
MathUtils
.
randomInt
(
Integer
.
MAX_VALUE
);
int
s
=
MathUtils
.
randomInt
(
Integer
.
MAX_VALUE
);
...
...
h2/src/test/org/h2/test/unit/TestExit.java
浏览文件 @
aad6a418
...
@@ -27,13 +27,18 @@ public class TestExit extends TestDb {
...
@@ -27,13 +27,18 @@ public class TestExit extends TestDb {
OPEN_WITHOUT_CLOSE_ON_EXIT
=
2
;
OPEN_WITHOUT_CLOSE_ON_EXIT
=
2
;
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
codeCoverage
||
config
.
networked
)
{
if
(
config
.
codeCoverage
||
config
.
networked
)
{
return
;
return
false
;
}
}
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"exit"
);
deleteDb
(
"exit"
);
String
url
=
getURL
(
OPEN_WITH_CLOSE_ON_EXIT
);
String
url
=
getURL
(
OPEN_WITH_CLOSE_ON_EXIT
);
String
selfDestruct
=
SelfDestructor
.
getPropertyString
(
60
);
String
selfDestruct
=
SelfDestructor
.
getPropertyString
(
60
);
...
...
h2/src/test/org/h2/test/unit/TestFileLock.java
浏览文件 @
aad6a418
...
@@ -50,10 +50,15 @@ public class TestFileLock extends TestDb implements Runnable {
...
@@ -50,10 +50,15 @@ public class TestFileLock extends TestDb implements Runnable {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
getFile
().
startsWith
(
TestBase
.
BASE_TEST_DIR
))
{
if
(!
getFile
().
startsWith
(
TestBase
.
BASE_TEST_DIR
))
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testFsFileLock
();
testFsFileLock
();
testFutureModificationDate
();
testFutureModificationDate
();
testSimple
();
testSimple
();
...
...
h2/src/test/org/h2/test/unit/TestFileLockProcess.java
浏览文件 @
aad6a418
...
@@ -48,13 +48,18 @@ public class TestFileLockProcess extends TestDb {
...
@@ -48,13 +48,18 @@ public class TestFileLockProcess extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
codeCoverage
||
config
.
networked
)
{
if
(
config
.
codeCoverage
||
config
.
networked
)
{
return
;
return
false
;
}
}
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"lock"
);
deleteDb
(
"lock"
);
String
url
=
"jdbc:h2:"
+
getBaseDir
()+
"/lock"
;
String
url
=
"jdbc:h2:"
+
getBaseDir
()+
"/lock"
;
...
...
h2/src/test/org/h2/test/unit/TestFileLockSerialized.java
浏览文件 @
aad6a418
...
@@ -38,10 +38,15 @@ public class TestFileLockSerialized extends TestDb {
...
@@ -38,10 +38,15 @@ public class TestFileLockSerialized extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
)
{
if
(
config
.
mvStore
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
println
(
"testSequence"
);
println
(
"testSequence"
);
testSequence
();
testSequence
();
println
(
"testAutoIncrement"
);
println
(
"testAutoIncrement"
);
...
...
h2/src/test/org/h2/test/unit/TestFtp.java
浏览文件 @
aad6a418
...
@@ -30,10 +30,15 @@ public class TestFtp extends TestBase implements FtpEventListener {
...
@@ -30,10 +30,15 @@ public class TestFtp extends TestBase implements FtpEventListener {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
FileUtils
.
delete
(
getBaseDir
()
+
"/ftp"
);
FileUtils
.
delete
(
getBaseDir
()
+
"/ftp"
);
test
(
getBaseDir
());
test
(
getBaseDir
());
FileUtils
.
delete
(
getBaseDir
()
+
"/ftp"
);
FileUtils
.
delete
(
getBaseDir
()
+
"/ftp"
);
...
...
h2/src/test/org/h2/test/unit/TestModifyOnWrite.java
浏览文件 @
aad6a418
...
@@ -32,10 +32,15 @@ public class TestModifyOnWrite extends TestDb {
...
@@ -32,10 +32,15 @@ public class TestModifyOnWrite extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
SysProperties
.
MODIFY_ON_WRITE
)
{
if
(!
SysProperties
.
MODIFY_ON_WRITE
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"modifyOnWrite"
);
deleteDb
(
"modifyOnWrite"
);
String
dbFile
=
getBaseDir
()
+
"/modifyOnWrite.h2.db"
;
String
dbFile
=
getBaseDir
()
+
"/modifyOnWrite.h2.db"
;
assertFalse
(
FileUtils
.
exists
(
dbFile
));
assertFalse
(
FileUtils
.
exists
(
dbFile
));
...
...
h2/src/test/org/h2/test/unit/TestMultiThreadedKernel.java
浏览文件 @
aad6a418
...
@@ -33,10 +33,15 @@ public class TestMultiThreadedKernel extends TestDb implements Runnable {
...
@@ -33,10 +33,15 @@ public class TestMultiThreadedKernel extends TestDb implements Runnable {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
||
config
.
mvStore
)
{
if
(
config
.
networked
||
config
.
mvStore
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"multiThreadedKernel"
);
deleteDb
(
"multiThreadedKernel"
);
int
count
=
getSize
(
2
,
5
);
int
count
=
getSize
(
2
,
5
);
Thread
[]
list
=
new
Thread
[
count
];
Thread
[]
list
=
new
Thread
[
count
];
...
...
h2/src/test/org/h2/test/unit/TestOldVersion.java
浏览文件 @
aad6a418
...
@@ -40,10 +40,15 @@ public class TestOldVersion extends TestDb {
...
@@ -40,10 +40,15 @@ public class TestOldVersion extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
)
{
if
(
config
.
mvStore
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
cl
=
getClassLoader
(
"file:ext/h2-1.2.127.jar"
);
cl
=
getClassLoader
(
"file:ext/h2-1.2.127.jar"
);
driver
=
getDriver
(
cl
);
driver
=
getDriver
(
cl
);
if
(
driver
==
null
)
{
if
(
driver
==
null
)
{
...
...
h2/src/test/org/h2/test/unit/TestPageStore.java
浏览文件 @
aad6a418
...
@@ -50,10 +50,15 @@ public class TestPageStore extends TestDb {
...
@@ -50,10 +50,15 @@ public class TestPageStore extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
null
);
deleteDb
(
null
);
testDropTempTable
();
testDropTempTable
();
testLogLimitFalsePositive
();
testLogLimitFalsePositive
();
...
...
h2/src/test/org/h2/test/unit/TestPageStoreCoverage.java
浏览文件 @
aad6a418
...
@@ -36,11 +36,16 @@ public class TestPageStoreCoverage extends TestDb {
...
@@ -36,11 +36,16 @@ public class TestPageStoreCoverage extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
// TODO mvcc, 2-phase commit
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
// TODO mvcc, 2-phase commit
deleteDb
(
"pageStoreCoverage"
);
deleteDb
(
"pageStoreCoverage"
);
testMoveRoot
();
testMoveRoot
();
testBasic
();
testBasic
();
...
...
h2/src/test/org/h2/test/unit/TestPgServer.java
浏览文件 @
aad6a418
...
@@ -47,10 +47,15 @@ public class TestPgServer extends TestDb {
...
@@ -47,10 +47,15 @@ public class TestPgServer extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
memory
)
{
if
(!
config
.
memory
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
// testPgAdapter() starts server by itself without a wait so run it first
// testPgAdapter() starts server by itself without a wait so run it first
testPgAdapter
();
testPgAdapter
();
testLowerCaseIdentifiers
();
testLowerCaseIdentifiers
();
...
...
h2/src/test/org/h2/test/unit/TestRecovery.java
浏览文件 @
aad6a418
...
@@ -37,10 +37,15 @@ public class TestRecovery extends TestDb {
...
@@ -37,10 +37,15 @@ public class TestRecovery extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
if
(!
config
.
mvStore
)
{
if
(!
config
.
mvStore
)
{
testRecoverTestMode
();
testRecoverTestMode
();
}
}
...
...
h2/src/test/org/h2/test/unit/TestSampleApps.java
浏览文件 @
aad6a418
...
@@ -35,10 +35,15 @@ public class TestSampleApps extends TestDb {
...
@@ -35,10 +35,15 @@ public class TestSampleApps extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
getBaseDir
().
startsWith
(
TestBase
.
BASE_TEST_DIR
))
{
if
(!
getBaseDir
().
startsWith
(
TestBase
.
BASE_TEST_DIR
))
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
getTestName
());
deleteDb
(
getTestName
());
InputStream
in
=
getClass
().
getClassLoader
().
getResourceAsStream
(
InputStream
in
=
getClass
().
getClassLoader
().
getResourceAsStream
(
"org/h2/samples/optimizations.sql"
);
"org/h2/samples/optimizations.sql"
);
...
...
h2/src/test/org/h2/test/unit/TestServlet.java
浏览文件 @
aad6a418
...
@@ -345,10 +345,15 @@ public class TestServlet extends TestDb {
...
@@ -345,10 +345,15 @@ public class TestServlet extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
||
config
.
memory
)
{
if
(
config
.
networked
||
config
.
memory
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
DbStarter
listener
=
new
DbStarter
();
DbStarter
listener
=
new
DbStarter
();
TestServletContext
context
=
new
TestServletContext
();
TestServletContext
context
=
new
TestServletContext
();
...
...
h2/src/test/org/h2/test/unit/TestTools.java
浏览文件 @
aad6a418
...
@@ -82,10 +82,15 @@ public class TestTools extends TestDb {
...
@@ -82,10 +82,15 @@ public class TestTools extends TestDb {
}
}
@Override
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
)
{
if
(
config
.
networked
)
{
return
;
return
false
;
}
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
DeleteDbFiles
.
execute
(
getBaseDir
(),
null
,
true
);
DeleteDbFiles
.
execute
(
getBaseDir
(),
null
,
true
);
org
.
h2
.
Driver
.
load
();
org
.
h2
.
Driver
.
load
();
testSimpleResultSet
();
testSimpleResultSet
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论