OPENJPA-1143: fix test case

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@799061 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Fay Wang 2009-07-29 20:32:42 +00:00
parent 0928de7512
commit a10a0a5d80
2 changed files with 16 additions and 14 deletions

View File

@ -241,8 +241,6 @@ public abstract class CriteriaTest extends TestCase {
void executeAndCompareSQL(String jpql, String expectedSQL) {
JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
DBDictionary dict = conf.getDBDictionaryInstance();
if (!(dict instanceof DerbyDictionary))
return;
Query jQ = em.createQuery(jpql);
@ -257,6 +255,9 @@ public abstract class CriteriaTest extends TestCase {
printSQL("Target SQL for JPQL", jSQL);
if (!(dict instanceof DerbyDictionary))
return;
for (int i = 0; i < jSQL.size(); i++) {
if (!jSQL.get(i).equals(expectedSQL)) {
printSQL("SQL for JPQL", jSQL.get(i));
@ -270,8 +271,6 @@ public abstract class CriteriaTest extends TestCase {
void executeAndCompareSQL(Query jQ, String expectedSQL) {
JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
DBDictionary dict = conf.getDBDictionaryInstance();
if (!(dict instanceof DerbyDictionary))
return;
List<String> jSQL = null;
try {
@ -281,6 +280,9 @@ public abstract class CriteriaTest extends TestCase {
e.printStackTrace(new PrintWriter(w));
}
if (!(dict instanceof DerbyDictionary))
return;
printSQL("Expected SQL", expectedSQL);
String jSql = jSQL.get(0).trim();
if (jSql.indexOf("optimize for 1 row") != -1)