Not serialized java object value test enabled.

上级 3570ae00
...@@ -395,7 +395,7 @@ public class SysProperties { ...@@ -395,7 +395,7 @@ public class SysProperties {
* defensive copy himself before storing, or ensure that the value object is * defensive copy himself before storing, or ensure that the value object is
* immutable. * immutable.
*/ */
public static final boolean SERIALIZE_JAVA_OBJECT = Utils.getProperty("h2.serializeJavaObject", true); public static boolean SERIALIZE_JAVA_OBJECT = Utils.getProperty("h2.serializeJavaObject", true);
private static final String H2_BASE_DIR = "h2.baseDir"; private static final String H2_BASE_DIR = "h2.baseDir";
......
...@@ -612,7 +612,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -612,7 +612,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
new TestCancel().runTest(this); new TestCancel().runTest(this);
new TestDatabaseEventListener().runTest(this); new TestDatabaseEventListener().runTest(this);
new TestDriver().runTest(this); new TestDriver().runTest(this);
// new TestJavaObject().runTest(this); new TestJavaObject().runTest(this);
new TestLimitUpdates().runTest(this); new TestLimitUpdates().runTest(this);
new TestLobApi().runTest(this); new TestLobApi().runTest(this);
new TestManyJdbcObjects().runTest(this); new TestManyJdbcObjects().runTest(this);
......
...@@ -17,6 +17,7 @@ import java.sql.Timestamp; ...@@ -17,6 +17,7 @@ import java.sql.Timestamp;
import java.sql.Types; import java.sql.Types;
import java.util.Arrays; import java.util.Arrays;
import java.util.UUID; import java.util.UUID;
import org.h2.constant.SysProperties;
import org.h2.test.TestAll; import org.h2.test.TestAll;
import org.h2.test.TestBase; import org.h2.test.TestBase;
...@@ -34,7 +35,7 @@ public class TestJavaObject extends TestBase { ...@@ -34,7 +35,7 @@ public class TestJavaObject extends TestBase {
* @param a ignored * @param a ignored
*/ */
public static void main(String... a) throws Exception { public static void main(String... a) throws Exception {
System.setProperty("h2.serializeJavaObject", "false"); // System.setProperty("h2.serializeJavaObject", "false");
TestAll conf = new TestAll(); TestAll conf = new TestAll();
conf.traceTest = true; conf.traceTest = true;
...@@ -45,6 +46,8 @@ public class TestJavaObject extends TestBase { ...@@ -45,6 +46,8 @@ public class TestJavaObject extends TestBase {
@Override @Override
public void test() throws Exception { public void test() throws Exception {
SysProperties.SERIALIZE_JAVA_OBJECT = false;
try {
trace("Test Java Object"); trace("Test Java Object");
startServerIfRequired(); startServerIfRequired();
doTest(Arrays.asList(UUID.randomUUID(), null), Arrays.asList(UUID.randomUUID(), UUID.randomUUID()), true); doTest(Arrays.asList(UUID.randomUUID(), null), Arrays.asList(UUID.randomUUID(), UUID.randomUUID()), true);
...@@ -55,6 +58,9 @@ public class TestJavaObject extends TestBase { ...@@ -55,6 +58,9 @@ public class TestJavaObject extends TestBase {
doTest(new java.util.Date(System.currentTimeMillis() + 1000), new java.util.Date(System.currentTimeMillis()), false); doTest(new java.util.Date(System.currentTimeMillis() + 1000), new java.util.Date(System.currentTimeMillis()), false);
doTest(new Time(System.currentTimeMillis() + 1000), new Date(System.currentTimeMillis()), false); doTest(new Time(System.currentTimeMillis() + 1000), new Date(System.currentTimeMillis()), false);
doTest(new Time(System.currentTimeMillis() + 1000), new Timestamp(System.currentTimeMillis()), false); doTest(new Time(System.currentTimeMillis() + 1000), new Timestamp(System.currentTimeMillis()), false);
} finally {
SysProperties.SERIALIZE_JAVA_OBJECT = true;
}
} }
private void doTest(Object o1, Object o2, boolean hash) throws SQLException { private void doTest(Object o1, Object o2, boolean hash) throws SQLException {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论