mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-19 21:00:53 +08:00
#265 batoo compatibility updates to tests
This commit is contained in:
parent
ed1e24d20e
commit
43cd0775f4
@ -218,7 +218,7 @@ public abstract class AbstractStandardTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
public void test(){
|
||||
Cat kitten = savedCats.get(0);
|
||||
Cat noKitten = savedCats.get(savedCats.size()-1);
|
||||
@ -594,7 +594,7 @@ public abstract class AbstractStandardTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
public void Fetch() {
|
||||
QMammal mammal = QMammal.mammal;
|
||||
QHuman human = new QHuman("mammal");
|
||||
@ -604,7 +604,7 @@ public abstract class AbstractStandardTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
public void Fetch2() {
|
||||
QWorld world = QWorld.world;
|
||||
QMammal mammal = QMammal.mammal;
|
||||
@ -865,42 +865,42 @@ public abstract class AbstractStandardTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
public void Map_ContainsKey(){
|
||||
QShow show = QShow.show;
|
||||
assertEquals(1l, query().from(show).where(show.acts.containsKey("a")).count());
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
public void Map_ContainsKey2(){
|
||||
QShow show = QShow.show;
|
||||
assertEquals(1l, query().from(show).where(show.acts.containsKey("b")).count());
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
public void Map_ContainsKey3(){
|
||||
QShow show = QShow.show;
|
||||
assertEquals(0l, query().from(show).where(show.acts.containsKey("c")).count());
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
public void Map_ContainsValue(){
|
||||
QShow show = QShow.show;
|
||||
assertEquals(1l, query().from(show).where(show.acts.containsValue("A")).count());
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
public void Map_ContainsValue2(){
|
||||
QShow show = QShow.show;
|
||||
assertEquals(1l, query().from(show).where(show.acts.containsValue("B")).count());
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
public void Map_ContainsValue3(){
|
||||
QShow show = QShow.show;
|
||||
assertEquals(0l, query().from(show).where(show.acts.containsValue("C")).count());
|
||||
|
||||
@ -18,11 +18,14 @@ public class JPAProviderRule implements MethodRule {
|
||||
public Statement apply(Statement base, FrameworkMethod method, Object target) {
|
||||
boolean noEclipseLink = hasAnnotation(method, NoEclipseLink.class);
|
||||
boolean noOpenJPA = hasAnnotation(method, NoOpenJPA.class);
|
||||
boolean noBatooJPA = hasAnnotation(method, NoBatooJPA.class);
|
||||
String mode = Mode.mode.get();
|
||||
if (noEclipseLink && mode.contains("-eclipselink")) {
|
||||
return EmptyStatement.DEFAULT;
|
||||
} else if (noOpenJPA && mode.contains("-openjpa")) {
|
||||
return EmptyStatement.DEFAULT;
|
||||
} else if (noBatooJPA && mode.contains("-batoo")) {
|
||||
return EmptyStatement.DEFAULT;
|
||||
} else {
|
||||
return base;
|
||||
}
|
||||
|
||||
14
querydsl-jpa/src/test/java/com/mysema/query/NoBatooJPA.java
Normal file
14
querydsl-jpa/src/test/java/com/mysema/query/NoBatooJPA.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.mysema.query;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Inherited
|
||||
public @interface NoBatooJPA {
|
||||
|
||||
}
|
||||
@ -29,6 +29,7 @@ import org.junit.Test;
|
||||
import antlr.RecognitionException;
|
||||
import antlr.TokenStreamException;
|
||||
|
||||
import com.mysema.query.NoBatooJPA;
|
||||
import com.mysema.query.NoEclipseLink;
|
||||
import com.mysema.query.NoOpenJPA;
|
||||
import com.mysema.query.jpa.domain.Cat;
|
||||
@ -251,7 +252,7 @@ public class ParsingTest extends AbstractQueryTest{
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoOpenJPA
|
||||
@NoOpenJPA @NoBatooJPA
|
||||
public void DocoExamples94_3() throws Exception {
|
||||
query().from(cat).select(cat.kittens).parse();
|
||||
}
|
||||
@ -399,7 +400,7 @@ public class ParsingTest extends AbstractQueryTest{
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
public void DocoExamples98_9() throws Exception {
|
||||
query().from(person, calendar).select(person).where(
|
||||
calendar.holidays("national holiday").eq(person.birthDay),
|
||||
@ -407,7 +408,7 @@ public class ParsingTest extends AbstractQueryTest{
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
@ExcludeIn({DERBY, HSQLDB, ORACLE})
|
||||
public void DocoExamples98_10() throws Exception {
|
||||
query().from(item, ord).select(item).where(
|
||||
@ -426,7 +427,7 @@ public class ParsingTest extends AbstractQueryTest{
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
@ExcludeIn({DERBY, HSQLDB, ORACLE})
|
||||
public void DocoExamples98_12() throws Exception {
|
||||
query()
|
||||
@ -488,19 +489,19 @@ public class ParsingTest extends AbstractQueryTest{
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
public void JoinFlags1() throws RecognitionException, TokenStreamException{
|
||||
query().from(cat).fetchAll().parse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
public void JoinFlags2() throws RecognitionException, TokenStreamException{
|
||||
query().from(cat).fetchAll().from(cat1).fetchAll().parse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoEclipseLink @NoOpenJPA
|
||||
@NoEclipseLink @NoOpenJPA @NoBatooJPA
|
||||
public void JoinFlags3() throws RecognitionException, TokenStreamException{
|
||||
query().from(cat).fetchAll().from(cat1).fetchAll().parse();
|
||||
}
|
||||
@ -521,7 +522,7 @@ public class ParsingTest extends AbstractQueryTest{
|
||||
}
|
||||
|
||||
@Test
|
||||
@NoOpenJPA
|
||||
@NoOpenJPA @NoBatooJPA
|
||||
public void Joins2() throws RecognitionException, TokenStreamException{
|
||||
query().from(cat).join(cat.mate, mate).with(mate.name.eq("Bob")).parse();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user