mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
FIX: withQuote_when:_match for different platforms (#1490)
This commit is contained in:
committed by
Rob Bygrave
parent
0036473971
commit
b817d5ee4d
@@ -1,6 +1,9 @@
|
||||
package io.ebeaninternal.server.deploy;
|
||||
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.annotation.ForPlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.tests.model.basic.Address;
|
||||
import org.tests.model.basic.BWithQIdent;
|
||||
@@ -53,11 +56,26 @@ public class DeployPropertyParserTest extends BaseTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void withQuote_when_match() {
|
||||
@ForPlatform(value = {Platform.H2, Platform.POSTGRES})
|
||||
public void withQuote_when_match_h2() {
|
||||
assertThat(withQuoteParser().parse("name like ?")).isEqualTo("${}\"Name\" like ?");
|
||||
assertThat(withQuoteParser().parse("t0.\"CODE\" like ?")).isEqualTo("t0.\"CODE\" like ?");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ForPlatform(value = Platform.SQLSERVER)
|
||||
public void withQuote_when_match_sqlserver() {
|
||||
assertThat(withQuoteParser().parse("name like ?")).isEqualTo("${}[Name] like ?");
|
||||
assertThat(withQuoteParser().parse("t0.[CODE] like ?")).isEqualTo("t0.[CODE] like ?");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ForPlatform(value = Platform.MYSQL)
|
||||
public void withQuote_when_match_mysql() {
|
||||
assertThat(withQuoteParser().parse("name like ?")).isEqualTo("${}`Name` like ?");
|
||||
assertThat(withQuoteParser().parse("t0.`CODE` like ?")).isEqualTo("t0.`CODE` like ?");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void unknown_path() {
|
||||
assertThat(parser().parse(" foo ")).isEqualTo(" foo ");
|
||||
|
||||
Reference in New Issue
Block a user