提交 ba4ec6b7 authored 作者: Vitaly Dyachkov's avatar Vitaly Dyachkov

unit test for LOB recovery is adjusted to H2 approach

上级 35b408d6
......@@ -114,6 +114,7 @@ import org.h2.test.mvcc.TestMvcc3;
import org.h2.test.mvcc.TestMvcc4;
import org.h2.test.mvcc.TestMvccMultiThreaded;
import org.h2.test.poweroff.TestReorderWrites;
import org.h2.test.recover.RecoverLobTest;
import org.h2.test.rowlock.TestRowLocks;
import org.h2.test.server.TestAutoServer;
import org.h2.test.server.TestInit;
......@@ -858,6 +859,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
addTest(new TestReader());
addTest(new TestRecovery());
addTest(new TestScriptReader());
addTest(new RecoverLobTest());
addTest(createTest("org.h2.test.unit.TestServlet"));
addTest(new TestSecurity());
addTest(new TestShell());
......@@ -873,6 +875,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
addTest(new TestValueHashMap());
addTest(new TestWeb());
runAddedTests();
// serial
......
package org.h2.test.recover;
import static org.junit.Assert.*;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
......@@ -9,25 +7,27 @@ import java.sql.Statement;
import org.h2.test.TestBase;
import org.h2.tools.DeleteDbFiles;
import org.h2.tools.Recover;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class RecoverLobTest extends TestBase {
@Before
public void setUp() throws Exception{
init();
public static void main(String... a) throws Exception {
TestBase.createCaller().init().test();
}
@Override
public TestBase init() throws Exception {
TestBase tb = super.init();
config.mvStore=false;
return tb;
}
@Override
public void test() throws Exception {
testRecoverClob();
}
@Test
public void testRecoverClob() throws Exception {
DeleteDbFiles.execute(getBaseDir(), "recovery", true);
Connection conn = getConnection("recovery");
......@@ -56,8 +56,8 @@ public class RecoverLobTest extends TestBase {
int id = rs.getInt(1);
String data = rs.getString(2);
Assert.assertNotNull(data);
Assert.assertTrue(data.length() == 10000 * id);
assertTrue(data != null);
assertTrue(data.length() == 10000 * id);
}
rs.close();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论