Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
c80aac29
提交
c80aac29
authored
11月 16, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete files after each test
上级
635c9e13
隐藏空白字符变更
内嵌
并排
正在显示
80 个修改的文件
包含
292 行增加
和
12 行删除
+292
-12
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+2
-0
TestAutoRecompile.java
h2/src/test/org/h2/test/db/TestAutoRecompile.java
+10
-0
TestBackup.java
h2/src/test/org/h2/test/db/TestBackup.java
+13
-0
TestBigDb.java
h2/src/test/org/h2/test/db/TestBigDb.java
+10
-0
TestBigResult.java
h2/src/test/org/h2/test/db/TestBigResult.java
+10
-0
TestCases.java
h2/src/test/org/h2/test/db/TestCases.java
+10
-0
TestCheckpoint.java
h2/src/test/org/h2/test/db/TestCheckpoint.java
+10
-0
TestCluster.java
h2/src/test/org/h2/test/db/TestCluster.java
+16
-3
TestCompatibility.java
h2/src/test/org/h2/test/db/TestCompatibility.java
+1
-1
TestCsv.java
h2/src/test/org/h2/test/db/TestCsv.java
+17
-1
TestDeadlock.java
h2/src/test/org/h2/test/db/TestDeadlock.java
+10
-1
TestEncryptedDb.java
h2/src/test/org/h2/test/db/TestEncryptedDb.java
+10
-0
TestExclusive.java
h2/src/test/org/h2/test/db/TestExclusive.java
+10
-1
TestFullText.java
h2/src/test/org/h2/test/db/TestFullText.java
+2
-1
TestFunctionOverload.java
h2/src/test/org/h2/test/db/TestFunctionOverload.java
+11
-1
TestFunctions.java
h2/src/test/org/h2/test/db/TestFunctions.java
+10
-0
TestIndex.java
h2/src/test/org/h2/test/db/TestIndex.java
+1
-0
TestLinkedTable.java
h2/src/test/org/h2/test/db/TestLinkedTable.java
+1
-0
TestListener.java
h2/src/test/org/h2/test/db/TestListener.java
+1
-1
TestLob.java
h2/src/test/org/h2/test/db/TestLob.java
+1
-0
TestLogFile.java
h2/src/test/org/h2/test/db/TestLogFile.java
+10
-0
TestMemoryUsage.java
h2/src/test/org/h2/test/db/TestMemoryUsage.java
+1
-0
TestMultiConn.java
h2/src/test/org/h2/test/db/TestMultiConn.java
+15
-0
TestMultiDimension.java
h2/src/test/org/h2/test/db/TestMultiDimension.java
+1
-0
TestOpenClose.java
h2/src/test/org/h2/test/db/TestOpenClose.java
+3
-0
TestOptimizations.java
h2/src/test/org/h2/test/db/TestOptimizations.java
+1
-0
TestOutOfMemory.java
h2/src/test/org/h2/test/db/TestOutOfMemory.java
+1
-0
TestPowerOff.java
h2/src/test/org/h2/test/db/TestPowerOff.java
+10
-0
TestReadOnly.java
h2/src/test/org/h2/test/db/TestReadOnly.java
+1
-0
TestRights.java
h2/src/test/org/h2/test/db/TestRights.java
+3
-0
TestRunscript.java
h2/src/test/org/h2/test/db/TestRunscript.java
+6
-0
TestSQLInjection.java
h2/src/test/org/h2/test/db/TestSQLInjection.java
+1
-0
TestScript.java
h2/src/test/org/h2/test/db/TestScript.java
+1
-0
TestScriptSimple.java
h2/src/test/org/h2/test/db/TestScriptSimple.java
+10
-0
TestSequence.java
h2/src/test/org/h2/test/db/TestSequence.java
+1
-0
TestSessionsLocks.java
h2/src/test/org/h2/test/db/TestSessionsLocks.java
+1
-0
TestSpaceReuse.java
h2/src/test/org/h2/test/db/TestSpaceReuse.java
+1
-0
TestSpeed.java
h2/src/test/org/h2/test/db/TestSpeed.java
+1
-0
TestTempTables.java
h2/src/test/org/h2/test/db/TestTempTables.java
+1
-0
TestTransaction.java
h2/src/test/org/h2/test/db/TestTransaction.java
+1
-0
TestTriggersConstraints.java
h2/src/test/org/h2/test/db/TestTriggersConstraints.java
+1
-0
TestTwoPhaseCommit.java
h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java
+1
-0
TestView.java
h2/src/test/org/h2/test/db/TestView.java
+1
-0
TestBatchUpdates.java
h2/src/test/org/h2/test/jdbc/TestBatchUpdates.java
+1
-0
TestCallableStatement.java
h2/src/test/org/h2/test/jdbc/TestCallableStatement.java
+1
-0
TestCancel.java
h2/src/test/org/h2/test/jdbc/TestCancel.java
+10
-0
TestDatabaseEventListener.java
h2/src/test/org/h2/test/jdbc/TestDatabaseEventListener.java
+1
-0
TestManyJdbcObjects.java
h2/src/test/org/h2/test/jdbc/TestManyJdbcObjects.java
+10
-0
TestMetaData.java
h2/src/test/org/h2/test/jdbc/TestMetaData.java
+1
-0
TestNativeSQL.java
h2/src/test/org/h2/test/jdbc/TestNativeSQL.java
+1
-0
TestPreparedStatement.java
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
+1
-0
TestResultSet.java
h2/src/test/org/h2/test/jdbc/TestResultSet.java
+1
-0
TestStatement.java
h2/src/test/org/h2/test/jdbc/TestStatement.java
+1
-0
TestTransactionIsolation.java
h2/src/test/org/h2/test/jdbc/TestTransactionIsolation.java
+1
-0
TestUpdatableResultSet.java
h2/src/test/org/h2/test/jdbc/TestUpdatableResultSet.java
+1
-0
TestZloty.java
h2/src/test/org/h2/test/jdbc/TestZloty.java
+1
-0
TestConnectionPool.java
h2/src/test/org/h2/test/jdbcx/TestConnectionPool.java
+1
-0
TestDataSource.java
h2/src/test/org/h2/test/jdbcx/TestDataSource.java
+1
-0
TestXA.java
h2/src/test/org/h2/test/jdbcx/TestXA.java
+3
-0
TestMvcc1.java
h2/src/test/org/h2/test/mvcc/TestMvcc1.java
+1
-0
TestMvcc2.java
h2/src/test/org/h2/test/mvcc/TestMvcc2.java
+1
-0
TestMvcc3.java
h2/src/test/org/h2/test/mvcc/TestMvcc3.java
+1
-0
TestMvccMultiThreaded.java
h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded.java
+1
-0
TestRowLocks.java
h2/src/test/org/h2/test/rowlock/TestRowLocks.java
+1
-0
TestAutoReconnect.java
h2/src/test/org/h2/test/server/TestAutoReconnect.java
+1
-0
TestAutoServer.java
h2/src/test/org/h2/test/server/TestAutoServer.java
+1
-0
TestNestedLoop.java
h2/src/test/org/h2/test/server/TestNestedLoop.java
+1
-1
TestPgServer.java
h2/src/test/org/h2/test/server/TestPgServer.java
+1
-0
TestFuzzOptimizations.java
h2/src/test/org/h2/test/synth/TestFuzzOptimizations.java
+1
-0
TestKillRestart.java
h2/src/test/org/h2/test/synth/TestKillRestart.java
+1
-0
TestKillRestartMulti.java
h2/src/test/org/h2/test/synth/TestKillRestartMulti.java
+2
-1
TestMultiThreaded.java
h2/src/test/org/h2/test/synth/TestMultiThreaded.java
+1
-0
TestRandomSQL.java
h2/src/test/org/h2/test/synth/TestRandomSQL.java
+5
-0
TestCache.java
h2/src/test/org/h2/test/unit/TestCache.java
+1
-0
TestDate.java
h2/src/test/org/h2/test/unit/TestDate.java
+2
-0
TestExit.java
h2/src/test/org/h2/test/unit/TestExit.java
+1
-0
TestMultiThreadedKernel.java
h2/src/test/org/h2/test/unit/TestMultiThreadedKernel.java
+1
-0
TestRecovery.java
h2/src/test/org/h2/test/unit/TestRecovery.java
+1
-0
TestSampleApps.java
h2/src/test/org/h2/test/unit/TestSampleApps.java
+1
-0
TestTools.java
h2/src/test/org/h2/test/unit/TestTools.java
+1
-0
没有找到文件。
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
c80aac29
...
@@ -284,6 +284,8 @@ java org.h2.test.TestAll timer
...
@@ -284,6 +284,8 @@ java org.h2.test.TestAll timer
split files (1 GB max size)
split files (1 GB max size)
allocating space gets slower and slower the larger the database.
test trace_level_file=3 performance (when throwing exceptions)
study SQLite file format
study SQLite file format
multithreaded kernel
multithreaded kernel
...
...
h2/src/test/org/h2/test/db/TestAutoRecompile.java
浏览文件 @
c80aac29
...
@@ -17,6 +17,15 @@ import org.h2.test.TestBase;
...
@@ -17,6 +17,15 @@ import org.h2.test.TestBase;
* Tests if prepared statements are re-compiled when required.
* Tests if prepared statements are re-compiled when required.
*/
*/
public
class
TestAutoRecompile
extends
TestBase
{
public
class
TestAutoRecompile
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
deleteDb
(
"autoRecompile"
);
deleteDb
(
"autoRecompile"
);
...
@@ -47,6 +56,7 @@ public class TestAutoRecompile extends TestBase {
...
@@ -47,6 +56,7 @@ public class TestAutoRecompile extends TestBase {
assertKnownException
(
e
);
assertKnownException
(
e
);
}
}
conn
.
close
();
conn
.
close
();
deleteDb
(
"autoRecompile"
);
}
}
}
}
h2/src/test/org/h2/test/db/TestBackup.java
浏览文件 @
c80aac29
...
@@ -12,17 +12,28 @@ import java.sql.Statement;
...
@@ -12,17 +12,28 @@ import java.sql.Statement;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
import
org.h2.tools.Restore
;
import
org.h2.tools.Restore
;
import
org.h2.util.FileUtils
;
/**
/**
* Test for the BACKUP SQL statement.
* Test for the BACKUP SQL statement.
*/
*/
public
class
TestBackup
extends
TestBase
{
public
class
TestBackup
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
logMode
==
0
)
{
if
(
config
.
memory
||
config
.
logMode
==
0
)
{
return
;
return
;
}
}
testBackup
();
testBackup
();
deleteDb
(
"backup"
);
}
}
private
void
testBackup
()
throws
SQLException
{
private
void
testBackup
()
throws
SQLException
{
...
@@ -54,6 +65,8 @@ public class TestBackup extends TestBase {
...
@@ -54,6 +65,8 @@ public class TestBackup extends TestBase {
conn1
.
close
();
conn1
.
close
();
conn2
.
close
();
conn2
.
close
();
conn3
.
close
();
conn3
.
close
();
deleteDb
(
"restored"
);
FileUtils
.
delete
(
baseDir
+
"/backup.zip"
);
}
}
}
}
h2/src/test/org/h2/test/db/TestBigDb.java
浏览文件 @
c80aac29
...
@@ -19,6 +19,15 @@ import org.h2.util.MemoryUtils;
...
@@ -19,6 +19,15 @@ import org.h2.util.MemoryUtils;
* Test for big databases.
* Test for big databases.
*/
*/
public
class
TestBigDb
extends
TestBase
{
public
class
TestBigDb
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
...
@@ -30,6 +39,7 @@ public class TestBigDb extends TestBase {
...
@@ -30,6 +39,7 @@ public class TestBigDb extends TestBase {
testLargeTable
();
testLargeTable
();
testInsert
();
testInsert
();
testLeftSummary
();
testLeftSummary
();
deleteDb
(
"bigDb"
);
}
}
private
void
testLargeTable
()
throws
SQLException
{
private
void
testLargeTable
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestBigResult.java
浏览文件 @
c80aac29
...
@@ -21,6 +21,15 @@ import org.h2.test.TestBase;
...
@@ -21,6 +21,15 @@ import org.h2.test.TestBase;
*/
*/
public
class
TestBigResult
extends
TestBase
{
public
class
TestBigResult
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
;
...
@@ -30,6 +39,7 @@ public class TestBigResult extends TestBase {
...
@@ -30,6 +39,7 @@ public class TestBigResult extends TestBase {
testCloseConnectionDelete
();
testCloseConnectionDelete
();
testOrderGroup
();
testOrderGroup
();
testLimitBufferedResult
();
testLimitBufferedResult
();
deleteDb
(
"bigResult"
);
}
}
private
void
testLargeSubquery
()
throws
SQLException
{
private
void
testLargeSubquery
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestCases.java
浏览文件 @
c80aac29
...
@@ -25,6 +25,15 @@ import org.h2.test.TestBase;
...
@@ -25,6 +25,15 @@ import org.h2.test.TestBase;
* Various test cases.
* Various test cases.
*/
*/
public
class
TestCases
extends
TestBase
{
public
class
TestCases
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
testInvalidDatabaseName
();
testInvalidDatabaseName
();
...
@@ -55,6 +64,7 @@ public class TestCases extends TestBase {
...
@@ -55,6 +64,7 @@ public class TestCases extends TestBase {
testDoubleRecovery
();
testDoubleRecovery
();
testConstraintReconnect
();
testConstraintReconnect
();
testCollation
();
testCollation
();
deleteDb
(
"cases"
);
}
}
private
void
testInvalidDatabaseName
()
throws
SQLException
{
private
void
testInvalidDatabaseName
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestCheckpoint.java
浏览文件 @
c80aac29
...
@@ -16,6 +16,15 @@ import org.h2.test.TestBase;
...
@@ -16,6 +16,15 @@ import org.h2.test.TestBase;
* Tests the CHECKPOINT SQL statement.
* Tests the CHECKPOINT SQL statement.
*/
*/
public
class
TestCheckpoint
extends
TestBase
{
public
class
TestCheckpoint
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
// TODO test checkpoint with rollback, not only just run the command
// TODO test checkpoint with rollback, not only just run the command
...
@@ -42,6 +51,7 @@ public class TestCheckpoint extends TestBase {
...
@@ -42,6 +51,7 @@ public class TestCheckpoint extends TestBase {
c0
.
close
();
c0
.
close
();
c1
.
close
();
c1
.
close
();
deleteDb
(
"checkpoint"
);
}
}
}
}
h2/src/test/org/h2/test/db/TestCluster.java
浏览文件 @
c80aac29
...
@@ -22,14 +22,21 @@ import org.h2.tools.Server;
...
@@ -22,14 +22,21 @@ import org.h2.tools.Server;
* Test for the cluster feature.
* Test for the cluster feature.
*/
*/
public
class
TestCluster
extends
TestBase
{
public
class
TestCluster
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
networked
)
{
if
(
config
.
memory
||
config
.
networked
)
{
return
;
return
;
}
}
deleteFiles
();
DeleteDbFiles
.
main
(
new
String
[]
{
"-dir"
,
baseDir
+
"/node1"
,
"-quiet"
});
DeleteDbFiles
.
main
(
new
String
[]
{
"-dir"
,
baseDir
+
"/node2"
,
"-quiet"
});
// create the master database
// create the master database
Connection
conn
;
Connection
conn
;
...
@@ -122,6 +129,12 @@ public class TestCluster extends TestBase {
...
@@ -122,6 +129,12 @@ public class TestCluster extends TestBase {
conn
.
createStatement
().
execute
(
"SELECT * FROM A"
);
conn
.
createStatement
().
execute
(
"SELECT * FROM A"
);
conn
.
close
();
conn
.
close
();
n2
.
stop
();
n2
.
stop
();
deleteFiles
();
}
private
void
deleteFiles
()
throws
SQLException
{
DeleteDbFiles
.
main
(
new
String
[]
{
"-dir"
,
baseDir
+
"/node1"
,
"-quiet"
});
DeleteDbFiles
.
main
(
new
String
[]
{
"-dir"
,
baseDir
+
"/node2"
,
"-quiet"
});
}
}
private
void
check
(
Connection
conn
,
int
len
)
throws
SQLException
{
private
void
check
(
Connection
conn
,
int
len
)
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestCompatibility.java
浏览文件 @
c80aac29
...
@@ -43,7 +43,7 @@ public class TestCompatibility extends TestBase {
...
@@ -43,7 +43,7 @@ public class TestCompatibility extends TestBase {
testMySQL
();
testMySQL
();
conn
.
close
();
conn
.
close
();
deleteDb
(
"compatibility"
);
}
}
private
void
testColumnAlias
()
throws
SQLException
{
private
void
testColumnAlias
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestCsv.java
浏览文件 @
c80aac29
...
@@ -32,6 +32,15 @@ import org.h2.util.StringUtils;
...
@@ -32,6 +32,15 @@ import org.h2.util.StringUtils;
*
*
*/
*/
public
class
TestCsv
extends
TestBase
{
public
class
TestCsv
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
testSpaceSeparated
();
testSpaceSeparated
();
...
@@ -43,6 +52,7 @@ public class TestCsv extends TestBase {
...
@@ -43,6 +52,7 @@ public class TestCsv extends TestBase {
testWriteRead
();
testWriteRead
();
testRead
();
testRead
();
testPipe
();
testPipe
();
deleteDb
(
"csv"
);
}
}
private
void
testSpaceSeparated
()
throws
SQLException
{
private
void
testSpaceSeparated
()
throws
SQLException
{
...
@@ -138,6 +148,7 @@ public class TestCsv extends TestBase {
...
@@ -138,6 +148,7 @@ public class TestCsv extends TestBase {
}
}
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
conn
.
close
();
conn
.
close
();
FileUtils
.
delete
(
baseDir
+
"/test.csv"
);
}
}
private
String
randomData
(
Random
random
)
{
private
String
randomData
(
Random
random
)
{
...
@@ -173,6 +184,7 @@ public class TestCsv extends TestBase {
...
@@ -173,6 +184,7 @@ public class TestCsv extends TestBase {
assertEquals
(
rs
.
getString
(
2
),
"Hello"
);
assertEquals
(
rs
.
getString
(
2
),
"Hello"
);
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
conn
.
close
();
conn
.
close
();
FileUtils
.
delete
(
baseDir
+
"/test.csv"
);
}
}
private
void
testFieldDelimiter
()
throws
Exception
{
private
void
testFieldDelimiter
()
throws
Exception
{
...
@@ -203,6 +215,8 @@ public class TestCsv extends TestBase {
...
@@ -203,6 +215,8 @@ public class TestCsv extends TestBase {
assertEquals
(
rs
.
getString
(
2
),
"\nHello*\n"
);
assertEquals
(
rs
.
getString
(
2
),
"\nHello*\n"
);
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
conn
.
close
();
conn
.
close
();
FileUtils
.
delete
(
baseDir
+
"/test.csv"
);
FileUtils
.
delete
(
baseDir
+
"/test2.csv"
);
}
}
private
void
testPipe
()
throws
SQLException
{
private
void
testPipe
()
throws
SQLException
{
...
@@ -225,6 +239,7 @@ public class TestCsv extends TestBase {
...
@@ -225,6 +239,7 @@ public class TestCsv extends TestBase {
// rs = prep.executeQuery();
// rs = prep.executeQuery();
conn
.
close
();
conn
.
close
();
FileUtils
.
delete
(
baseDir
+
"/test.csv"
);
}
}
private
void
testAsTable
()
throws
SQLException
{
private
void
testAsTable
()
throws
SQLException
{
...
@@ -287,6 +302,7 @@ public class TestCsv extends TestBase {
...
@@ -287,6 +302,7 @@ public class TestCsv extends TestBase {
// 201,2,0,18
// 201,2,0,18
// 201,2,0,18
// 201,2,0,18
// 201,2,0,18
// 201,2,0,18
FileUtils
.
delete
(
baseDir
+
"/test.csv"
);
}
}
private
void
testWriteRead
()
throws
SQLException
{
private
void
testWriteRead
()
throws
SQLException
{
...
@@ -313,7 +329,7 @@ public class TestCsv extends TestBase {
...
@@ -313,7 +329,7 @@ public class TestCsv extends TestBase {
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
rs
.
close
();
rs
.
close
();
conn
.
close
();
conn
.
close
();
FileUtils
.
delete
(
baseDir
+
"/testRW.csv"
);
}
}
}
}
h2/src/test/org/h2/test/db/TestDeadlock.java
浏览文件 @
c80aac29
...
@@ -33,13 +33,22 @@ public class TestDeadlock extends TestBase {
...
@@ -33,13 +33,22 @@ public class TestDeadlock extends TestBase {
Connection
c3
;
Connection
c3
;
private
volatile
SQLException
lastException
;
private
volatile
SQLException
lastException
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
deleteDb
(
"deadlock"
);
deleteDb
(
"deadlock"
);
testDiningPhilosophers
();
testDiningPhilosophers
();
testLockUpgrade
();
testLockUpgrade
();
testThreePhilosophers
();
testThreePhilosophers
();
testNoDeadlock
();
testNoDeadlock
();
deleteDb
(
"deadlock"
);
}
}
private
void
initTest
()
throws
SQLException
{
private
void
initTest
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestEncryptedDb.java
浏览文件 @
c80aac29
...
@@ -17,6 +17,15 @@ import org.h2.test.TestBase;
...
@@ -17,6 +17,15 @@ import org.h2.test.TestBase;
* Test using an encrypted database.
* Test using an encrypted database.
*/
*/
public
class
TestEncryptedDb
extends
TestBase
{
public
class
TestEncryptedDb
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
cipher
!=
null
)
{
if
(
config
.
memory
||
config
.
cipher
!=
null
)
{
...
@@ -51,6 +60,7 @@ public class TestEncryptedDb extends TestBase {
...
@@ -51,6 +60,7 @@ public class TestEncryptedDb extends TestBase {
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
conn
.
close
();
conn
.
close
();
deleteDb
(
"exclusive"
);
}
}
}
}
h2/src/test/org/h2/test/db/TestExclusive.java
浏览文件 @
c80aac29
...
@@ -16,6 +16,15 @@ import org.h2.test.TestBase;
...
@@ -16,6 +16,15 @@ import org.h2.test.TestBase;
* Test for the exclusive mode.
* Test for the exclusive mode.
*/
*/
public
class
TestExclusive
extends
TestBase
{
public
class
TestExclusive
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
deleteDb
(
"exclusive"
);
deleteDb
(
"exclusive"
);
...
@@ -64,7 +73,7 @@ public class TestExclusive extends TestBase {
...
@@ -64,7 +73,7 @@ public class TestExclusive extends TestBase {
// check that exclusive mode is off when disconnected
// check that exclusive mode is off when disconnected
stat2
.
execute
(
"select * from dual"
);
stat2
.
execute
(
"select * from dual"
);
conn2
.
close
();
conn2
.
close
();
deleteDb
(
"exclusive"
);
}
}
}
}
h2/src/test/org/h2/test/db/TestFullText.java
浏览文件 @
c80aac29
...
@@ -54,7 +54,8 @@ public class TestFullText extends TestBase {
...
@@ -54,7 +54,8 @@ public class TestFullText extends TestBase {
println
(
"Class not found, not tested: "
+
luceneFullTextClassName
);
println
(
"Class not found, not tested: "
+
luceneFullTextClassName
);
// ok
// ok
}
}
deleteDb
(
"fullText"
);
deleteDb
(
"fullTextReopen"
);
}
}
private
void
testCreateDrop
()
throws
SQLException
{
private
void
testCreateDrop
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestFunctionOverload.java
浏览文件 @
c80aac29
...
@@ -24,9 +24,18 @@ public class TestFunctionOverload extends TestBase {
...
@@ -24,9 +24,18 @@ public class TestFunctionOverload extends TestBase {
private
static
final
String
ME
=
TestFunctionOverload
.
class
.
getName
();
private
static
final
String
ME
=
TestFunctionOverload
.
class
.
getName
();
private
Connection
conn
;
private
Connection
conn
;
private
DatabaseMetaData
meta
;
private
DatabaseMetaData
meta
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
this
.
deleteDb
(
"functionOverload"
);
deleteDb
(
"functionOverload"
);
conn
=
getConnection
(
"functionOverload"
);
conn
=
getConnection
(
"functionOverload"
);
meta
=
conn
.
getMetaData
();
meta
=
conn
.
getMetaData
();
testControl
();
testControl
();
...
@@ -35,6 +44,7 @@ public class TestFunctionOverload extends TestBase {
...
@@ -35,6 +44,7 @@ public class TestFunctionOverload extends TestBase {
testOverloadWithConnection
();
testOverloadWithConnection
();
testOverloadError
();
testOverloadError
();
conn
.
close
();
conn
.
close
();
deleteDb
(
"functionOverload"
);
}
}
private
void
testOverloadError
()
throws
SQLException
{
private
void
testOverloadError
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestFunctions.java
浏览文件 @
c80aac29
...
@@ -31,12 +31,22 @@ import org.h2.util.IOUtils;
...
@@ -31,12 +31,22 @@ import org.h2.util.IOUtils;
* Tests for user defined functions and aggregates.
* Tests for user defined functions and aggregates.
*/
*/
public
class
TestFunctions
extends
TestBase
{
public
class
TestFunctions
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
testVarArgs
();
testVarArgs
();
testAggregate
();
testAggregate
();
testFunctions
();
testFunctions
();
testFileRead
();
testFileRead
();
deleteDb
(
"functions"
);
}
}
private
void
testVarArgs
()
throws
SQLException
{
private
void
testVarArgs
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestIndex.java
浏览文件 @
c80aac29
...
@@ -69,6 +69,7 @@ public class TestIndex extends TestBase {
...
@@ -69,6 +69,7 @@ public class TestIndex extends TestBase {
testMultiColumnHashIndex
();
testMultiColumnHashIndex
();
conn
.
close
();
conn
.
close
();
deleteDb
(
"index"
);
}
}
private
void
testHashIndex
()
throws
SQLException
{
private
void
testHashIndex
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestLinkedTable.java
浏览文件 @
c80aac29
...
@@ -43,6 +43,7 @@ public class TestLinkedTable extends TestBase {
...
@@ -43,6 +43,7 @@ public class TestLinkedTable extends TestBase {
testLinkEmitUpdates
();
testLinkEmitUpdates
();
testLinkTable
();
testLinkTable
();
testLinkTwoTables
();
testLinkTwoTables
();
deleteDb
(
"linkedTable"
);
}
}
// this is not a bug, it is the documented behavior
// this is not a bug, it is the documented behavior
...
...
h2/src/test/org/h2/test/db/TestListener.java
浏览文件 @
c80aac29
...
@@ -48,7 +48,7 @@ public class TestListener extends TestBase implements DatabaseEventListener {
...
@@ -48,7 +48,7 @@ public class TestListener extends TestBase implements DatabaseEventListener {
conn
=
getConnection
(
"listener;database_event_listener='"
+
getClass
().
getName
()
+
"'"
);
conn
=
getConnection
(
"listener;database_event_listener='"
+
getClass
().
getName
()
+
"'"
);
conn
.
close
();
conn
.
close
();
deleteDb
(
"listener"
);
}
}
public
void
diskSpaceIsLow
(
long
stillAvailable
)
{
public
void
diskSpaceIsLow
(
long
stillAvailable
)
{
...
...
h2/src/test/org/h2/test/db/TestLob.java
浏览文件 @
c80aac29
...
@@ -71,6 +71,7 @@ public class TestLob extends TestBase {
...
@@ -71,6 +71,7 @@ public class TestLob extends TestBase {
testLob
(
false
);
testLob
(
false
);
testLob
(
true
);
testLob
(
true
);
testJavaObject
();
testJavaObject
();
deleteDb
(
"lob"
);
}
}
private
void
testLobDeleteTemp
()
throws
SQLException
{
private
void
testLobDeleteTemp
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestLogFile.java
浏览文件 @
c80aac29
...
@@ -24,6 +24,15 @@ public class TestLogFile extends TestBase {
...
@@ -24,6 +24,15 @@ public class TestLogFile extends TestBase {
private
static
final
int
MAX_LOG_SIZE
=
1
;
private
static
final
int
MAX_LOG_SIZE
=
1
;
private
Connection
conn
;
private
Connection
conn
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
private
long
reconnect
(
int
maxFiles
)
throws
SQLException
{
private
long
reconnect
(
int
maxFiles
)
throws
SQLException
{
if
(
conn
!=
null
)
{
if
(
conn
!=
null
)
{
...
@@ -64,6 +73,7 @@ public class TestLogFile extends TestBase {
...
@@ -64,6 +73,7 @@ public class TestLogFile extends TestBase {
}
finally
{
}
finally
{
System
.
setProperty
(
SysProperties
.
H2_LOG_DELETE_DELAY
,
""
+
old
);
System
.
setProperty
(
SysProperties
.
H2_LOG_DELETE_DELAY
,
""
+
old
);
}
}
deleteDb
(
"logfile"
);
}
}
private
void
checkLogSize
()
throws
SQLException
{
private
void
checkLogSize
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestMemoryUsage.java
浏览文件 @
c80aac29
...
@@ -45,6 +45,7 @@ public class TestMemoryUsage extends TestBase {
...
@@ -45,6 +45,7 @@ public class TestMemoryUsage extends TestBase {
reconnect
();
reconnect
();
insertUpdateSelectDelete
();
insertUpdateSelectDelete
();
conn
.
close
();
conn
.
close
();
deleteDb
(
"memoryUsage"
);
}
}
private
void
testCreateDropLoop
()
throws
SQLException
{
private
void
testCreateDropLoop
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestMultiConn.java
浏览文件 @
c80aac29
...
@@ -21,11 +21,21 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener {
...
@@ -21,11 +21,21 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener {
private
static
int
wait
;
private
static
int
wait
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
testConcurrentShutdownQuery
();
testConcurrentShutdownQuery
();
testCommitRollback
();
testCommitRollback
();
testConcurrentOpen
();
testConcurrentOpen
();
testThreeThreads
();
testThreeThreads
();
deleteDb
(
"multiConn"
);
}
}
private
void
testConcurrentShutdownQuery
()
throws
Exception
{
private
void
testConcurrentShutdownQuery
()
throws
Exception
{
...
@@ -53,6 +63,11 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener {
...
@@ -53,6 +63,11 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener {
Thread
.
sleep
(
50
);
Thread
.
sleep
(
50
);
stat1
.
execute
(
"SHUTDOWN"
);
stat1
.
execute
(
"SHUTDOWN"
);
conn1
.
close
();
conn1
.
close
();
try
{
conn2
.
close
();
}
catch
(
SQLException
e
)
{
// ignore
}
}
}
private
void
testThreeThreads
()
throws
Exception
{
private
void
testThreeThreads
()
throws
Exception
{
...
...
h2/src/test/org/h2/test/db/TestMultiDimension.java
浏览文件 @
c80aac29
...
@@ -130,6 +130,7 @@ public class TestMultiDimension extends TestBase {
...
@@ -130,6 +130,7 @@ public class TestMultiDimension extends TestBase {
// trace("t1="+time1+" t2="+time2+" size="+size);
// trace("t1="+time1+" t2="+time2+" size="+size);
}
}
conn
.
close
();
conn
.
close
();
deleteDb
(
"multiDimension"
);
}
}
/**
/**
...
...
h2/src/test/org/h2/test/db/TestOpenClose.java
浏览文件 @
c80aac29
...
@@ -16,6 +16,7 @@ import java.sql.Statement;
...
@@ -16,6 +16,7 @@ import java.sql.Statement;
import
org.h2.api.DatabaseEventListener
;
import
org.h2.api.DatabaseEventListener
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
import
org.h2.tools.Restore
;
import
org.h2.tools.Restore
;
import
org.h2.util.FileUtils
;
/**
/**
* Tests opening and closing a database.
* Tests opening and closing a database.
...
@@ -30,6 +31,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
...
@@ -30,6 +31,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
testBackup
(
true
);
testBackup
(
true
);
testCase
();
testCase
();
testReconnectFast
();
testReconnectFast
();
deleteDb
(
"openClose"
);
}
}
private
void
testCloseDelay
()
throws
Exception
{
private
void
testCloseDelay
()
throws
Exception
{
...
@@ -72,6 +74,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
...
@@ -72,6 +74,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
assertEquals
(
rs
.
getString
(
1
).
length
(),
10000
);
assertEquals
(
rs
.
getString
(
1
).
length
(),
10000
);
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
conn
.
close
();
conn
.
close
();
FileUtils
.
delete
(
baseDir
+
"/test.zip"
);
}
}
private
void
testReconnectFast
()
throws
SQLException
{
private
void
testReconnectFast
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestOptimizations.java
浏览文件 @
c80aac29
...
@@ -53,6 +53,7 @@ public class TestOptimizations extends TestBase {
...
@@ -53,6 +53,7 @@ public class TestOptimizations extends TestBase {
testIn
();
testIn
();
testMinMaxCountOptimization
(
true
);
testMinMaxCountOptimization
(
true
);
testMinMaxCountOptimization
(
false
);
testMinMaxCountOptimization
(
false
);
deleteDb
(
"optimizations"
);
}
}
private
void
testInSelectJoin
()
throws
SQLException
{
private
void
testInSelectJoin
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestOutOfMemory.java
浏览文件 @
c80aac29
...
@@ -63,6 +63,7 @@ public class TestOutOfMemory extends TestBase {
...
@@ -63,6 +63,7 @@ public class TestOutOfMemory extends TestBase {
}
finally
{
}
finally
{
conn
.
close
();
conn
.
close
();
}
}
deleteDb
(
"outOfMemory"
);
}
}
private
void
eatMemory
(
int
remainingKB
)
{
private
void
eatMemory
(
int
remainingKB
)
{
...
...
h2/src/test/org/h2/test/db/TestPowerOff.java
浏览文件 @
c80aac29
...
@@ -32,6 +32,15 @@ public class TestPowerOff extends TestBase {
...
@@ -32,6 +32,15 @@ public class TestPowerOff extends TestBase {
private
String
dir
,
url
;
private
String
dir
,
url
;
private
int
maxPowerOffCount
;
private
int
maxPowerOffCount
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
if
(
config
.
memory
||
config
.
logMode
==
0
)
{
if
(
config
.
memory
||
config
.
logMode
==
0
)
{
...
@@ -49,6 +58,7 @@ public class TestPowerOff extends TestBase {
...
@@ -49,6 +58,7 @@ public class TestPowerOff extends TestBase {
testNoIndexFile
();
testNoIndexFile
();
testMemoryTables
();
testMemoryTables
();
testPersistentTables
();
testPersistentTables
();
deleteDb
(
dir
,
dbName
);
}
}
private
void
testSummaryCrash
()
throws
SQLException
{
private
void
testSummaryCrash
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestReadOnly.java
浏览文件 @
c80aac29
...
@@ -32,6 +32,7 @@ public class TestReadOnly extends TestBase {
...
@@ -32,6 +32,7 @@ public class TestReadOnly extends TestBase {
if
(!
config
.
deleteIndex
)
{
if
(!
config
.
deleteIndex
)
{
testReadOnlyFiles
(
false
);
testReadOnlyFiles
(
false
);
}
}
deleteDb
(
"readonly"
);
}
}
private
void
testReadOnlyDbCreate
()
throws
SQLException
{
private
void
testReadOnlyDbCreate
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestRights.java
浏览文件 @
c80aac29
...
@@ -13,6 +13,7 @@ import java.sql.SQLException;
...
@@ -13,6 +13,7 @@ import java.sql.SQLException;
import
java.sql.Statement
;
import
java.sql.Statement
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
import
org.h2.util.FileUtils
;
/**
/**
* Access rights tests.
* Access rights tests.
...
@@ -26,6 +27,7 @@ public class TestRights extends TestBase {
...
@@ -26,6 +27,7 @@ public class TestRights extends TestBase {
// testLowerCaseUser();
// testLowerCaseUser();
testSchemaRenameUser
();
testSchemaRenameUser
();
testAccessRights
();
testAccessRights
();
deleteDb
(
"rights"
);
}
}
// public void testLowerCaseUser() throws SQLException {
// public void testLowerCaseUser() throws SQLException {
...
@@ -234,6 +236,7 @@ public class TestRights extends TestBase {
...
@@ -234,6 +236,7 @@ public class TestRights extends TestBase {
conn
.
close
();
conn
.
close
();
conn
=
getConnection
(
"rights"
);
conn
=
getConnection
(
"rights"
);
conn
.
close
();
conn
.
close
();
FileUtils
.
delete
(
baseDir
+
"/rights.sql"
);
}
}
private
void
testTableType
(
Connection
conn
,
String
type
)
throws
SQLException
{
private
void
testTableType
(
Connection
conn
,
String
type
)
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestRunscript.java
浏览文件 @
c80aac29
...
@@ -12,6 +12,7 @@ import java.sql.Statement;
...
@@ -12,6 +12,7 @@ import java.sql.Statement;
import
org.h2.api.Trigger
;
import
org.h2.api.Trigger
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
import
org.h2.util.FileUtils
;
/**
/**
* Tests the RUNSCRIPT SQL statement.
* Tests the RUNSCRIPT SQL statement.
...
@@ -21,6 +22,7 @@ public class TestRunscript extends TestBase implements Trigger {
...
@@ -21,6 +22,7 @@ public class TestRunscript extends TestBase implements Trigger {
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
test
(
false
);
test
(
false
);
test
(
true
);
test
(
true
);
deleteDb
(
"runscript"
);
}
}
/**
/**
...
@@ -89,6 +91,10 @@ public class TestRunscript extends TestBase implements Trigger {
...
@@ -89,6 +91,10 @@ public class TestRunscript extends TestBase implements Trigger {
conn1
.
close
();
conn1
.
close
();
conn2
.
close
();
conn2
.
close
();
deleteDb
(
"runscriptRestore"
);
FileUtils
.
delete
(
baseDir
+
"/backup.2.sql"
);
FileUtils
.
delete
(
baseDir
+
"/backup.3.sql"
);
}
}
public
void
init
(
Connection
conn
,
String
schemaName
,
String
triggerName
,
String
tableName
,
boolean
before
,
int
type
)
{
public
void
init
(
Connection
conn
,
String
schemaName
,
String
triggerName
,
String
tableName
,
boolean
before
,
int
type
)
{
...
...
h2/src/test/org/h2/test/db/TestSQLInjection.java
浏览文件 @
c80aac29
...
@@ -81,6 +81,7 @@ public class TestSQLInjection extends TestBase {
...
@@ -81,6 +81,7 @@ public class TestSQLInjection extends TestBase {
assertTrue
(
checkPasswordSecure
(
"123456"
));
assertTrue
(
checkPasswordSecure
(
"123456"
));
assertFalse
(
checkPasswordSecure
(
"' OR ''='"
));
assertFalse
(
checkPasswordSecure
(
"' OR ''='"
));
conn
.
close
();
conn
.
close
();
deleteDb
(
"sqlInjection"
);
}
}
private
boolean
checkPasswordInsecure
(
String
pwd
)
throws
SQLException
{
private
boolean
checkPasswordInsecure
(
String
pwd
)
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestScript.java
浏览文件 @
c80aac29
...
@@ -81,6 +81,7 @@ public class TestScript extends TestBase {
...
@@ -81,6 +81,7 @@ public class TestScript extends TestBase {
testScript
();
testScript
();
}
}
}
}
deleteDb
(
"script"
);
}
}
private
void
testScript
()
throws
Exception
{
private
void
testScript
()
throws
Exception
{
...
...
h2/src/test/org/h2/test/db/TestScriptSimple.java
浏览文件 @
c80aac29
...
@@ -23,6 +23,15 @@ import org.h2.util.ScriptReader;
...
@@ -23,6 +23,15 @@ import org.h2.util.ScriptReader;
public
class
TestScriptSimple
extends
TestBase
{
public
class
TestScriptSimple
extends
TestBase
{
private
Connection
conn
;
private
Connection
conn
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
if
(
config
.
memory
||
config
.
big
||
config
.
networked
)
{
if
(
config
.
memory
||
config
.
big
||
config
.
networked
)
{
...
@@ -62,6 +71,7 @@ public class TestScriptSimple extends TestBase {
...
@@ -62,6 +71,7 @@ public class TestScriptSimple extends TestBase {
}
}
is
.
close
();
is
.
close
();
conn
.
close
();
conn
.
close
();
deleteDb
(
"scriptSimple"
);
}
}
private
void
reconnect
()
throws
SQLException
{
private
void
reconnect
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestSequence.java
浏览文件 @
c80aac29
...
@@ -23,6 +23,7 @@ public class TestSequence extends TestBase {
...
@@ -23,6 +23,7 @@ public class TestSequence extends TestBase {
testAlterSequence
();
testAlterSequence
();
testCache
();
testCache
();
testTwo
();
testTwo
();
deleteDb
(
"sequence"
);
}
}
private
void
testAlterSequenceColumn
()
throws
SQLException
{
private
void
testAlterSequenceColumn
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestSessionsLocks.java
浏览文件 @
c80aac29
...
@@ -24,6 +24,7 @@ public class TestSessionsLocks extends TestBase {
...
@@ -24,6 +24,7 @@ public class TestSessionsLocks extends TestBase {
}
}
testCancelStatement
();
testCancelStatement
();
testLocks
();
testLocks
();
deleteDb
(
"sessionsLocks"
);
}
}
private
void
testLocks
()
throws
SQLException
{
private
void
testLocks
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestSpaceReuse.java
浏览文件 @
c80aac29
...
@@ -41,6 +41,7 @@ public class TestSpaceReuse extends TestBase {
...
@@ -41,6 +41,7 @@ public class TestSpaceReuse extends TestBase {
if
(
now
>
first
)
{
if
(
now
>
first
)
{
fail
(
"first: "
+
first
+
" now: "
+
now
);
fail
(
"first: "
+
first
+
" now: "
+
now
);
}
}
deleteDb
(
"spaceReuse"
);
}
}
}
}
h2/src/test/org/h2/test/db/TestSpeed.java
浏览文件 @
c80aac29
...
@@ -156,6 +156,7 @@ public class TestSpeed extends TestBase {
...
@@ -156,6 +156,7 @@ public class TestSpeed extends TestBase {
conn
.
close
();
conn
.
close
();
time
=
System
.
currentTimeMillis
()
-
time
;
time
=
System
.
currentTimeMillis
()
-
time
;
trace
(
time
+
" close"
);
trace
(
time
+
" close"
);
deleteDb
(
"speed"
);
}
}
// private void testOuterJoin() throws SQLException {
// private void testOuterJoin() throws SQLException {
...
...
h2/src/test/org/h2/test/db/TestTempTables.java
浏览文件 @
c80aac29
...
@@ -35,6 +35,7 @@ public class TestTempTables extends TestBase {
...
@@ -35,6 +35,7 @@ public class TestTempTables extends TestBase {
testIndexes
(
c1
,
c2
);
testIndexes
(
c1
,
c2
);
c1
.
close
();
c1
.
close
();
c2
.
close
();
c2
.
close
();
deleteDb
(
"tempTables"
);
}
}
private
void
testIndexes
(
Connection
conn1
,
Connection
conn2
)
throws
SQLException
{
private
void
testIndexes
(
Connection
conn1
,
Connection
conn2
)
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestTransaction.java
浏览文件 @
c80aac29
...
@@ -28,6 +28,7 @@ public class TestTransaction extends TestBase {
...
@@ -28,6 +28,7 @@ public class TestTransaction extends TestBase {
testReferential
();
testReferential
();
testSavepoint
();
testSavepoint
();
testIsolation
();
testIsolation
();
deleteDb
(
"transaction"
);
}
}
private
void
testSetTransaction
()
throws
SQLException
{
private
void
testSetTransaction
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestTriggersConstraints.java
浏览文件 @
c80aac29
...
@@ -30,6 +30,7 @@ public class TestTriggersConstraints extends TestBase implements Trigger {
...
@@ -30,6 +30,7 @@ public class TestTriggersConstraints extends TestBase implements Trigger {
testTriggerAlterTable
();
testTriggerAlterTable
();
testTriggers
();
testTriggers
();
testConstraints
();
testConstraints
();
deleteDb
(
"trigger"
);
}
}
/**
/**
...
...
h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java
浏览文件 @
c80aac29
...
@@ -32,6 +32,7 @@ public class TestTwoPhaseCommit extends TestBase {
...
@@ -32,6 +32,7 @@ public class TestTwoPhaseCommit extends TestBase {
prepare
();
prepare
();
openWith
(
false
);
openWith
(
false
);
test
(
false
);
test
(
false
);
deleteDb
(
"twoPhaseCommit"
);
}
}
private
void
test
(
boolean
rolledBack
)
throws
SQLException
{
private
void
test
(
boolean
rolledBack
)
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestView.java
浏览文件 @
c80aac29
...
@@ -21,6 +21,7 @@ public class TestView extends TestBase {
...
@@ -21,6 +21,7 @@ public class TestView extends TestBase {
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
testUnionReconnect
();
testUnionReconnect
();
testManyViews
();
testManyViews
();
deleteDb
(
"view"
);
}
}
private
void
testUnionReconnect
()
throws
SQLException
{
private
void
testUnionReconnect
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/jdbc/TestBatchUpdates.java
浏览文件 @
c80aac29
...
@@ -47,6 +47,7 @@ public class TestBatchUpdates extends TestBase {
...
@@ -47,6 +47,7 @@ public class TestBatchUpdates extends TestBase {
testExecuteCall
();
testExecuteCall
();
testException
();
testException
();
testCoffee
();
testCoffee
();
deleteDb
(
"batchUpdates"
);
}
}
private
void
testExecuteCall
()
throws
SQLException
{
private
void
testExecuteCall
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/jdbc/TestCallableStatement.java
浏览文件 @
c80aac29
...
@@ -24,6 +24,7 @@ public class TestCallableStatement extends TestBase {
...
@@ -24,6 +24,7 @@ public class TestCallableStatement extends TestBase {
Connection
conn
=
getConnection
(
"preparedStatement"
);
Connection
conn
=
getConnection
(
"preparedStatement"
);
testPrepare
(
conn
);
testPrepare
(
conn
);
conn
.
close
();
conn
.
close
();
deleteDb
(
"callableStatement"
);
}
}
private
void
testPrepare
(
Connection
conn
)
throws
SQLException
{
private
void
testPrepare
(
Connection
conn
)
throws
SQLException
{
...
...
h2/src/test/org/h2/test/jdbc/TestCancel.java
浏览文件 @
c80aac29
...
@@ -23,6 +23,15 @@ import org.h2.test.TestBase;
...
@@ -23,6 +23,15 @@ import org.h2.test.TestBase;
public
class
TestCancel
extends
TestBase
{
public
class
TestCancel
extends
TestBase
{
private
static
int
lastVisited
;
private
static
int
lastVisited
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
/**
/**
* This thread cancels a statement after some time.
* This thread cancels a statement after some time.
...
@@ -66,6 +75,7 @@ public class TestCancel extends TestBase {
...
@@ -66,6 +75,7 @@ public class TestCancel extends TestBase {
testQueryTimeout
();
testQueryTimeout
();
testJdbcQueryTimeout
();
testJdbcQueryTimeout
();
testCancelStatement
();
testCancelStatement
();
deleteDb
(
"cancel"
);
}
}
private
void
testReset
()
throws
SQLException
{
private
void
testReset
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/jdbc/TestDatabaseEventListener.java
浏览文件 @
c80aac29
...
@@ -26,6 +26,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent
...
@@ -26,6 +26,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent
testCalled
();
testCalled
();
testCloseLog0
(
false
);
testCloseLog0
(
false
);
testCloseLog0
(
true
);
testCloseLog0
(
true
);
deleteDb
(
"databaseEventListener"
);
}
}
private
void
testCloseLog0
(
boolean
shutdown
)
throws
SQLException
{
private
void
testCloseLog0
(
boolean
shutdown
)
throws
SQLException
{
...
...
h2/src/test/org/h2/test/jdbc/TestManyJdbcObjects.java
浏览文件 @
c80aac29
...
@@ -20,11 +20,21 @@ import org.h2.test.TestBase;
...
@@ -20,11 +20,21 @@ import org.h2.test.TestBase;
* Tests the server by creating many JDBC objects (result sets and so on).
* Tests the server by creating many JDBC objects (result sets and so on).
*/
*/
public
class
TestManyJdbcObjects
extends
TestBase
{
public
class
TestManyJdbcObjects
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
testNestedResultSets
();
testNestedResultSets
();
testManyConnections
();
testManyConnections
();
testOneConnectionPrepare
();
testOneConnectionPrepare
();
deleteDb
(
"manyObjects"
);
}
}
private
void
testNestedResultSets
()
throws
SQLException
{
private
void
testNestedResultSets
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/jdbc/TestMetaData.java
浏览文件 @
c80aac29
...
@@ -207,6 +207,7 @@ public class TestMetaData extends TestBase {
...
@@ -207,6 +207,7 @@ public class TestMetaData extends TestBase {
conn
.
close
();
conn
.
close
();
testTempTable
();
testTempTable
();
deleteDb
(
"metaData"
);
}
}
...
...
h2/src/test/org/h2/test/jdbc/TestNativeSQL.java
浏览文件 @
c80aac29
...
@@ -64,6 +64,7 @@ public class TestNativeSQL extends TestBase {
...
@@ -64,6 +64,7 @@ public class TestNativeSQL extends TestBase {
testQuotes
();
testQuotes
();
conn
.
close
();
conn
.
close
();
assertTrue
(
conn
.
isClosed
());
assertTrue
(
conn
.
isClosed
());
deleteDb
(
"nativeSql"
);
}
}
private
void
testQuotes
()
throws
SQLException
{
private
void
testQuotes
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
浏览文件 @
c80aac29
...
@@ -60,6 +60,7 @@ public class TestPreparedStatement extends TestBase {
...
@@ -60,6 +60,7 @@ public class TestPreparedStatement extends TestBase {
testClob
(
conn
);
testClob
(
conn
);
testParameterMetaData
(
conn
);
testParameterMetaData
(
conn
);
conn
.
close
();
conn
.
close
();
deleteDb
(
"preparedStatement"
);
}
}
private
void
testLobTempFiles
(
Connection
conn
)
throws
SQLException
{
private
void
testLobTempFiles
(
Connection
conn
)
throws
SQLException
{
...
...
h2/src/test/org/h2/test/jdbc/TestResultSet.java
浏览文件 @
c80aac29
...
@@ -78,6 +78,7 @@ public class TestResultSet extends TestBase {
...
@@ -78,6 +78,7 @@ public class TestResultSet extends TestBase {
testAutoIncrement
();
testAutoIncrement
();
conn
.
close
();
conn
.
close
();
deleteDb
(
"resultSet"
);
}
}
...
...
h2/src/test/org/h2/test/jdbc/TestStatement.java
浏览文件 @
c80aac29
...
@@ -46,6 +46,7 @@ public class TestStatement extends TestBase {
...
@@ -46,6 +46,7 @@ public class TestStatement extends TestBase {
testIdentity
();
testIdentity
();
}
}
conn
.
close
();
conn
.
close
();
deleteDb
(
"statement"
);
}
}
private
void
testTraceError
()
throws
SQLException
{
private
void
testTraceError
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/jdbc/TestTransactionIsolation.java
浏览文件 @
c80aac29
...
@@ -92,6 +92,7 @@ public class TestTransactionIsolation extends TestBase {
...
@@ -92,6 +92,7 @@ public class TestTransactionIsolation extends TestBase {
conn1
.
close
();
conn1
.
close
();
conn2
.
close
();
conn2
.
close
();
deleteDb
(
"transactionIsolation"
);
}
}
}
}
h2/src/test/org/h2/test/jdbc/TestUpdatableResultSet.java
浏览文件 @
c80aac29
...
@@ -33,6 +33,7 @@ public class TestUpdatableResultSet extends TestBase {
...
@@ -33,6 +33,7 @@ public class TestUpdatableResultSet extends TestBase {
testUpdateDeleteInsert
();
testUpdateDeleteInsert
();
testUpdateDataType
();
testUpdateDataType
();
testUpdateResetRead
();
testUpdateResetRead
();
deleteDb
(
"updatableResultSet"
);
}
}
private
void
testUpdateLob
()
throws
SQLException
{
private
void
testUpdateLob
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/jdbc/TestZloty.java
浏览文件 @
c80aac29
...
@@ -23,6 +23,7 @@ public class TestZloty extends TestBase {
...
@@ -23,6 +23,7 @@ public class TestZloty extends TestBase {
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
testZloty
();
testZloty
();
testModifyBytes
();
testModifyBytes
();
deleteDb
(
"zloty"
);
}
}
/**
/**
...
...
h2/src/test/org/h2/test/jdbcx/TestConnectionPool.java
浏览文件 @
c80aac29
...
@@ -23,6 +23,7 @@ public class TestConnectionPool extends TestBase {
...
@@ -23,6 +23,7 @@ public class TestConnectionPool extends TestBase {
deleteDb
(
"connectionPool"
);
deleteDb
(
"connectionPool"
);
testConnect
();
testConnect
();
testThreads
();
testThreads
();
deleteDb
(
"connectionPool"
);
}
}
private
void
testThreads
()
throws
Exception
{
private
void
testThreads
()
throws
Exception
{
...
...
h2/src/test/org/h2/test/jdbcx/TestDataSource.java
浏览文件 @
c80aac29
...
@@ -51,6 +51,7 @@ public class TestDataSource extends TestBase {
...
@@ -51,6 +51,7 @@ public class TestDataSource extends TestBase {
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
testDataSource
();
testDataSource
();
testXAConnection
();
testXAConnection
();
deleteDb
(
baseDir
,
"dataSource"
);
}
}
private
void
testXAConnection
()
throws
Exception
{
private
void
testXAConnection
()
throws
Exception
{
...
...
h2/src/test/org/h2/test/jdbcx/TestXA.java
浏览文件 @
c80aac29
...
@@ -34,6 +34,9 @@ public class TestXA extends TestBase {
...
@@ -34,6 +34,9 @@ public class TestXA extends TestBase {
deleteDb
(
baseDir
,
DB_NAME1
);
deleteDb
(
baseDir
,
DB_NAME1
);
deleteDb
(
baseDir
,
DB_NAME2
);
deleteDb
(
baseDir
,
DB_NAME2
);
testXA
(
false
);
testXA
(
false
);
deleteDb
(
baseDir
,
"xa"
);
deleteDb
(
baseDir
,
DB_NAME1
);
deleteDb
(
baseDir
,
DB_NAME2
);
}
}
/**
/**
...
...
h2/src/test/org/h2/test/mvcc/TestMvcc1.java
浏览文件 @
c80aac29
...
@@ -26,6 +26,7 @@ public class TestMvcc1 extends TestBase {
...
@@ -26,6 +26,7 @@ public class TestMvcc1 extends TestBase {
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
testSetMode
();
testSetMode
();
testCases
();
testCases
();
deleteDb
(
"mvcc1"
);
}
}
private
void
testSetMode
()
throws
SQLException
{
private
void
testSetMode
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/mvcc/TestMvcc2.java
浏览文件 @
c80aac29
...
@@ -29,6 +29,7 @@ public class TestMvcc2 extends TestBase {
...
@@ -29,6 +29,7 @@ public class TestMvcc2 extends TestBase {
deleteDb
(
"mvcc2"
);
deleteDb
(
"mvcc2"
);
testInsertUpdateRollback
();
testInsertUpdateRollback
();
testInsertRollback
();
testInsertRollback
();
deleteDb
(
"mvcc2"
);
}
}
private
Connection
getConnection
()
throws
SQLException
{
private
Connection
getConnection
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/mvcc/TestMvcc3.java
浏览文件 @
c80aac29
...
@@ -23,6 +23,7 @@ public class TestMvcc3 extends TestBase {
...
@@ -23,6 +23,7 @@ public class TestMvcc3 extends TestBase {
testSequence
();
testSequence
();
testDisableAutoCommit
();
testDisableAutoCommit
();
testRollback
();
testRollback
();
deleteDb
(
"mvcc3"
);
}
}
private
void
testCreateTableAsSelect
()
throws
SQLException
{
private
void
testCreateTableAsSelect
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded.java
浏览文件 @
c80aac29
...
@@ -64,6 +64,7 @@ public class TestMvccMultiThreaded extends TestBase {
...
@@ -64,6 +64,7 @@ public class TestMvccMultiThreaded extends TestBase {
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
connList
[
i
].
close
();
connList
[
i
].
close
();
}
}
deleteDb
(
"mvccMultiThreaded"
);
}
}
}
}
h2/src/test/org/h2/test/rowlock/TestRowLocks.java
浏览文件 @
c80aac29
...
@@ -37,6 +37,7 @@ public class TestRowLocks extends TestBase {
...
@@ -37,6 +37,7 @@ public class TestRowLocks extends TestBase {
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
testSetMode
();
testSetMode
();
testCases
();
testCases
();
deleteDb
(
"rowLocks"
);
}
}
private
void
testSetMode
()
throws
SQLException
{
private
void
testSetMode
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/server/TestAutoReconnect.java
浏览文件 @
c80aac29
...
@@ -56,6 +56,7 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener
...
@@ -56,6 +56,7 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
testReconnect
(
true
);
testReconnect
(
true
);
testReconnect
(
false
);
testReconnect
(
false
);
deleteDb
(
"autoReconnect"
);
}
}
private
void
testReconnect
(
boolean
autoServer
)
throws
Exception
{
private
void
testReconnect
(
boolean
autoServer
)
throws
Exception
{
...
...
h2/src/test/org/h2/test/server/TestAutoServer.java
浏览文件 @
c80aac29
...
@@ -71,6 +71,7 @@ public class TestAutoServer extends TestBase {
...
@@ -71,6 +71,7 @@ public class TestAutoServer extends TestBase {
}
}
conn
.
close
();
conn
.
close
();
connServer
.
close
();
connServer
.
close
();
deleteDb
(
"autoServer"
);
}
}
/**
/**
...
...
h2/src/test/org/h2/test/server/TestNestedLoop.java
浏览文件 @
c80aac29
...
@@ -61,7 +61,7 @@ public class TestNestedLoop extends TestBase {
...
@@ -61,7 +61,7 @@ public class TestNestedLoop extends TestBase {
}
}
}
}
conn
.
close
();
conn
.
close
();
deleteDb
(
"nestedLoop"
);
}
}
}
}
h2/src/test/org/h2/test/server/TestPgServer.java
浏览文件 @
c80aac29
...
@@ -44,6 +44,7 @@ public class TestPgServer extends TestBase {
...
@@ -44,6 +44,7 @@ public class TestPgServer extends TestBase {
}
finally
{
}
finally
{
server
.
stop
();
server
.
stop
();
}
}
deleteDb
(
"test"
);
}
}
private
void
testPgClient
()
throws
SQLException
{
private
void
testPgClient
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/synth/TestFuzzOptimizations.java
浏览文件 @
c80aac29
...
@@ -39,6 +39,7 @@ public class TestFuzzOptimizations extends TestBase {
...
@@ -39,6 +39,7 @@ public class TestFuzzOptimizations extends TestBase {
testGroupSorted
();
testGroupSorted
();
testInSelect
();
testInSelect
();
conn
.
close
();
conn
.
close
();
deleteDb
(
"optimizations"
);
}
}
private
void
testInSelect
()
throws
SQLException
{
private
void
testInSelect
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/synth/TestKillRestart.java
浏览文件 @
c80aac29
...
@@ -64,6 +64,7 @@ public class TestKillRestart extends TestBase {
...
@@ -64,6 +64,7 @@ public class TestKillRestart extends TestBase {
}
}
}
}
}
}
deleteDb
(
"killRestart"
);
}
}
/**
/**
...
...
h2/src/test/org/h2/test/synth/TestKillRestartMulti.java
浏览文件 @
c80aac29
...
@@ -35,7 +35,7 @@ public class TestKillRestartMulti extends TestBase {
...
@@ -35,7 +35,7 @@ public class TestKillRestartMulti extends TestBase {
private
ArrayList
connections
=
new
ArrayList
();
private
ArrayList
connections
=
new
ArrayList
();
private
ArrayList
tables
=
new
ArrayList
();
private
ArrayList
tables
=
new
ArrayList
();
private
int
openCount
;
private
int
openCount
;
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
if
(
config
.
networked
)
{
if
(
config
.
networked
)
{
return
;
return
;
...
@@ -114,6 +114,7 @@ public class TestKillRestartMulti extends TestBase {
...
@@ -114,6 +114,7 @@ public class TestKillRestartMulti extends TestBase {
throw
e
;
throw
e
;
}
}
}
}
deleteDb
(
"killRestartMulti"
);
}
}
/**
/**
...
...
h2/src/test/org/h2/test/synth/TestMultiThreaded.java
浏览文件 @
c80aac29
...
@@ -169,6 +169,7 @@ public class TestMultiThreaded extends TestBase {
...
@@ -169,6 +169,7 @@ public class TestMultiThreaded extends TestBase {
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
connList
[
i
].
close
();
connList
[
i
].
close
();
}
}
deleteDb
(
"multiThreaded"
);
}
}
}
}
h2/src/test/org/h2/test/synth/TestRandomSQL.java
浏览文件 @
c80aac29
...
@@ -176,6 +176,11 @@ public class TestRandomSQL extends TestBase {
...
@@ -176,6 +176,11 @@ public class TestRandomSQL extends TestBase {
}
}
testWithSeed
(
bnf
);
testWithSeed
(
bnf
);
SysProperties
.
scriptDirectory
=
old
;
SysProperties
.
scriptDirectory
=
old
;
try
{
deleteDb
();
}
catch
(
SQLException
e
)
{
processException
(
"deleteDb"
,
e
);
}
}
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/unit/TestCache.java
浏览文件 @
c80aac29
...
@@ -53,6 +53,7 @@ public class TestCache extends TestBase {
...
@@ -53,6 +53,7 @@ public class TestCache extends TestBase {
}
}
}
}
conn
.
close
();
conn
.
close
();
deleteDb
(
"cache"
);
}
}
}
}
h2/src/test/org/h2/test/unit/TestDate.java
浏览文件 @
c80aac29
...
@@ -72,6 +72,8 @@ public class TestDate extends TestBase {
...
@@ -72,6 +72,8 @@ public class TestDate extends TestBase {
TimeZone
.
setDefault
(
defaultTimeZone
);
TimeZone
.
setDefault
(
defaultTimeZone
);
DateTimeUtils
.
resetCalendar
();
DateTimeUtils
.
resetCalendar
();
}
}
conn
.
close
();
deleteDb
(
"date"
);
}
}
private
void
test
(
PreparedStatement
prep
,
int
d
)
throws
SQLException
{
private
void
test
(
PreparedStatement
prep
,
int
d
)
throws
SQLException
{
...
...
h2/src/test/org/h2/test/unit/TestExit.java
浏览文件 @
c80aac29
...
@@ -63,6 +63,7 @@ public class TestExit extends TestBase implements DatabaseEventListener {
...
@@ -63,6 +63,7 @@ public class TestExit extends TestBase implements DatabaseEventListener {
if
(
getClosedFile
().
exists
())
{
if
(
getClosedFile
().
exists
())
{
fail
(
"closed database"
);
fail
(
"closed database"
);
}
}
deleteDb
(
"exit"
);
}
}
/**
/**
...
...
h2/src/test/org/h2/test/unit/TestMultiThreadedKernel.java
浏览文件 @
c80aac29
...
@@ -47,6 +47,7 @@ public class TestMultiThreadedKernel extends TestBase implements Runnable {
...
@@ -47,6 +47,7 @@ public class TestMultiThreadedKernel extends TestBase implements Runnable {
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
list
[
i
].
join
();
list
[
i
].
join
();
}
}
deleteDb
(
"multiThreadedKernel"
);
}
}
public
void
run
()
{
public
void
run
()
{
...
...
h2/src/test/org/h2/test/unit/TestRecovery.java
浏览文件 @
c80aac29
...
@@ -39,6 +39,7 @@ public class TestRecovery extends TestBase {
...
@@ -39,6 +39,7 @@ public class TestRecovery extends TestBase {
// Recover.execute("data", null);
// Recover.execute("data", null);
Connection
conn
=
DriverManager
.
getConnection
(
url
,
"sa"
,
"sa"
);
Connection
conn
=
DriverManager
.
getConnection
(
url
,
"sa"
,
"sa"
);
conn
.
close
();
conn
.
close
();
DeleteDbFiles
.
execute
(
baseDir
,
"recovery"
,
true
);
}
}
}
}
h2/src/test/org/h2/test/unit/TestSampleApps.java
浏览文件 @
c80aac29
...
@@ -25,6 +25,7 @@ public class TestSampleApps extends TestBase {
...
@@ -25,6 +25,7 @@ public class TestSampleApps extends TestBase {
String
url
=
"jdbc:h2:"
+
baseDir
+
"/optimizations"
;
String
url
=
"jdbc:h2:"
+
baseDir
+
"/optimizations"
;
testApp
(
org
.
h2
.
tools
.
RunScript
.
class
,
new
String
[]
{
"-url"
,
url
,
"-user"
,
"sa"
,
"-password"
,
"sa"
,
"-script"
,
testApp
(
org
.
h2
.
tools
.
RunScript
.
class
,
new
String
[]
{
"-url"
,
url
,
"-user"
,
"sa"
,
"-password"
,
"sa"
,
"-script"
,
"src/test/org/h2/samples/optimizations.sql"
,
"-checkResults"
},
""
);
"src/test/org/h2/samples/optimizations.sql"
,
"-checkResults"
},
""
);
deleteDb
(
"optimizations"
);
testApp
(
org
.
h2
.
samples
.
Compact
.
class
,
null
,
"Compacting...\nDone."
);
testApp
(
org
.
h2
.
samples
.
Compact
.
class
,
null
,
"Compacting...\nDone."
);
testApp
(
org
.
h2
.
samples
.
CsvSample
.
class
,
null
,
"NAME: Bob Meier\n"
+
"EMAIL: bob.meier@abcde.abc\n"
testApp
(
org
.
h2
.
samples
.
CsvSample
.
class
,
null
,
"NAME: Bob Meier\n"
+
"EMAIL: bob.meier@abcde.abc\n"
...
...
h2/src/test/org/h2/test/unit/TestTools.java
浏览文件 @
c80aac29
...
@@ -67,6 +67,7 @@ public class TestTools extends TestBase {
...
@@ -67,6 +67,7 @@ public class TestTools extends TestBase {
testScriptRunscript
();
testScriptRunscript
();
testBackupRestore
();
testBackupRestore
();
testRecover
();
testRecover
();
deleteDb
(
"utils"
);
}
}
private
void
testServerMain
()
throws
SQLException
{
private
void
testServerMain
()
throws
SQLException
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论