提交 13be8da1 authored 作者: Thomas Mueller's avatar Thomas Mueller

Fixed / improved test cases

上级 b28e3a6b
......@@ -351,10 +351,10 @@ public class TestCsv extends TestBase {
Connection conn = getConnection("csv");
Statement stat = conn.createStatement();
stat.execute("drop table if exists test");
stat.execute("create table test(a varchar, b varchar)");
stat.execute("create table test(id identity, a varchar, b varchar)");
int len = getSize(1000, 10000);
PreparedStatement prep = conn.prepareStatement(
"insert into test values(?, ?)");
"insert into test(a, b) values(?, ?)");
ArrayList<String[]> list = New.arrayList();
Random random = new Random(1);
for (int i = 0; i < len; i++) {
......@@ -364,8 +364,8 @@ public class TestCsv extends TestBase {
list.add(new String[] { a, b });
prep.execute();
}
stat.execute("CALL CSVWRITE('" + getBaseDir() +
"/test.csv', 'SELECT * FROM test', 'UTF-8', '|', '#')");
stat.execute("call csvwrite('" + getBaseDir() +
"/test.csv', 'select a, b from test order by id', 'UTF-8', '|', '#')");
Csv csv = new Csv();
csv.setFieldSeparatorRead('|');
csv.setFieldDelimiter('#');
......
......@@ -1534,7 +1534,7 @@ public class TestLob extends TestBase {
String read = rs.getString(2);
if (!read.equals(data)) {
for (int j = 0; j < read.length(); j++) {
assertEquals("pos: " + j, read.charAt(j), data.charAt(j));
assertEquals("pos: " + j + " i:" + i, read.charAt(j), data.charAt(j));
}
}
assertEquals(read, data);
......
......@@ -424,7 +424,9 @@ public class TestSpatial extends TestBase {
"explain select * from test " +
"where polygon && 'POLYGON ((1 1, 1 2, 2 2, 1 1))'::Geometry");
rs.next();
assertContains(rs.getString(1), "/* PUBLIC.IDX_TEST_POLYGON: POLYGON &&");
if (config.mvStore) {
assertContains(rs.getString(1), "/* PUBLIC.IDX_TEST_POLYGON: POLYGON &&");
}
// TODO equality should probably also use the spatial index
// rs = stat.executeQuery("explain select * from test " +
......
......@@ -546,7 +546,7 @@ create table folder(id int primary key, name varchar(255), parent int);
insert into folder values(1, null, null), (2, 'bin', 1), (3, 'docs', 1), (4, 'html', 3), (5, 'javadoc', 3), (6, 'ext', 1), (7, 'service', 1), (8, 'src', 1), (9, 'docsrc', 8), (10, 'installer', 8), (11, 'main', 8), (12, 'META-INF', 11), (13, 'org', 11), (14, 'h2', 13), (15, 'test', 8), (16, 'tools', 8);
> update count: 16
with link(id, name, level) as (select id, name, 0 from folder where parent is null union all select folder.id, ifnull(link.name || '/', '') || folder.name, level + 1 from link inner join folder on link.id = folder.parent) select name from link where name is not null order by id;
with link(id, name, level) as (select id, name, 0 from folder where parent is null union all select folder.id, ifnull(link.name || '/', '') || folder.name, level + 1 from link inner join folder on link.id = folder.parent) select name from link where name is not null order by cast(id as int);
> NAME
> -----------------
> bin
......@@ -856,6 +856,7 @@ select id2 from test;
> ID2
> ---
> 1
> rows: 1
drop table test;
> ok
......
......@@ -69,11 +69,13 @@ public class TestJmx extends TestBase {
getAttribute(name, "FileWriteCount").toString());
assertEquals("0", mbeanServer.
getAttribute(name, "FileWriteCountTotal").toString());
assertEquals("1", mbeanServer.
getAttribute(name, "LogMode").toString());
mbeanServer.setAttribute(name, new Attribute("LogMode", 2));
assertEquals("2", mbeanServer.
getAttribute(name, "LogMode").toString());
if (config.mvStore) {
assertEquals("1", mbeanServer.
getAttribute(name, "LogMode").toString());
mbeanServer.setAttribute(name, new Attribute("LogMode", 2));
assertEquals("2", mbeanServer.
getAttribute(name, "LogMode").toString());
}
assertEquals("REGULAR", mbeanServer.
getAttribute(name, "Mode").toString());
assertEquals("false", mbeanServer.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论