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;
import
java.lang.management.ManagementFactory
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Map.Entry
;
import
java.util.Properties
;
import
java.util.TimerTask
;
import
java.util.concurrent.TimeUnit
;
...
...
@@ -430,6 +432,7 @@ java org.h2.test.TestAll timer
private
Server
server
;
HashMap
<
Class
<?
extends
TestBase
>,
Boolean
>
executedTests
=
new
HashMap
<>();
/**
* Run all tests.
...
...
@@ -689,6 +692,12 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
cipher
=
null
;
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
{
...
...
h2/src/test/org/h2/test/TestBase.java
浏览文件 @
aad6a418
...
...
@@ -41,7 +41,6 @@ import org.h2.store.fs.FilePath;
import
org.h2.store.fs.FileUtils
;
import
org.h2.test.utils.ProxyCodeGenerator
;
import
org.h2.test.utils.ResultVerifier
;
import
org.h2.util.Utils
;
/**
* The base class for all tests.
...
...
@@ -128,16 +127,16 @@ public abstract class TestBase {
}
try
{
init
(
conf
);
if
(!
isEnabled
())
{
if
(!
conf
.
executedTests
.
containsKey
(
getClass
()))
{
conf
.
executedTests
.
put
(
getClass
(),
false
);
}
return
;
}
conf
.
executedTests
.
put
(
getClass
(),
true
);
start
=
System
.
nanoTime
();
test
();
if
(!
config
.
mvStore
)
{
/*
* This code is here to debug memory issues with PageStore testing on Travis.
*/
println
(
"("
+
(
Utils
.
getMemoryUsed
()
>>
10
)
+
" MiB used after)"
);
}
else
{
println
(
""
);
}
println
(
""
);
}
catch
(
Throwable
e
)
{
println
(
"FAIL "
+
e
.
toString
());
logError
(
"FAIL ("
+
conf
+
") "
+
e
.
toString
(),
e
);
...
...
@@ -438,6 +437,13 @@ public abstract class TestBase {
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.
*
...
...
h2/src/test/org/h2/test/db/TestBackup.java
浏览文件 @
aad6a418
...
...
@@ -35,10 +35,15 @@ public class TestBackup extends TestDb {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
testConcurrentBackup
();
testBackupRestoreLobStatement
();
testBackupRestoreLob
();
...
...
h2/src/test/org/h2/test/db/TestBigDb.java
浏览文件 @
aad6a418
...
...
@@ -31,13 +31,18 @@ public class TestBigDb extends TestDb {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
if
(
config
.
networked
&&
config
.
big
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
testLargeTable
();
testInsert
();
testLeftSummary
();
...
...
h2/src/test/org/h2/test/db/TestBigResult.java
浏览文件 @
aad6a418
...
...
@@ -38,10 +38,15 @@ public class TestBigResult extends TestDb {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
testLargeSubquery
();
testSortingAndDistinct
();
testLOB
();
...
...
h2/src/test/org/h2/test/db/TestCluster.java
浏览文件 @
aad6a418
...
...
@@ -35,6 +35,14 @@ public class TestCluster extends TestDb {
TestBase
.
createCaller
().
init
().
test
();
}
@Override
public
boolean
isEnabled
()
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testClob
();
...
...
@@ -47,9 +55,6 @@ public class TestCluster extends TestDb {
}
private
void
testClob
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
deleteFiles
();
org
.
h2
.
Driver
.
load
();
...
...
@@ -86,9 +91,6 @@ public class TestCluster extends TestDb {
}
private
void
testRecover
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
deleteFiles
();
org
.
h2
.
Driver
.
load
();
...
...
@@ -149,9 +151,6 @@ public class TestCluster extends TestDb {
}
private
void
testRollback
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
deleteFiles
();
org
.
h2
.
Driver
.
load
();
...
...
@@ -196,9 +195,6 @@ public class TestCluster extends TestDb {
}
private
void
testCase
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
deleteFiles
();
org
.
h2
.
Driver
.
load
();
...
...
@@ -252,9 +248,6 @@ public class TestCluster extends TestDb {
}
private
void
testClientInfo
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
deleteFiles
();
org
.
h2
.
Driver
.
load
();
...
...
@@ -304,9 +297,6 @@ public class TestCluster extends TestDb {
}
private
void
testCreateClusterAtRuntime
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
deleteFiles
();
org
.
h2
.
Driver
.
load
();
...
...
@@ -396,9 +386,6 @@ public class TestCluster extends TestDb {
}
private
void
testStartStopCluster
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
}
int
port1
=
9193
,
port2
=
9194
;
String
serverList
=
"localhost:"
+
port1
+
",localhost:"
+
port2
;
deleteFiles
();
...
...
h2/src/test/org/h2/test/db/TestEncryptedDb.java
浏览文件 @
aad6a418
...
...
@@ -29,10 +29,15 @@ public class TestEncryptedDb extends TestDb {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
||
config
.
cipher
!=
null
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
deleteDb
(
"encrypted"
);
Connection
conn
=
getConnection
(
"encrypted;CIPHER=AES"
,
"sa"
,
"123 123"
);
Statement
stat
=
conn
.
createStatement
();
...
...
h2/src/test/org/h2/test/db/TestLargeBlob.java
浏览文件 @
aad6a418
...
...
@@ -28,11 +28,15 @@ public class TestLargeBlob extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
big
||
config
.
memory
||
config
.
mvStore
||
config
.
networked
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"largeBlob"
);
String
url
=
getURL
(
"largeBlob;TRACE_LEVEL_FILE=0"
,
true
);
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 {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
deleteDb
(
"listener"
);
Connection
conn
;
conn
=
getConnection
(
"listener"
);
...
...
h2/src/test/org/h2/test/db/TestMergeUsing.java
浏览文件 @
aad6a418
...
...
@@ -34,12 +34,16 @@ public class TestMergeUsing extends TestDb implements Trigger {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
// TODO breaks in pagestore case
if
(!
config
.
mvStore
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
// Simple ID,NAME inserts, target table with PK initially empty
testMergeUsing
(
"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 {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
// pagestore and multithreaded was always experimental, we're not going to fix that
if
(!
config
.
mvStore
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testConcurrentSchemaChange
();
testConcurrentLobAdd
();
testConcurrentView
();
...
...
h2/src/test/org/h2/test/db/TestMultiThreadedKernel.java
浏览文件 @
aad6a418
...
...
@@ -43,10 +43,15 @@ public class TestMultiThreadedKernel extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
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"
);
testConcurrentRead
();
testCache
();
...
...
h2/src/test/org/h2/test/db/TestOutOfMemory.java
浏览文件 @
aad6a418
...
...
@@ -40,11 +40,16 @@ public class TestOutOfMemory extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
vmlens
)
{
// running out of memory will cause the vmlens agent to stop working
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
try
{
if
(!
config
.
travis
)
{
System
.
gc
();
...
...
h2/src/test/org/h2/test/db/TestPowerOff.java
浏览文件 @
aad6a418
...
...
@@ -39,10 +39,15 @@ public class TestPowerOff extends TestDb {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
if
(
config
.
big
||
config
.
googleAppEngine
)
{
dir
=
getBaseDir
();
url
=
DB_NAME
;
...
...
h2/src/test/org/h2/test/db/TestReadOnly.java
浏览文件 @
aad6a418
...
...
@@ -37,10 +37,15 @@ public class TestReadOnly extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testReadOnlyInZip
();
testReadOnlyTempTableResult
();
testReadOnlyConnect
();
...
...
h2/src/test/org/h2/test/db/TestSQLInjection.java
浏览文件 @
aad6a418
...
...
@@ -33,10 +33,15 @@ public class TestSQLInjection extends TestDb {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
reopen
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
deleteDb
(
"sqlInjection"
);
reconnect
(
"sqlInjection"
);
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 {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
multiThreaded
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testCancelStatement
();
if
(!
config
.
mvStore
)
{
testLocks
();
...
...
h2/src/test/org/h2/test/db/TestSpaceReuse.java
浏览文件 @
aad6a418
...
...
@@ -28,10 +28,15 @@ public class TestSpaceReuse extends TestDb {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
deleteDb
(
"spaceReuse"
);
long
max
=
0
,
now
=
0
,
min
=
Long
.
MAX_VALUE
;
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 {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
&&
config
.
mvStore
)
{
return
;
return
false
;
}
if
(
DataType
.
GEOMETRY_CLASS
!=
null
)
{
deleteDb
(
"spatial"
);
testSpatial
();
deleteDb
(
"spatial"
);
if
(
DataType
.
GEOMETRY_CLASS
==
null
)
{
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
deleteDb
(
"spatial"
);
testSpatial
();
deleteDb
(
"spatial"
);
}
private
void
testSpatial
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java
浏览文件 @
aad6a418
...
...
@@ -28,11 +28,15 @@ public class TestTwoPhaseCommit extends TestDb {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
||
config
.
networked
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
deleteDb
(
"twoPhaseCommit"
);
prepare
();
...
...
h2/src/test/org/h2/test/db/TestUpgrade.java
浏览文件 @
aad6a418
...
...
@@ -35,13 +35,18 @@ public class TestUpgrade extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
)
{
return
;
return
false
;
}
if
(!
Utils
.
isClassPresent
(
"org.h2.upgrade.v1_1.Driver"
))
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testLobs
();
testErrorUpgrading
();
testNoDb
();
...
...
h2/src/test/org/h2/test/jdbc/TestTransactionIsolation.java
浏览文件 @
aad6a418
...
...
@@ -28,12 +28,17 @@ public class TestTransactionIsolation extends TestDb {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
)
{
// no tests yet
}
else
{
testTableLevelLocking
();
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
testTableLevelLocking
();
}
private
void
testTableLevelLocking
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/mvcc/TestMvcc1.java
浏览文件 @
aad6a418
...
...
@@ -34,6 +34,14 @@ public class TestMvcc1 extends TestDb {
test
.
test
();
}
@Override
public
boolean
isEnabled
()
{
if
(!
config
.
mvStore
)
{
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
testCases
();
...
...
@@ -41,9 +49,6 @@ public class TestMvcc1 extends TestDb {
}
private
void
testCases
()
throws
SQLException
{
if
(!
config
.
mvStore
)
{
return
;
}
ResultSet
rs
;
// 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 {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
mvStore
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"mvcc2"
);
testConcurrentInsert
();
testConcurrentUpdate
();
...
...
h2/src/test/org/h2/test/mvcc/TestMvcc4.java
浏览文件 @
aad6a418
...
...
@@ -33,10 +33,15 @@ public class TestMvcc4 extends TestDb {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
||
!
config
.
mvStore
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
testSelectForUpdateAndUpdateConcurrency
();
}
...
...
h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded.java
浏览文件 @
aad6a418
...
...
@@ -30,10 +30,15 @@ public class TestMvccMultiThreaded extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
mvStore
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testConcurrentSelectForUpdate
();
testMergeWithUniqueKeyViolation
();
testConcurrentMerge
();
...
...
h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded2.java
浏览文件 @
aad6a418
...
...
@@ -46,10 +46,15 @@ public class TestMvccMultiThreaded2 extends TestDb {
}
@Override
public
void
test
()
throws
SQLException
,
InterruptedException
{
public
boolean
isEnabled
()
{
if
(!
config
.
mvStore
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
,
InterruptedException
{
testSelectForUpdateConcurrency
();
}
...
...
h2/src/test/org/h2/test/recover/RecoverLobTest.java
浏览文件 @
aad6a418
...
...
@@ -28,10 +28,15 @@ public class RecoverLobTest extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
||
config
.
memory
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testRecoverClob
();
}
...
...
h2/src/test/org/h2/test/scripts/TestScript.java
浏览文件 @
aad6a418
...
...
@@ -85,10 +85,15 @@ public class TestScript extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
&&
config
.
big
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
reconnectOften
=
!
config
.
memory
&&
config
.
big
;
testScript
(
"testScript.sql"
);
...
...
h2/src/test/org/h2/test/scripts/TestScriptSimple.java
浏览文件 @
aad6a418
...
...
@@ -33,10 +33,15 @@ public class TestScriptSimple extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
||
config
.
big
||
config
.
networked
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"scriptSimple"
);
reconnect
();
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 {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
big
)
{
return
;
return
false
;
}
if
(
config
.
codeCoverage
)
{
// run only when _not_ using a code coverage tool,
// because the tool might instrument our code but not
// java.util.*
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testPerformanceComparison
();
testMemoryUsageComparison
();
}
...
...
h2/src/test/org/h2/test/store/TestMVStoreStopCompact.java
浏览文件 @
aad6a418
...
...
@@ -29,10 +29,15 @@ public class TestMVStoreStopCompact extends TestBase {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
big
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
for
(
int
retentionTime
=
10
;
retentionTime
<
1000
;
retentionTime
*=
10
)
{
for
(
int
timeout
=
100
;
timeout
<=
1000
;
timeout
*=
10
)
{
testStopCompact
(
retentionTime
,
timeout
);
...
...
h2/src/test/org/h2/test/store/TestMVStoreTool.java
浏览文件 @
aad6a418
...
...
@@ -33,15 +33,20 @@ public class TestMVStoreTool extends TestBase {
test
.
test
();
}
@Override
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testCompact
();
}
private
void
testCompact
()
{
if
(
config
.
memory
)
{
return
;
}
String
fileName
=
getBaseDir
()
+
"/testCompact.h3"
;
String
fileNameNew
=
fileName
+
".new"
;
String
fileNameCompressed
=
fileNameNew
+
".compress"
;
...
...
h2/src/test/org/h2/test/store/TestMVTableEngine.java
浏览文件 @
aad6a418
...
...
@@ -50,10 +50,15 @@ public class TestMVTableEngine extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
config
.
mvStore
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testLobCopy
();
testLobReuse
();
testShutdownDuringLobCreation
();
...
...
h2/src/test/org/h2/test/synth/TestCrashAPI.java
浏览文件 @
aad6a418
...
...
@@ -148,6 +148,14 @@ public class TestCrashAPI extends TestDb implements Runnable {
}
}
@Override
public
boolean
isEnabled
()
{
if
(
config
.
networked
)
{
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
if
(
RECOVER_ALL
)
{
...
...
h2/src/test/org/h2/test/synth/TestKillRestart.java
浏览文件 @
aad6a418
...
...
@@ -26,13 +26,18 @@ import org.h2.test.utils.SelfDestructor;
public
class
TestKillRestart
extends
TestDb
{
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
)
{
return
;
return
false
;
}
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"killRestart"
);
String
url
=
getURL
(
"killRestart"
,
true
);
// String url = getURL(
...
...
h2/src/test/org/h2/test/synth/TestKillRestartMulti.java
浏览文件 @
aad6a418
...
...
@@ -68,13 +68,18 @@ public class TestKillRestartMulti extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
)
{
return
;
return
false
;
}
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"killRestartMulti"
);
url
=
getURL
(
"killRestartMulti"
,
true
);
user
=
getUser
();
...
...
h2/src/test/org/h2/test/synth/TestMultiThreaded.java
浏览文件 @
aad6a418
...
...
@@ -123,10 +123,15 @@ public class TestMultiThreaded extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"multiThreaded"
);
int
size
=
getSize
(
2
,
4
);
Connection
[]
connList
=
new
Connection
[
size
];
...
...
h2/src/test/org/h2/test/synth/TestRandomSQL.java
浏览文件 @
aad6a418
...
...
@@ -31,10 +31,15 @@ public class TestRandomSQL extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
int
len
=
getSize
(
2
,
6
);
for
(
int
a
=
0
;
a
<
len
;
a
++)
{
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 {
OPEN_WITHOUT_CLOSE_ON_EXIT
=
2
;
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
codeCoverage
||
config
.
networked
)
{
return
;
return
false
;
}
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"exit"
);
String
url
=
getURL
(
OPEN_WITH_CLOSE_ON_EXIT
);
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 {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
getFile
().
startsWith
(
TestBase
.
BASE_TEST_DIR
))
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
testFsFileLock
();
testFutureModificationDate
();
testSimple
();
...
...
h2/src/test/org/h2/test/unit/TestFileLockProcess.java
浏览文件 @
aad6a418
...
...
@@ -48,13 +48,18 @@ public class TestFileLockProcess extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
codeCoverage
||
config
.
networked
)
{
return
;
return
false
;
}
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"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 {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
println
(
"testSequence"
);
testSequence
();
println
(
"testAutoIncrement"
);
...
...
h2/src/test/org/h2/test/unit/TestFtp.java
浏览文件 @
aad6a418
...
...
@@ -30,10 +30,15 @@ public class TestFtp extends TestBase implements FtpEventListener {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
getBaseDir
().
indexOf
(
':'
)
>
0
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
FileUtils
.
delete
(
getBaseDir
()
+
"/ftp"
);
test
(
getBaseDir
());
FileUtils
.
delete
(
getBaseDir
()
+
"/ftp"
);
...
...
h2/src/test/org/h2/test/unit/TestModifyOnWrite.java
浏览文件 @
aad6a418
...
...
@@ -32,10 +32,15 @@ public class TestModifyOnWrite extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
SysProperties
.
MODIFY_ON_WRITE
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"modifyOnWrite"
);
String
dbFile
=
getBaseDir
()
+
"/modifyOnWrite.h2.db"
;
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 {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
||
config
.
mvStore
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
"multiThreadedKernel"
);
int
count
=
getSize
(
2
,
5
);
Thread
[]
list
=
new
Thread
[
count
];
...
...
h2/src/test/org/h2/test/unit/TestOldVersion.java
浏览文件 @
aad6a418
...
...
@@ -40,10 +40,15 @@ public class TestOldVersion extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
mvStore
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
cl
=
getClassLoader
(
"file:ext/h2-1.2.127.jar"
);
driver
=
getDriver
(
cl
);
if
(
driver
==
null
)
{
...
...
h2/src/test/org/h2/test/unit/TestPageStore.java
浏览文件 @
aad6a418
...
...
@@ -50,10 +50,15 @@ public class TestPageStore extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
null
);
testDropTempTable
();
testLogLimitFalsePositive
();
...
...
h2/src/test/org/h2/test/unit/TestPageStoreCoverage.java
浏览文件 @
aad6a418
...
...
@@ -36,11 +36,16 @@ public class TestPageStoreCoverage extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
// TODO mvcc, 2-phase commit
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
// TODO mvcc, 2-phase commit
deleteDb
(
"pageStoreCoverage"
);
testMoveRoot
();
testBasic
();
...
...
h2/src/test/org/h2/test/unit/TestPgServer.java
浏览文件 @
aad6a418
...
...
@@ -47,10 +47,15 @@ public class TestPgServer extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
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
();
testLowerCaseIdentifiers
();
...
...
h2/src/test/org/h2/test/unit/TestRecovery.java
浏览文件 @
aad6a418
...
...
@@ -37,10 +37,15 @@ public class TestRecovery extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
memory
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
if
(!
config
.
mvStore
)
{
testRecoverTestMode
();
}
...
...
h2/src/test/org/h2/test/unit/TestSampleApps.java
浏览文件 @
aad6a418
...
...
@@ -35,10 +35,15 @@ public class TestSampleApps extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(!
getBaseDir
().
startsWith
(
TestBase
.
BASE_TEST_DIR
))
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
getTestName
());
InputStream
in
=
getClass
().
getClassLoader
().
getResourceAsStream
(
"org/h2/samples/optimizations.sql"
);
...
...
h2/src/test/org/h2/test/unit/TestServlet.java
浏览文件 @
aad6a418
...
...
@@ -345,10 +345,15 @@ public class TestServlet extends TestDb {
}
@Override
public
void
test
()
throws
SQLException
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
||
config
.
memory
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
SQLException
{
DbStarter
listener
=
new
DbStarter
();
TestServletContext
context
=
new
TestServletContext
();
...
...
h2/src/test/org/h2/test/unit/TestTools.java
浏览文件 @
aad6a418
...
...
@@ -82,10 +82,15 @@ public class TestTools extends TestDb {
}
@Override
public
void
test
()
throws
Exception
{
public
boolean
isEnabled
()
{
if
(
config
.
networked
)
{
return
;
return
false
;
}
return
true
;
}
@Override
public
void
test
()
throws
Exception
{
DeleteDbFiles
.
execute
(
getBaseDir
(),
null
,
true
);
org
.
h2
.
Driver
.
load
();
testSimpleResultSet
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论