提交 e79a7c8a authored 作者: Noel Grandin's avatar Noel Grandin

fix TestClearReferences

上级 ef4da740
......@@ -819,7 +819,7 @@ public class Parser {
}
currentPrepared = command;
int start = lastParseIndex;
if (!readIf("FROM") && database.getMode() == Mode.MYSQL) {
if (!readIf("FROM") && database.getMode() == Mode.getMySQL()) {
readIdentifierWithSchema();
read("FROM");
}
......
......@@ -24,7 +24,6 @@ public class Mode {
static final String REGULAR = "REGULAR";
private static final HashMap<String, Mode> MODES = New.hashMap();
public static final Mode MYSQL;
// Modes are also documented in the features section
......@@ -236,7 +235,7 @@ public class Mode {
mode.supportedClientInfoPropertiesRegEx = null;
add(mode);
MYSQL = mode = new Mode("MySQL");
mode = new Mode("MySQL");
mode.convertInsertNullToZero = true;
mode.indexDefinitionInCreateTable = true;
mode.lowerCaseIdentifiers = true;
......@@ -311,6 +310,10 @@ public class Mode {
return MODES.get(StringUtils.toUpperEnglish(name));
}
public static Mode getMySQL() {
return getInstance("MySQL");
}
public String getName() {
return name;
}
......
......@@ -58,15 +58,6 @@ public class TestClearReferences extends TestBase {
TestBase.createCaller().init().test();
}
private void clear() throws Exception {
ArrayList<Class <?>> classes = New.arrayList();
check(classes, new File("bin/org/h2"));
check(classes, new File("temp/org/h2"));
for (Class<?> clazz : classes) {
clearClass(clazz);
}
}
@Override
public void test() throws Exception {
// initialize the known classes
......@@ -91,14 +82,23 @@ public class TestClearReferences extends TestBase {
}
}
private void check(ArrayList<Class <?>> classes, File file) {
private void clear() throws Exception {
ArrayList<Class <?>> classes = New.arrayList();
findClasses(classes, new File("bin/org/h2"));
findClasses(classes, new File("temp/org/h2"));
for (Class<?> clazz : classes) {
clearClass(clazz);
}
}
private void findClasses(ArrayList<Class <?>> classes, File file) {
String name = file.getName();
if (file.isDirectory()) {
if (name.equals("CVS") || name.equals(".svn")) {
return;
}
for (File f : file.listFiles()) {
check(classes, f);
findClasses(classes, f);
}
} else {
if (!name.endsWith(".class")) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论