Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
29dc32d9
提交
29dc32d9
authored
3月 13, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
All tests should now have a main method.
上级
d1516da3
隐藏空白字符变更
内嵌
并排
正在显示
56 个修改的文件
包含
545 行增加
和
11 行删除
+545
-11
TestFunctions.java
h2/src/test/org/h2/test/db/TestFunctions.java
+42
-0
TestIndex.java
h2/src/test/org/h2/test/db/TestIndex.java
+9
-0
TestListener.java
h2/src/test/org/h2/test/db/TestListener.java
+9
-0
TestMultiDimension.java
h2/src/test/org/h2/test/db/TestMultiDimension.java
+16
-5
TestMultiThread.java
h2/src/test/org/h2/test/db/TestMultiThread.java
+9
-0
TestReadOnly.java
h2/src/test/org/h2/test/db/TestReadOnly.java
+9
-0
TestRunscript.java
h2/src/test/org/h2/test/db/TestRunscript.java
+9
-0
TestSQLInjection.java
h2/src/test/org/h2/test/db/TestSQLInjection.java
+9
-0
TestSequence.java
h2/src/test/org/h2/test/db/TestSequence.java
+9
-0
TestSessionsLocks.java
h2/src/test/org/h2/test/db/TestSessionsLocks.java
+9
-0
TestSpaceReuse.java
h2/src/test/org/h2/test/db/TestSpaceReuse.java
+9
-0
TestSpeed.java
h2/src/test/org/h2/test/db/TestSpeed.java
+8
-5
TestTransaction.java
h2/src/test/org/h2/test/db/TestTransaction.java
+9
-0
TestTriggersConstraints.java
h2/src/test/org/h2/test/db/TestTriggersConstraints.java
+9
-1
TestTwoPhaseCommit.java
h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java
+10
-0
TestBatchUpdates.java
h2/src/test/org/h2/test/jdbc/TestBatchUpdates.java
+9
-0
TestCallableStatement.java
h2/src/test/org/h2/test/jdbc/TestCallableStatement.java
+9
-0
TestDatabaseEventListener.java
h2/src/test/org/h2/test/jdbc/TestDatabaseEventListener.java
+9
-0
TestNativeSQL.java
h2/src/test/org/h2/test/jdbc/TestNativeSQL.java
+9
-0
TestPreparedStatement.java
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
+9
-0
TestTransactionIsolation.java
h2/src/test/org/h2/test/jdbc/TestTransactionIsolation.java
+9
-0
TestUpdatableResultSet.java
h2/src/test/org/h2/test/jdbc/TestUpdatableResultSet.java
+9
-0
TestZloty.java
h2/src/test/org/h2/test/jdbc/TestZloty.java
+9
-0
TestConnectionPool.java
h2/src/test/org/h2/test/jdbcx/TestConnectionPool.java
+9
-0
TestXA.java
h2/src/test/org/h2/test/jdbcx/TestXA.java
+10
-0
TestXASimple.java
h2/src/test/org/h2/test/jdbcx/TestXASimple.java
+9
-0
TestMvcc1.java
h2/src/test/org/h2/test/mvcc/TestMvcc1.java
+9
-0
TestMvcc2.java
h2/src/test/org/h2/test/mvcc/TestMvcc2.java
+9
-0
TestMvcc3.java
h2/src/test/org/h2/test/mvcc/TestMvcc3.java
+9
-0
TestMvccMultiThreaded.java
h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded.java
+9
-0
TestNestedLoop.java
h2/src/test/org/h2/test/server/TestNestedLoop.java
+9
-0
TestBtreeIndex.java
h2/src/test/org/h2/test/synth/TestBtreeIndex.java
+9
-0
TestCrashAPI.java
h2/src/test/org/h2/test/synth/TestCrashAPI.java
+9
-0
TestJoin.java
h2/src/test/org/h2/test/synth/TestJoin.java
+9
-0
TestKill.java
h2/src/test/org/h2/test/synth/TestKill.java
+9
-0
TestRandomSQL.java
h2/src/test/org/h2/test/synth/TestRandomSQL.java
+9
-0
TestSimpleIndex.java
h2/src/test/org/h2/test/synth/TestSimpleIndex.java
+9
-0
TestThreads.java
h2/src/test/org/h2/test/synth/TestThreads.java
+9
-0
TestTimer.java
h2/src/test/org/h2/test/synth/TestTimer.java
+9
-0
TestSynth.java
h2/src/test/org/h2/test/synth/sql/TestSynth.java
+9
-0
TestMulti.java
h2/src/test/org/h2/test/synth/thread/TestMulti.java
+9
-0
TestCompress.java
h2/src/test/org/h2/test/unit/TestCompress.java
+9
-0
TestDataPage.java
h2/src/test/org/h2/test/unit/TestDataPage.java
+9
-0
TestFile.java
h2/src/test/org/h2/test/unit/TestFile.java
+9
-0
TestFtp.java
h2/src/test/org/h2/test/unit/TestFtp.java
+9
-0
TestIntIntHashMap.java
h2/src/test/org/h2/test/unit/TestIntIntHashMap.java
+9
-0
TestMultiThreadedKernel.java
h2/src/test/org/h2/test/unit/TestMultiThreadedKernel.java
+9
-0
TestScriptReader.java
h2/src/test/org/h2/test/unit/TestScriptReader.java
+9
-0
TestSecurity.java
h2/src/test/org/h2/test/unit/TestSecurity.java
+9
-0
TestServlet.java
h2/src/test/org/h2/test/unit/TestServlet.java
+9
-0
TestShell.java
h2/src/test/org/h2/test/unit/TestShell.java
+9
-0
TestStreams.java
h2/src/test/org/h2/test/unit/TestStreams.java
+9
-0
TestStringUtils.java
h2/src/test/org/h2/test/unit/TestStringUtils.java
+9
-0
TestValue.java
h2/src/test/org/h2/test/unit/TestValue.java
+9
-0
TestValueHashMap.java
h2/src/test/org/h2/test/unit/TestValueHashMap.java
+9
-0
TestValueMemory.java
h2/src/test/org/h2/test/unit/TestValueMemory.java
+9
-0
没有找到文件。
h2/src/test/org/h2/test/db/TestFunctions.java
浏览文件 @
29dc32d9
...
...
@@ -33,6 +33,8 @@ import org.h2.util.IOUtils;
*/
public
class
TestFunctions
extends
TestBase
implements
AggregateFunction
{
static
int
count
;
/**
* Run just this test.
*
...
...
@@ -44,6 +46,7 @@ public class TestFunctions extends TestBase implements AggregateFunction {
public
void
test
()
throws
Exception
{
deleteDb
(
"functions"
);
testDeterministic
();
testTransactionId
();
testPrecision
();
testVarArgs
();
...
...
@@ -53,6 +56,32 @@ public class TestFunctions extends TestBase implements AggregateFunction {
deleteDb
(
"functions"
);
}
private
void
testDeterministic
()
throws
SQLException
{
Connection
conn
=
getConnection
(
"functions"
);
Statement
stat
=
conn
.
createStatement
();
ResultSet
rs
;
stat
.
execute
(
"create alias getCount for \""
+
getClass
().
getName
()+
".getCount\""
);
setCount
(
0
);
rs
=
stat
.
executeQuery
(
"select getCount() from system_range(1, 2)"
);
rs
.
next
();
assertEquals
(
0
,
rs
.
getInt
(
1
));
rs
.
next
();
assertEquals
(
1
,
rs
.
getInt
(
1
));
stat
.
execute
(
"drop alias getCount"
);
stat
.
execute
(
"create alias getCount deterministic for \""
+
getClass
().
getName
()+
".getCount\""
);
setCount
(
0
);
rs
=
stat
.
executeQuery
(
"select getCount() from system_range(1, 2)"
);
rs
.
next
();
assertEquals
(
0
,
rs
.
getInt
(
1
));
rs
.
next
();
assertEquals
(
0
,
rs
.
getInt
(
1
));
stat
.
execute
(
"drop alias getCount"
);
conn
.
close
();
}
private
void
testTransactionId
()
throws
SQLException
{
if
(
config
.
memory
)
{
return
;
...
...
@@ -516,6 +545,19 @@ public class TestFunctions extends TestBase implements AggregateFunction {
return
dec
;
}
/**
* This method is called via reflection from the database.
*
* @return the count
*/
public
static
int
getCount
()
{
return
count
++;
}
private
static
void
setCount
(
int
newCount
)
{
count
=
newCount
;
}
/**
* This method is called via reflection from the database.
*
...
...
h2/src/test/org/h2/test/db/TestIndex.java
浏览文件 @
29dc32d9
...
...
@@ -25,6 +25,15 @@ public class TestIndex extends TestBase {
private
Statement
stat
;
private
Random
random
=
new
Random
();
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
testDescIndex
();
testHashIndex
();
...
...
h2/src/test/org/h2/test/db/TestListener.java
浏览文件 @
29dc32d9
...
...
@@ -29,6 +29,15 @@ public class TestListener extends TestBase implements DatabaseEventListener {
start
=
last
=
System
.
currentTimeMillis
();
}
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
if
(
config
.
networked
||
config
.
cipher
!=
null
)
{
return
;
...
...
h2/src/test/org/h2/test/db/TestMultiDimension.java
浏览文件 @
29dc32d9
...
...
@@ -21,6 +21,15 @@ import org.h2.tools.MultiDimension;
*/
public
class
TestMultiDimension
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
{
Random
rand
=
new
Random
(
10
);
for
(
int
i
=
0
;
i
<
1000
;
i
++)
{
...
...
@@ -37,11 +46,12 @@ public class TestMultiDimension extends TestBase {
conn
=
getConnection
(
"multiDimension"
);
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"CREATE ALIAS MAP FOR \""
+
getClass
().
getName
()
+
".interleave\""
);
stat
.
execute
(
"CREATE TABLE TEST(X INT NOT NULL, Y INT NOT NULL, Z INT NOT NULL,
XYZ BIGINT AS MAP(X, Y, Z), DATA VARCHAR)"
);
stat
.
execute
(
"CREATE TABLE TEST(X INT NOT NULL, Y INT NOT NULL, Z INT NOT NULL, "
+
"
XYZ BIGINT AS MAP(X, Y, Z), DATA VARCHAR)"
);
stat
.
execute
(
"CREATE INDEX IDX_X ON TEST(X, Y, Z)"
);
stat
.
execute
(
"CREATE INDEX IDX_XYZ ON TEST(XYZ)"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"INSERT INTO TEST(X, Y, Z, DATA) VALUES(?, ?, ?, ?)"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"INSERT INTO TEST(X, Y, Z, DATA) VALUES(?, ?, ?, ?)"
);
// a reasonable max value to see the performance difference is 60; the
// higher the bigger the difference
int
max
=
getSize
(
10
,
20
);
...
...
@@ -69,8 +79,9 @@ public class TestMultiDimension extends TestBase {
}
}
stat
.
execute
(
"ANALYZE SAMPLE_SIZE 10000"
);
PreparedStatement
prepRegular
=
conn
.
prepareStatement
(
"SELECT * FROM TEST WHERE X BETWEEN ? AND ? "
+
"AND Y BETWEEN ? AND ? AND Z BETWEEN ? AND ? ORDER BY X, Y, Z"
);
PreparedStatement
prepRegular
=
conn
.
prepareStatement
(
"SELECT * FROM TEST WHERE X BETWEEN ? AND ? "
+
"AND Y BETWEEN ? AND ? AND Z BETWEEN ? AND ? ORDER BY X, Y, Z"
);
MultiDimension
multi
=
MultiDimension
.
getInstance
();
String
sql
=
multi
.
generatePreparedQuery
(
"TEST"
,
"XYZ"
,
new
String
[]
{
"X"
,
"Y"
,
"Z"
});
sql
+=
" ORDER BY X, Y, Z"
;
...
...
h2/src/test/org/h2/test/db/TestMultiThread.java
浏览文件 @
29dc32d9
...
...
@@ -39,6 +39,15 @@ public class TestMultiThread extends TestBase implements Runnable {
stat
=
conn
.
createStatement
();
}
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
Connection
conn
=
getConnection
();
...
...
h2/src/test/org/h2/test/db/TestReadOnly.java
浏览文件 @
29dc32d9
...
...
@@ -23,6 +23,15 @@ import org.h2.test.TestBase;
*/
public
class
TestReadOnly
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
{
if
(
config
.
memory
)
{
return
;
...
...
h2/src/test/org/h2/test/db/TestRunscript.java
浏览文件 @
29dc32d9
...
...
@@ -19,6 +19,15 @@ import org.h2.util.FileUtils;
*/
public
class
TestRunscript
extends
TestBase
implements
Trigger
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
test
(
false
);
test
(
true
);
...
...
h2/src/test/org/h2/test/db/TestSQLInjection.java
浏览文件 @
29dc32d9
...
...
@@ -22,6 +22,15 @@ public class TestSQLInjection extends TestBase {
private
Connection
conn
;
private
Statement
stat
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
deleteDb
(
"sqlInjection"
);
reconnect
(
"sqlInjection"
);
...
...
h2/src/test/org/h2/test/db/TestSequence.java
浏览文件 @
29dc32d9
...
...
@@ -18,6 +18,15 @@ import org.h2.test.TestBase;
*/
public
class
TestSequence
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
{
testAlterSequenceColumn
();
testAlterSequence
();
...
...
h2/src/test/org/h2/test/db/TestSessionsLocks.java
浏览文件 @
29dc32d9
...
...
@@ -18,6 +18,15 @@ import org.h2.test.TestBase;
*/
public
class
TestSessionsLocks
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
{
if
(
config
.
mvcc
)
{
return
;
...
...
h2/src/test/org/h2/test/db/TestSpaceReuse.java
浏览文件 @
29dc32d9
...
...
@@ -18,6 +18,15 @@ import org.h2.test.TestBase;
*/
public
class
TestSpaceReuse
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
{
if
(
config
.
memory
)
{
return
;
...
...
h2/src/test/org/h2/test/db/TestSpeed.java
浏览文件 @
29dc32d9
...
...
@@ -18,11 +18,14 @@ import org.h2.test.TestBase;
*/
public
class
TestSpeed
extends
TestBase
{
// java -cp .;..\..\hsqldb\lib\hsqldb.jar -Xrunhprof:heap=sites,depth=6
// org.h2.test.TestAll
// java -Xrunhprof:heap=sites org.h2.test.TestAll
// TODO test: here is more code, currently untested!
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestTransaction.java
浏览文件 @
29dc32d9
...
...
@@ -23,6 +23,15 @@ import org.h2.test.TestBase;
*/
public
class
TestTransaction
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
{
testSetTransaction
();
testReferential
();
...
...
h2/src/test/org/h2/test/db/TestTriggersConstraints.java
浏览文件 @
29dc32d9
...
...
@@ -22,9 +22,17 @@ import org.h2.test.TestBase;
public
class
TestTriggersConstraints
extends
TestBase
implements
Trigger
{
private
static
boolean
mustNotCallTrigger
;
private
String
triggerName
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
deleteDb
(
"trigger"
);
testTriggerAlterTable
();
...
...
h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java
浏览文件 @
29dc32d9
...
...
@@ -18,6 +18,16 @@ import org.h2.test.TestBase;
* Tests for the two-phase-commit feature.
*/
public
class
TestTwoPhaseCommit
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
{
if
(
config
.
memory
||
config
.
networked
||
config
.
logMode
==
0
)
{
return
;
...
...
h2/src/test/org/h2/test/jdbc/TestBatchUpdates.java
浏览文件 @
29dc32d9
...
...
@@ -43,6 +43,15 @@ public class TestBatchUpdates extends TestBase {
private
Statement
stat
;
private
PreparedStatement
prep
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
testExecuteCall
();
testException
();
...
...
h2/src/test/org/h2/test/jdbc/TestCallableStatement.java
浏览文件 @
29dc32d9
...
...
@@ -19,6 +19,15 @@ import org.h2.test.TestBase;
*/
public
class
TestCallableStatement
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
{
deleteDb
(
"callableStatement"
);
Connection
conn
=
getConnection
(
"preparedStatement"
);
...
...
h2/src/test/org/h2/test/jdbc/TestDatabaseEventListener.java
浏览文件 @
29dc32d9
...
...
@@ -22,6 +22,15 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent
private
boolean
calledOpened
,
calledClosingDatabase
,
calledScan
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
testCalled
();
testCloseLog0
(
false
);
...
...
h2/src/test/org/h2/test/jdbc/TestNativeSQL.java
浏览文件 @
29dc32d9
...
...
@@ -55,6 +55,15 @@ public class TestNativeSQL extends TestBase {
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
SQLException
{
deleteDb
(
"nativeSql"
);
conn
=
getConnection
(
"nativeSql"
);
...
...
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
浏览文件 @
29dc32d9
...
...
@@ -29,6 +29,15 @@ public class TestPreparedStatement extends TestBase {
private
static
final
int
LOB_SIZE
=
4000
,
LOB_SIZE_BIG
=
512
*
1024
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
deleteDb
(
"preparedStatement"
);
...
...
h2/src/test/org/h2/test/jdbc/TestTransactionIsolation.java
浏览文件 @
29dc32d9
...
...
@@ -18,6 +18,15 @@ public class TestTransactionIsolation extends TestBase {
private
Connection
conn1
,
conn2
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
if
(
config
.
mvcc
)
{
// no tests yet
...
...
h2/src/test/org/h2/test/jdbc/TestUpdatableResultSet.java
浏览文件 @
29dc32d9
...
...
@@ -27,6 +27,15 @@ import org.h2.test.TestBase;
*/
public
class
TestUpdatableResultSet
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
{
testUpdateLob
();
testScroll
();
...
...
h2/src/test/org/h2/test/jdbc/TestZloty.java
浏览文件 @
29dc32d9
...
...
@@ -20,6 +20,15 @@ import org.h2.test.TestBase;
*/
public
class
TestZloty
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
{
testZloty
();
testModifyBytes
();
...
...
h2/src/test/org/h2/test/jdbcx/TestConnectionPool.java
浏览文件 @
29dc32d9
...
...
@@ -19,6 +19,15 @@ import org.h2.test.TestBase;
*/
public
class
TestConnectionPool
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
{
deleteDb
(
"connectionPool"
);
testConnect
();
...
...
h2/src/test/org/h2/test/jdbcx/TestXA.java
浏览文件 @
29dc32d9
...
...
@@ -22,11 +22,21 @@ import org.h2.util.JdbcUtils;
* Basic XA tests.
*/
public
class
TestXA
extends
TestBase
{
private
static
final
String
DB_NAME1
=
"xadb1"
;
private
static
final
String
DB_NAME2
=
"xadb2"
;
private
static
final
String
DB_URL1
=
"jdbc:h2:file:"
+
baseDir
+
"/"
+
DB_NAME1
;
private
static
final
String
DB_URL2
=
"jdbc:h2:file:"
+
baseDir
+
"/"
+
DB_NAME2
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
testXAAutoCommit
();
deleteDb
(
baseDir
,
"xa"
);
...
...
h2/src/test/org/h2/test/jdbcx/TestXASimple.java
浏览文件 @
29dc32d9
...
...
@@ -19,6 +19,15 @@ import org.h2.test.TestBase;
*/
public
class
TestXASimple
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
{
deleteDb
(
"xaSimple1"
);
...
...
h2/src/test/org/h2/test/mvcc/TestMvcc1.java
浏览文件 @
29dc32d9
...
...
@@ -23,6 +23,15 @@ public class TestMvcc1 extends TestBase {
private
Connection
c1
,
c2
;
private
Statement
s1
,
s2
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
testSetMode
();
testCases
();
...
...
h2/src/test/org/h2/test/mvcc/TestMvcc2.java
浏览文件 @
29dc32d9
...
...
@@ -22,6 +22,15 @@ public class TestMvcc2 extends TestBase {
private
static
final
String
INSERT
=
"INSERT INTO EMPLOYEE (id, version, NAME) VALUES (1, 1, 'Jones')"
;
private
static
final
String
UPDATE
=
"UPDATE EMPLOYEE SET NAME = 'Miller' WHERE version = 1"
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
if
(!
config
.
mvcc
)
{
return
;
...
...
h2/src/test/org/h2/test/mvcc/TestMvcc3.java
浏览文件 @
29dc32d9
...
...
@@ -18,6 +18,15 @@ import org.h2.test.TestBase;
*/
public
class
TestMvcc3
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
{
testCreateTableAsSelect
();
testSequence
();
...
...
h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded.java
浏览文件 @
29dc32d9
...
...
@@ -17,6 +17,15 @@ import org.h2.test.TestBase;
*/
public
class
TestMvccMultiThreaded
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
{
if
(!
config
.
mvcc
)
{
return
;
...
...
h2/src/test/org/h2/test/server/TestNestedLoop.java
浏览文件 @
29dc32d9
...
...
@@ -19,6 +19,15 @@ import org.h2.test.TestBase;
*/
public
class
TestNestedLoop
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
{
deleteDb
(
"nestedLoop"
);
Connection
conn
=
getConnection
(
"nestedLoop"
);
...
...
h2/src/test/org/h2/test/synth/TestBtreeIndex.java
浏览文件 @
29dc32d9
...
...
@@ -22,6 +22,15 @@ import org.h2.tools.DeleteDbFiles;
*/
public
class
TestBtreeIndex
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
{
Random
random
=
new
Random
();
while
(
true
)
{
...
...
h2/src/test/org/h2/test/synth/TestCrashAPI.java
浏览文件 @
29dc32d9
...
...
@@ -57,6 +57,15 @@ public class TestCrashAPI extends TestBase {
private
int
openCount
;
private
long
callCount
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
private
void
deleteDb
()
{
try
{
deleteDb
(
baseDir
+
"/"
+
DIR
,
null
);
...
...
h2/src/test/org/h2/test/synth/TestJoin.java
浏览文件 @
29dc32d9
...
...
@@ -31,6 +31,15 @@ public class TestJoin extends TestBase {
private
int
paramCount
;
private
StringBuffer
buff
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
String
old
=
baseDir
;
baseDir
=
TestBase
.
getTestDir
(
"join"
);
...
...
h2/src/test/org/h2/test/synth/TestKill.java
浏览文件 @
29dc32d9
...
...
@@ -30,6 +30,15 @@ public class TestKill extends TestBase {
private
int
accounts
=
10
;
private
Random
random
=
new
Random
(
1
);
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
String
connect
=
""
;
...
...
h2/src/test/org/h2/test/synth/TestRandomSQL.java
浏览文件 @
29dc32d9
...
...
@@ -33,6 +33,15 @@ public class TestRandomSQL extends TestBase {
private
Bnf
bnf
;
private
int
success
,
total
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
private
void
processException
(
String
sql
,
SQLException
e
)
{
if
(
e
.
getSQLState
().
equals
(
"HY000"
))
{
TestBase
.
logError
(
"new TestRandomSQL().init(test).testCase("
+
seed
+
"); // FAIL: "
+
e
.
toString
()
+
" sql: "
+
sql
,
e
);
...
...
h2/src/test/org/h2/test/synth/TestSimpleIndex.java
浏览文件 @
29dc32d9
...
...
@@ -24,6 +24,15 @@ public class TestSimpleIndex extends TestBase {
private
Statement
stat
;
private
RandomGen
random
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
deleteDb
(
"simpleIndex"
);
conn
=
getConnection
(
"simpleIndex"
);
...
...
h2/src/test/org/h2/test/synth/TestThreads.java
浏览文件 @
29dc32d9
...
...
@@ -43,6 +43,15 @@ public class TestThreads extends TestBase implements Runnable {
this
.
table
=
table
;
}
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
deleteDb
(
"threads"
);
Connection
conn
=
getConnection
(
"threads;MAX_LOG_SIZE=1"
);
...
...
h2/src/test/org/h2/test/synth/TestTimer.java
浏览文件 @
29dc32d9
...
...
@@ -24,6 +24,15 @@ import org.h2.tools.DeleteDbFiles;
*/
public
class
TestTimer
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
{
validateOld
();
DeleteDbFiles
.
execute
(
baseDir
,
"timer"
,
true
);
...
...
h2/src/test/org/h2/test/synth/sql/TestSynth.java
浏览文件 @
29dc32d9
...
...
@@ -55,6 +55,15 @@ public class TestSynth extends TestBase {
private
boolean
stopImmediately
;
private
int
mode
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
/**
* Check whether this database is of the specified type.
*
...
...
h2/src/test/org/h2/test/synth/thread/TestMulti.java
浏览文件 @
29dc32d9
...
...
@@ -22,6 +22,15 @@ public class TestMulti extends TestBase {
*/
public
volatile
boolean
stop
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
org
.
h2
.
Driver
.
load
();
deleteDb
(
baseDir
,
"openClose"
);
...
...
h2/src/test/org/h2/test/unit/TestCompress.java
浏览文件 @
29dc32d9
...
...
@@ -17,6 +17,15 @@ import org.h2.tools.CompressTool;
*/
public
class
TestCompress
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
{
if
(
config
.
big
)
{
for
(
int
i
=
0
;
i
<
100
;
i
++)
{
...
...
h2/src/test/org/h2/test/unit/TestDataPage.java
浏览文件 @
29dc32d9
...
...
@@ -28,6 +28,15 @@ import org.h2.value.ValueString;
*/
public
class
TestDataPage
extends
TestBase
implements
DataHandler
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
testAll
();
}
...
...
h2/src/test/org/h2/test/unit/TestFile.java
浏览文件 @
29dc32d9
...
...
@@ -23,6 +23,15 @@ import org.h2.value.Value;
*/
public
class
TestFile
extends
TestBase
implements
DataHandler
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
doTest
(
false
);
doTest
(
true
);
...
...
h2/src/test/org/h2/test/unit/TestFtp.java
浏览文件 @
29dc32d9
...
...
@@ -19,6 +19,15 @@ public class TestFtp extends TestBase implements FtpEventListener {
private
FtpEvent
lastEvent
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
test
(
baseDir
);
}
...
...
h2/src/test/org/h2/test/unit/TestIntIntHashMap.java
浏览文件 @
29dc32d9
...
...
@@ -18,6 +18,15 @@ public class TestIntIntHashMap extends TestBase {
private
Random
rand
=
new
Random
();
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
{
rand
.
setSeed
(
10
);
test
(
true
);
...
...
h2/src/test/org/h2/test/unit/TestMultiThreadedKernel.java
浏览文件 @
29dc32d9
...
...
@@ -23,6 +23,15 @@ public class TestMultiThreadedKernel extends TestBase implements Runnable {
private
TestMultiThreadedKernel
master
;
private
volatile
boolean
stop
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
Exception
{
if
(
config
.
networked
||
config
.
mvcc
)
{
return
;
...
...
h2/src/test/org/h2/test/unit/TestScriptReader.java
浏览文件 @
29dc32d9
...
...
@@ -18,6 +18,15 @@ import org.h2.util.ScriptReader;
*/
public
class
TestScriptReader
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
{
testCommon
();
testRandom
();
...
...
h2/src/test/org/h2/test/unit/TestSecurity.java
浏览文件 @
29dc32d9
...
...
@@ -19,6 +19,15 @@ import org.h2.util.ByteUtils;
*/
public
class
TestSecurity
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
{
testSHA
();
testAES
();
...
...
h2/src/test/org/h2/test/unit/TestServlet.java
浏览文件 @
29dc32d9
...
...
@@ -31,6 +31,15 @@ import org.h2.test.TestBase;
*/
public
class
TestServlet
extends
TestBase
{
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
/**
* Minimum ServletContext implementation.
* Most methods are not implemented.
...
...
h2/src/test/org/h2/test/unit/TestShell.java
浏览文件 @
29dc32d9
...
...
@@ -37,6 +37,15 @@ public class TestShell extends TestBase {
private
PipedInputStream
testIn
;
private
LineNumberReader
lineReader
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
IOException
{
testIn
=
new
PipedInputStream
();
PipedOutputStream
out
=
new
PipedOutputStream
(
testIn
);
...
...
h2/src/test/org/h2/test/unit/TestStreams.java
浏览文件 @
29dc32d9
...
...
@@ -20,6 +20,15 @@ import org.h2.test.TestBase;
*/
public
class
TestStreams
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
IOException
{
testLZFStreams
();
}
...
...
h2/src/test/org/h2/test/unit/TestStringUtils.java
浏览文件 @
29dc32d9
...
...
@@ -22,6 +22,15 @@ import org.h2.util.StringUtils;
*/
public
class
TestStringUtils
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
{
testHex
();
testXML
();
...
...
h2/src/test/org/h2/test/unit/TestValue.java
浏览文件 @
29dc32d9
...
...
@@ -19,6 +19,15 @@ import org.h2.value.ValueUuid;
*/
public
class
TestValue
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
{
testUUID
();
testDouble
(
false
);
...
...
h2/src/test/org/h2/test/unit/TestValueHashMap.java
浏览文件 @
29dc32d9
...
...
@@ -31,6 +31,15 @@ public class TestValueHashMap extends TestBase implements DataHandler {
CompareMode
compareMode
=
new
CompareMode
(
null
,
null
,
0
);
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
ValueHashMap
map
=
new
ValueHashMap
(
this
);
HashMap
hash
=
new
HashMap
();
...
...
h2/src/test/org/h2/test/unit/TestValueMemory.java
浏览文件 @
29dc32d9
...
...
@@ -57,6 +57,15 @@ public class TestValueMemory extends TestBase implements DataHandler {
private
Random
random
=
new
Random
(
1
);
private
SmallLRUCache
lobFileListCache
=
new
SmallLRUCache
(
128
);
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
for
(
int
i
=
0
;
i
<
Value
.
TYPE_COUNT
;
i
++)
{
testType
(
i
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论