提交 223561fb authored 作者: Thomas Mueller's avatar Thomas Mueller

Add template for test cases.

上级 c7d5e730
...@@ -235,6 +235,8 @@ or if you have a feature request: ...@@ -235,6 +235,8 @@ or if you have a feature request:
to avoid formatting problems. to avoid formatting problems.
Please keep test cases as simple and short as possible, Please keep test cases as simple and short as possible,
but so that the problem can still be reproduced. but so that the problem can still be reproduced.
As a template, use:
<a href="http://h2database.googlecode.com/svn/trunk/h2/src/test/org/h2/samples/HelloWorld.java">HelloWorld.java</a>.
Method that simply call other methods should be avoided, Method that simply call other methods should be avoided,
as well as unnecessary exception handling. as well as unnecessary exception handling.
Please use the JDBC API and no external tools or libraries. Please use the JDBC API and no external tools or libraries.
......
...@@ -467,6 +467,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -467,6 +467,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Database file lock: detect hibernate / standby / very slow threads (compare system time). </li><li>Database file lock: detect hibernate / standby / very slow threads (compare system time).
</li><li>Automatic detection of redundant indexes. </li><li>Automatic detection of redundant indexes.
</li><li>If the database URL ends with ";INIT=&lt;url&gt;" then the SQL script from the given file or URL is executed (the user name must have admin rights). Example URL: jdbc:h2:mem:test;INIT=~/init.sql </li><li>If the database URL ends with ";INIT=&lt;url&gt;" then the SQL script from the given file or URL is executed (the user name must have admin rights). Example URL: jdbc:h2:mem:test;INIT=~/init.sql
</li><li>Maybe reject join without "on" (except natural join).
</li></ul> </li></ul>
<h2>Not Planned</h2> <h2>Not Planned</h2>
......
/* /*
* Copyright 2004-2009 H2 Group. Multiple-Licensed under the H2 License, * Copyright 2004-2009 H2 Group. Multiple-Licensed under the H2 License, Version
* Version 1.0, and under the Eclipse Public License, Version 1.0 * 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). * (http://h2database.com/html/license.html). Initial Developer: H2 Group
* Initial Developer: H2 Group
*/ */
package org.h2.samples; package org.h2.samples;
...@@ -13,8 +12,8 @@ import java.sql.Statement; ...@@ -13,8 +12,8 @@ import java.sql.Statement;
import org.h2.tools.DeleteDbFiles; import org.h2.tools.DeleteDbFiles;
/** /**
* A very simple class that shows how to load the driver, * A very simple class that shows how to load the driver, create a database,
* create a database, create a table, and insert some data. * create a table, and insert some data.
*/ */
public class HelloWorld { public class HelloWorld {
...@@ -31,7 +30,8 @@ public class HelloWorld { ...@@ -31,7 +30,8 @@ public class HelloWorld {
Connection conn = DriverManager.getConnection("jdbc:h2:~/test"); Connection conn = DriverManager.getConnection("jdbc:h2:~/test");
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
// this line would initialize the database from the SQL script file 'init.sql' // this line would initialize the database
// from the SQL script file 'init.sql'
// stat.execute("runscript from 'init.sql'"); // stat.execute("runscript from 'init.sql'");
stat.execute("create table test(id int primary key, name varchar(255))"); stat.execute("create table test(id int primary key, name varchar(255))");
......
...@@ -298,12 +298,6 @@ java org.h2.test.TestAll timer ...@@ -298,12 +298,6 @@ java org.h2.test.TestAll timer
/* /*
change client version (identity_scope problem)
reject join without "on" (except natural join)
add performance analysis tool to H2 Console
template for test case.
readonly database: throw exception if lock file exists readonly database: throw exception if lock file exists
console: blob: write 'binary' and '(... bytes)' console: blob: write 'binary' and '(... bytes)'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论