Switched unit test dialect from Oracle to MySQL

This commit is contained in:
Lukas Eder 2013-09-16 18:05:08 +02:00
parent 7e133b8b94
commit 7203ae11ec
2 changed files with 30 additions and 30 deletions

View File

@ -71,7 +71,7 @@ import org.jooq.Result;
import org.jooq.SQLDialect;
import org.jooq.impl.DSL;
import org.jooq.test.data.Table1Record;
import org.jooq.util.oracle.OracleDataType;
import org.jooq.util.mysql.MySQLDataType;
import org.jmock.Mockery;
import org.junit.After;
@ -97,7 +97,7 @@ public abstract class AbstractTest {
// [#650] Due to a lacking data type registry, the types need to be
// loaded statically
Class.forName(OracleDataType.class.getName());
Class.forName(MySQLDataType.class.getName());
}
@Before

View File

@ -53,25 +53,25 @@
*/
package org.jooq.test;
import static org.jooq.SQLDialect.ORACLE;
import static org.jooq.conf.ParamType.INDEXED;
import static org.jooq.conf.ParamType.INLINED;
import static org.jooq.conf.ParamType.NAMED;
import static org.jooq.conf.RenderKeywordStyle.LOWER;
import static org.jooq.conf.RenderKeywordStyle.UPPER;
import static org.jooq.conf.StatementType.STATIC_STATEMENT;
import static org.jooq.impl.DSL.val;
import static org.junit.Assert.assertEquals;
import org.jooq.DSLContext;
import org.jooq.Field;
import org.jooq.Keyword;
import org.jooq.Query;
import org.jooq.SQLDialect;
import org.jooq.conf.Settings;
import org.jooq.impl.DSL;
import org.junit.Test;
import static org.jooq.SQLDialect.MYSQL;
import static org.jooq.conf.ParamType.INDEXED;
import static org.jooq.conf.ParamType.INLINED;
import static org.jooq.conf.ParamType.NAMED;
import static org.jooq.conf.RenderKeywordStyle.LOWER;
import static org.jooq.conf.RenderKeywordStyle.UPPER;
import static org.jooq.conf.StatementType.STATIC_STATEMENT;
import static org.jooq.impl.DSL.val;
import static org.junit.Assert.assertEquals;
import org.jooq.DSLContext;
import org.jooq.Field;
import org.jooq.Keyword;
import org.jooq.Query;
import org.jooq.SQLDialect;
import org.jooq.conf.Settings;
import org.jooq.impl.DSL;
import org.junit.Test;
/**
* Some common tests related to rendering.
@ -99,7 +99,7 @@ public class RenderTest extends AbstractTest {
@Test
public void testGetSQLWithParamTypeINDEXED() {
Query q =
DSL.using(SQLDialect.ORACLE, new Settings().withParamType(INDEXED))
DSL.using(SQLDialect.MYSQL, new Settings().withParamType(INDEXED))
.select(val(1), val("A"));
testGetSQL0(q, "select ?, ? from dual");
@ -108,7 +108,7 @@ public class RenderTest extends AbstractTest {
@Test
public void testGetSQLWithParamTypeINDEXEDandStatementTypeSTATIC() {
Query q =
DSL.using(SQLDialect.ORACLE, new Settings().withParamType(INDEXED)
DSL.using(SQLDialect.MYSQL, new Settings().withParamType(INDEXED)
.withStatementType(STATIC_STATEMENT))
.select(val(1), val("A"));
@ -118,7 +118,7 @@ public class RenderTest extends AbstractTest {
@Test
public void testGetSQLWithParamTypeNAMED() {
Query q =
DSL.using(SQLDialect.ORACLE, new Settings().withParamType(NAMED))
DSL.using(SQLDialect.MYSQL, new Settings().withParamType(NAMED))
.select(val(1), val("A"));
testGetSQL0(q, "select :1, :2 from dual");
@ -127,7 +127,7 @@ public class RenderTest extends AbstractTest {
@Test
public void testGetSQLWithParamTypeNAMEDandStatementTypeSTATIC() {
Query q =
DSL.using(SQLDialect.ORACLE, new Settings().withParamType(NAMED)
DSL.using(SQLDialect.MYSQL, new Settings().withParamType(NAMED)
.withStatementType(STATIC_STATEMENT))
.select(val(1), val("A"));
@ -137,7 +137,7 @@ public class RenderTest extends AbstractTest {
@Test
public void testGetSQLWithParamTypeINLINED() {
Query q =
DSL.using(SQLDialect.ORACLE, new Settings().withParamType(INLINED))
DSL.using(SQLDialect.MYSQL, new Settings().withParamType(INLINED))
.select(val(1), val("A"));
testGetSQL0(q, "select 1, 'A' from dual");
@ -146,7 +146,7 @@ public class RenderTest extends AbstractTest {
@Test
public void testGetSQLWithParamTypeINLINEDandStatementTypeSTATIC() {
Query q =
DSL.using(SQLDialect.ORACLE, new Settings().withParamType(INLINED)
DSL.using(SQLDialect.MYSQL, new Settings().withParamType(INLINED)
.withStatementType(STATIC_STATEMENT))
.select(val(1), val("A"));
@ -158,9 +158,9 @@ public class RenderTest extends AbstractTest {
Keyword keyword = DSL.keyword("Abc");
Field<?> f = DSL.field("{0} Untouched {Xx} Untouched {1}", keyword, keyword);
DSLContext def = DSL.using(ORACLE);
DSLContext lower = DSL.using(ORACLE, new Settings().withRenderKeywordStyle(LOWER));
DSLContext upper = DSL.using(ORACLE, new Settings().withRenderKeywordStyle(UPPER));
DSLContext def = DSL.using(MYSQL);
DSLContext lower = DSL.using(MYSQL, new Settings().withRenderKeywordStyle(LOWER));
DSLContext upper = DSL.using(MYSQL, new Settings().withRenderKeywordStyle(UPPER));
assertEquals("abc Untouched xx Untouched abc", def.render(f));
assertEquals("abc Untouched xx Untouched abc", lower.render(f));