提交 621b8687 authored 作者: noelgrandin's avatar noelgrandin

move the DatabaseEventLister into inner classes - makes it easier to see what…

move the DatabaseEventLister into inner classes - makes it easier to see what belongs to what, especially when some of the the overriden methods are very similar to methods in the superclass (TestBase)
上级 2084502c
/* /*
* Copyright 2004-2013 H2 Group. Multiple-Licensed under the H2 License, * Copyright 2004-2013 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.test.db; package org.h2.test.db;
...@@ -10,7 +9,6 @@ import java.sql.Connection; ...@@ -10,7 +9,6 @@ import java.sql.Connection;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; 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.util.Task; import org.h2.util.Task;
...@@ -18,7 +16,7 @@ import org.h2.util.Task; ...@@ -18,7 +16,7 @@ import org.h2.util.Task;
/** /**
* Multi-connection tests. * Multi-connection tests.
*/ */
public class TestMultiConn extends TestBase implements DatabaseEventListener { public class TestMultiConn extends TestBase {
private static int wait; private static int wait;
...@@ -141,7 +139,7 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener { ...@@ -141,7 +139,7 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener {
conn.createStatement().execute("INSERT INTO TEST VALUES(0, 'Hello'), (1, 'World')"); conn.createStatement().execute("INSERT INTO TEST VALUES(0, 'Hello'), (1, 'World')");
conn.createStatement().execute("SHUTDOWN"); conn.createStatement().execute("SHUTDOWN");
conn.close(); conn.close();
final String listener = getClass().getName(); final String listener = MyDatabaseEventListener.class.getName();
Runnable r = new Runnable() { Runnable r = new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -162,27 +160,6 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener { ...@@ -162,27 +160,6 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener {
thread.join(); thread.join();
} }
@Override
public void exceptionThrown(SQLException e, String sql) {
// do nothing
}
@Override
public void setProgress(int state, String name, int x, int max) {
if (wait > 0) {
try {
Thread.sleep(wait);
} catch (InterruptedException e) {
TestBase.logError("sleep", e);
}
}
}
@Override
public void closingDatabase() {
// do nothing
}
private void testCommitRollback() throws SQLException { private void testCommitRollback() throws SQLException {
deleteDb("multiConn"); deleteDb("multiConn");
Connection c1 = getConnection("multiConn"); Connection c1 = getConnection("multiConn");
...@@ -222,6 +199,29 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener { ...@@ -222,6 +199,29 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener {
} }
public static final class MyDatabaseEventListener implements DatabaseEventListener {
@Override
public void exceptionThrown(SQLException e, String sql) {
// do nothing
}
@Override
public void setProgress(int state, String name, int x, int max) {
if (wait > 0) {
try {
Thread.sleep(wait);
} catch (InterruptedException e) {
TestBase.logError("sleep", e);
}
}
}
@Override
public void closingDatabase() {
// do nothing
}
@Override @Override
public void init(String url) { public void init(String url) {
// do nothing // do nothing
...@@ -231,5 +231,6 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener { ...@@ -231,5 +231,6 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener {
public void opened() { public void opened() {
// do nothing // do nothing
} }
}
} }
/* /*
* Copyright 2004-2013 H2 Group. Multiple-Licensed under the H2 License, * Copyright 2004-2013 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.test.db; package org.h2.test.db;
...@@ -24,7 +23,7 @@ import org.h2.util.Task; ...@@ -24,7 +23,7 @@ import org.h2.util.Task;
/** /**
* Tests opening and closing a database. * Tests opening and closing a database.
*/ */
public class TestOpenClose extends TestBase implements DatabaseEventListener { public class TestOpenClose extends TestBase {
private int nextId = 10; private int nextId = 10;
...@@ -55,8 +54,8 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener { ...@@ -55,8 +54,8 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
deleteDb("openClose"); deleteDb("openClose");
Connection conn; Connection conn;
conn = getConnection("jdbc:h2:" + getBaseDir() + "/openClose;FILE_LOCK=FS"); conn = getConnection("jdbc:h2:" + getBaseDir() + "/openClose;FILE_LOCK=FS");
assertThrows(ErrorCode.DATABASE_ALREADY_OPEN_1, this). assertThrows(ErrorCode.DATABASE_ALREADY_OPEN_1, this).getConnection(
getConnection("jdbc:h2:" + getBaseDir() + "/openClose;FILE_LOCK=FS;OPEN_NEW=TRUE"); "jdbc:h2:" + getBaseDir() + "/openClose;FILE_LOCK=FS;OPEN_NEW=TRUE");
conn.close(); conn.close();
} }
...@@ -73,8 +72,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener { ...@@ -73,8 +72,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
c.position(c.size() * 2 - 1); c.position(c.size() * 2 - 1);
c.write(ByteBuffer.wrap(new byte[1])); c.write(ByteBuffer.wrap(new byte[1]));
c.close(); c.close();
assertThrows(ErrorCode.IO_EXCEPTION_2, this). assertThrows(ErrorCode.IO_EXCEPTION_2, this).getConnection("jdbc:h2:split:18:" + getBaseDir() + "/openClose2");
getConnection("jdbc:h2:split:18:" + getBaseDir() + "/openClose2");
FileUtils.delete("split:" + getBaseDir() + "/openClose2.h2.db"); FileUtils.delete("split:" + getBaseDir() + "/openClose2.h2.db");
} }
...@@ -127,8 +125,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener { ...@@ -127,8 +125,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
deleteDb("openClose"); deleteDb("openClose");
String user = getUser(), password = getPassword(); String user = getUser(), password = getPassword();
String url = getURL("openClose;DATABASE_EVENT_LISTENER='" + TestOpenClose.class.getName() String url = getURL("openClose;DATABASE_EVENT_LISTENER='" + MyDatabaseEventListener.class.getName() + "'", true);
+ "'", true);
Connection conn = DriverManager.getConnection(url, user, password); Connection conn = DriverManager.getConnection(url, user, password);
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
stat.execute("CREATE TABLE TEST(ID IDENTITY, NAME VARCHAR)"); stat.execute("CREATE TABLE TEST(ID IDENTITY, NAME VARCHAR)");
...@@ -204,6 +201,8 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener { ...@@ -204,6 +201,8 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
return nextId++; return nextId++;
} }
public static final class MyDatabaseEventListener implements DatabaseEventListener {
@Override @Override
public void exceptionThrown(SQLException e, String sql) { public void exceptionThrown(SQLException e, String sql) {
throw new AssertionError("unexpected: " + e + " sql: " + sql); throw new AssertionError("unexpected: " + e + " sql: " + sql);
...@@ -250,5 +249,6 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener { ...@@ -250,5 +249,6 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
public void opened() { public void opened() {
// nothing to do // nothing to do
} }
}
} }
...@@ -20,7 +20,7 @@ import org.h2.test.TestBase; ...@@ -20,7 +20,7 @@ import org.h2.test.TestBase;
/** /**
* Tests the DatabaseEventListener interface. * Tests the DatabaseEventListener interface.
*/ */
public class TestDatabaseEventListener extends TestBase implements DatabaseEventListener { public class TestDatabaseEventListener extends TestBase {
private static boolean calledOpened, calledClosingDatabase, calledScan, calledCreateIndex; private static boolean calledOpened, calledClosingDatabase, calledScan, calledCreateIndex;
private static boolean calledStatementStart, calledStatementEnd, calledStatementProgress; private static boolean calledStatementStart, calledStatementEnd, calledStatementProgress;
...@@ -136,7 +136,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent ...@@ -136,7 +136,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent
conn = DriverManager.getConnection(url, p); conn = DriverManager.getConnection(url, p);
conn.close(); conn.close();
calledCreateIndex = false; calledCreateIndex = false;
p.put("DATABASE_EVENT_LISTENER", getClass().getName()); p.put("DATABASE_EVENT_LISTENER", MyDatabaseEventListener.class.getName());
conn = org.h2.Driver.load().connect(url, p); conn = org.h2.Driver.load().connect(url, p);
conn.close(); conn.close();
assertTrue(!calledCreateIndex); assertTrue(!calledCreateIndex);
...@@ -168,7 +168,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent ...@@ -168,7 +168,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent
stat.execute("insert into test select 1"); stat.execute("insert into test select 1");
conn.close(); conn.close();
calledCreateIndex = false; calledCreateIndex = false;
p.put("DATABASE_EVENT_LISTENER", getClass().getName()); p.put("DATABASE_EVENT_LISTENER", MyDatabaseEventListener.class.getName());
conn = org.h2.Driver.load().connect(url, p); conn = org.h2.Driver.load().connect(url, p);
conn.close(); conn.close();
assertTrue(!calledCreateIndex); assertTrue(!calledCreateIndex);
...@@ -195,7 +195,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent ...@@ -195,7 +195,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent
calledOpened = false; calledOpened = false;
calledScan = false; calledScan = false;
p.put("DATABASE_EVENT_LISTENER", getClass().getName()); p.put("DATABASE_EVENT_LISTENER", MyDatabaseEventListener.class.getName());
conn = org.h2.Driver.load().connect(url, p); conn = org.h2.Driver.load().connect(url, p);
conn.close(); conn.close();
if (calledOpened) { if (calledOpened) {
...@@ -209,7 +209,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent ...@@ -209,7 +209,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent
p.setProperty("password", "sa"); p.setProperty("password", "sa");
calledOpened = false; calledOpened = false;
calledClosingDatabase = false; calledClosingDatabase = false;
p.put("DATABASE_EVENT_LISTENER", getClass().getName()); p.put("DATABASE_EVENT_LISTENER", MyDatabaseEventListener.class.getName());
org.h2.Driver.load(); org.h2.Driver.load();
String url = "jdbc:h2:mem:databaseEventListener"; String url = "jdbc:h2:mem:databaseEventListener";
Connection conn = org.h2.Driver.load().connect(url, p); Connection conn = org.h2.Driver.load().connect(url, p);
...@@ -225,7 +225,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent ...@@ -225,7 +225,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent
calledStatementStart = false; calledStatementStart = false;
calledStatementEnd = false; calledStatementEnd = false;
calledStatementProgress = false; calledStatementProgress = false;
p.put("DATABASE_EVENT_LISTENER", getClass().getName()); p.put("DATABASE_EVENT_LISTENER", MyDatabaseEventListener.class.getName());
org.h2.Driver.load(); org.h2.Driver.load();
String url = "jdbc:h2:mem:databaseEventListener"; String url = "jdbc:h2:mem:databaseEventListener";
Connection conn = org.h2.Driver.load().connect(url, p); Connection conn = org.h2.Driver.load().connect(url, p);
...@@ -238,6 +238,8 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent ...@@ -238,6 +238,8 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent
assertTrue(calledStatementProgress); assertTrue(calledStatementProgress);
} }
public static final class MyDatabaseEventListener implements DatabaseEventListener {
@Override @Override
public void closingDatabase() { public void closingDatabase() {
calledClosingDatabase = true; calledClosingDatabase = true;
...@@ -285,4 +287,6 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent ...@@ -285,4 +287,6 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent
} }
} }
}
} }
...@@ -20,7 +20,7 @@ import org.h2.tools.Server; ...@@ -20,7 +20,7 @@ import org.h2.tools.Server;
/** /**
* Tests automatic embedded/server mode. * Tests automatic embedded/server mode.
*/ */
public class TestAutoReconnect extends TestBase implements DatabaseEventListener { public class TestAutoReconnect extends TestBase {
private String url; private String url;
private boolean autoServer; private boolean autoServer;
...@@ -95,7 +95,7 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener ...@@ -95,7 +95,7 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener
} }
// test the database event listener // test the database event listener
conn = DriverManager.getConnection(url + ";DATABASE_EVENT_LISTENER='" + getClass().getName() + "'"); conn = DriverManager.getConnection(url + ";DATABASE_EVENT_LISTENER='" + MyDatabaseEventListener.class.getName() + "'");
conn.close(); conn.close();
Statement stat; Statement stat;
...@@ -176,6 +176,7 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener ...@@ -176,6 +176,7 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener
} }
} }
public static final class MyDatabaseEventListener implements DatabaseEventListener {
@Override @Override
public void closingDatabase() { public void closingDatabase() {
// ignore // ignore
...@@ -200,5 +201,5 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener ...@@ -200,5 +201,5 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener
public void setProgress(int state, String name, int x, int max) { public void setProgress(int state, String name, int x, int max) {
// ignore // ignore
} }
}
} }
...@@ -20,7 +20,7 @@ import org.h2.test.utils.SelfDestructor; ...@@ -20,7 +20,7 @@ import org.h2.test.utils.SelfDestructor;
* Tests the flag db_close_on_exit. * Tests the flag db_close_on_exit.
* A new process is started. * A new process is started.
*/ */
public class TestExit extends TestBase implements DatabaseEventListener { public class TestExit extends TestBase {
public static Connection conn; public static Connection conn;
...@@ -92,11 +92,11 @@ public class TestExit extends TestBase implements DatabaseEventListener { ...@@ -92,11 +92,11 @@ public class TestExit extends TestBase implements DatabaseEventListener {
String url = ""; String url = "";
switch (action) { switch (action) {
case OPEN_WITH_CLOSE_ON_EXIT: case OPEN_WITH_CLOSE_ON_EXIT:
url = "jdbc:h2:" + getBaseDir() + "/exit;database_event_listener='" + getClass().getName() url = "jdbc:h2:" + getBaseDir() + "/exit;database_event_listener='" + MyDatabaseEventListener.class.getName()
+ "';db_close_on_exit=true"; + "';db_close_on_exit=true";
break; break;
case OPEN_WITHOUT_CLOSE_ON_EXIT: case OPEN_WITHOUT_CLOSE_ON_EXIT:
url = "jdbc:h2:" + getBaseDir() + "/exit;database_event_listener='" + getClass().getName() url = "jdbc:h2:" + getBaseDir() + "/exit;database_event_listener='" + MyDatabaseEventListener.class.getName()
+ "';db_close_on_exit=false"; + "';db_close_on_exit=false";
break; break;
default: default:
...@@ -111,6 +111,12 @@ public class TestExit extends TestBase implements DatabaseEventListener { ...@@ -111,6 +111,12 @@ public class TestExit extends TestBase implements DatabaseEventListener {
return DriverManager.getConnection(url, "sa", ""); return DriverManager.getConnection(url, "sa", "");
} }
private static File getClosedFile() {
return new File(TestBase.BASE_TEST_DIR + "/closed.txt");
}
public static final class MyDatabaseEventListener implements DatabaseEventListener {
@Override @Override
public void exceptionThrown(SQLException e, String sql) { public void exceptionThrown(SQLException e, String sql) {
// nothing to do // nothing to do
...@@ -125,10 +131,6 @@ public class TestExit extends TestBase implements DatabaseEventListener { ...@@ -125,10 +131,6 @@ public class TestExit extends TestBase implements DatabaseEventListener {
} }
} }
private static File getClosedFile() {
return new File(TestBase.BASE_TEST_DIR + "/closed.txt");
}
@Override @Override
public void setProgress(int state, String name, int x, int max) { public void setProgress(int state, String name, int x, int max) {
// nothing to do // nothing to do
...@@ -144,4 +146,6 @@ public class TestExit extends TestBase implements DatabaseEventListener { ...@@ -144,4 +146,6 @@ public class TestExit extends TestBase implements DatabaseEventListener {
// nothing to do // nothing to do
} }
}
} }
/* /*
* Copyright 2004-2013 H2 Group. Multiple-Licensed under the H2 License, * Copyright 2004-2013 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.test.unit; package org.h2.test.unit;
...@@ -31,7 +30,7 @@ import org.h2.util.New; ...@@ -31,7 +30,7 @@ import org.h2.util.New;
/** /**
* Test the page store. * Test the page store.
*/ */
public class TestPageStore extends TestBase implements DatabaseEventListener { public class TestPageStore extends TestBase {
static StringBuilder eventBuffer = new StringBuilder(); static StringBuilder eventBuffer = new StringBuilder();
...@@ -148,8 +147,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -148,8 +147,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
stat.execute("insert into test values (space(2000))"); stat.execute("insert into test values (space(2000))");
} }
stat.execute("checkpoint"); stat.execute("checkpoint");
InputStream in = FileUtils.newInputStream(getBaseDir() + InputStream in = FileUtils.newInputStream(getBaseDir() + "/pageStoreLogLimitFalsePositive.trace.db");
"/pageStoreLogLimitFalsePositive.trace.db");
String s = IOUtils.readStringAndClose(new InputStreamReader(in), -1); String s = IOUtils.readStringAndClose(new InputStreamReader(in), -1);
assertFalse(s.indexOf("Transaction log could not be truncated") > 0); assertFalse(s.indexOf("Transaction log could not be truncated") > 0);
conn.close(); conn.close();
...@@ -446,11 +444,10 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -446,11 +444,10 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
int size = 1500; int size = 1500;
stat.execute("call rand(1)"); stat.execute("call rand(1)");
stat.execute("create table test(id int primary key, data varchar, test int) as " + stat.execute("create table test(id int primary key, data varchar, test int) as "
"select x, '', 123 from system_range(1, " + size + ")"); + "select x, '', 123 from system_range(1, " + size + ")");
Random random = new Random(1); Random random = new Random(1);
PreparedStatement prep = conn.prepareStatement( PreparedStatement prep = conn.prepareStatement("update test set data=space(?) where id=?");
"update test set data=space(?) where id=?");
for (int i = 0; i < 2500; i++) { for (int i = 0; i < 2500; i++) {
int id = random.nextInt(size); int id = random.nextInt(size);
int newSize = random.nextInt(6000); int newSize = random.nextInt(6000);
...@@ -502,7 +499,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -502,7 +499,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
// ignore // ignore
} }
eventBuffer.setLength(0); eventBuffer.setLength(0);
conn = getConnection(url + ";DATABASE_EVENT_LISTENER='" + getClass().getName() + "'"); conn = getConnection(url + ";DATABASE_EVENT_LISTENER='" + MyDatabaseEventListener.class.getName() + "'");
assertEquals("init;opened;", eventBuffer.toString()); assertEquals("init;opened;", eventBuffer.toString());
conn.close(); conn.close();
} }
...@@ -520,8 +517,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -520,8 +517,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
conn.createStatement().execute("INSERT INTO TEST VALUES(1, 'Hello')"); conn.createStatement().execute("INSERT INTO TEST VALUES(1, 'Hello')");
conn.close(); conn.close();
conn = getConnection(url); conn = getConnection(url);
assertThrows(ErrorCode.DUPLICATE_KEY_1, conn.createStatement()). assertThrows(ErrorCode.DUPLICATE_KEY_1, conn.createStatement()).execute("INSERT INTO TEST VALUES(2, 'Hello')");
execute("INSERT INTO TEST VALUES(2, 'Hello')");
conn.close(); conn.close();
} }
...@@ -742,8 +738,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -742,8 +738,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
stat.execute("INSERT INTO TEST VALUES(1)"); stat.execute("INSERT INTO TEST VALUES(1)");
conn.close(); conn.close();
conn = getConnection("pageStoreUniqueIndex"); conn = getConnection("pageStoreUniqueIndex");
assertThrows(ErrorCode.DUPLICATE_KEY_1, conn.createStatement()). assertThrows(ErrorCode.DUPLICATE_KEY_1, conn.createStatement()).execute("INSERT INTO TEST VALUES(1)");
execute("INSERT INTO TEST VALUES(1)");
conn.close(); conn.close();
} }
...@@ -761,7 +756,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -761,7 +756,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
conn.close(); conn.close();
} }
private void testFuzzOperations() throws SQLException { private void testFuzzOperations() throws Exception {
int best = Integer.MAX_VALUE; int best = Integer.MAX_VALUE;
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
int x = testFuzzOperationsSeed(i, 10); int x = testFuzzOperationsSeed(i, 10);
...@@ -835,6 +830,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -835,6 +830,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
trace(" " + m); trace(" " + m);
} }
public static final class MyDatabaseEventListener implements DatabaseEventListener {
@Override @Override
public void closingDatabase() { public void closingDatabase() {
event("closing"); event("closing");
...@@ -873,5 +869,5 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -873,5 +869,5 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
private static void event(String s) { private static void event(String s) {
eventBuffer.append(s).append(';'); eventBuffer.append(s).append(';');
} }
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论