Search in sources :

Example 6 with ExcludeIn

use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.

the class HibernateSQLBase method entityQueries_createQuery2.

@Test
@ExcludeIn(Target.MYSQL)
public void entityQueries_createQuery2() {
    SAnimal cat = new SAnimal("CAT");
    QCat catEntity = QCat.cat;
    Query query = query().from(cat).select(catEntity).createQuery();
    assertEquals(6, query.list().size());
}
Also used : SAnimal(com.querydsl.jpa.domain.sql.SAnimal) QCat(com.querydsl.jpa.domain.QCat) Query(org.hibernate.Query) HibernateSQLQuery(com.querydsl.jpa.hibernate.sql.HibernateSQLQuery) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 7 with ExcludeIn

use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.

the class TargetRule method isExecuted.

private boolean isExecuted(Description description, Target target) {
    ExcludeIn ex = description.getAnnotation(ExcludeIn.class);
    // excluded in given targets
    if (ex != null && Arrays.asList(ex.value()).contains(target)) {
        return false;
    }
    // included only in given targets
    IncludeIn in = description.getAnnotation(IncludeIn.class);
    if (in != null && !Arrays.asList(in.value()).contains(target)) {
        return false;
    }
    return true;
}
Also used : IncludeIn(com.querydsl.core.testutil.IncludeIn) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 8 with ExcludeIn

use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.

the class SpatialBase method geometryType.

// FIXME, maybe use enum as the type ?!?
@Test
@ExcludeIn(H2)
public void geometryType() {
    List<Tuple> results = query().from(shapes).select(shapes.geometry, shapes.geometry.geometryType()).fetch();
    assertFalse(results.isEmpty());
    for (Tuple row : results) {
        assertEquals(normalize(row.get(shapes.geometry).getGeometryType().name()), normalize(row.get(shapes.geometry.geometryType())));
    }
}
Also used : Tuple(com.querydsl.core.Tuple) AbstractBaseTest(com.querydsl.sql.AbstractBaseTest) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 9 with ExcludeIn

use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.

the class SpatialBase method point_x_y.

@Test
@ExcludeIn(H2)
public void point_x_y() {
    PointPath<Point> point = shapes.geometry.asPoint();
    List<Tuple> results = withPoints().select(point, point.x(), point.y()).fetch();
    assertFalse(results.isEmpty());
    for (Tuple row : results) {
        assertEquals(Double.valueOf(row.get(point).getX()), row.get(point.x()));
        assertEquals(Double.valueOf(row.get(point).getY()), row.get(point.y()));
    }
}
Also used : Tuple(com.querydsl.core.Tuple) AbstractBaseTest(com.querydsl.sql.AbstractBaseTest) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 10 with ExcludeIn

use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.

the class MergeBase method merge_with_keys_Null_Id.

@Test
@ExcludeIn({ CUBRID, DB2, DERBY, POSTGRESQL, SQLSERVER, TERADATA })
public void merge_with_keys_Null_Id() throws SQLException {
    ResultSet rs = merge(survey).keys(survey.id).setNull(survey.id).set(survey.name, "Hello World").executeWithKeys();
    assertTrue(rs.next());
    assertTrue(rs.getObject(1) != null);
    rs.close();
}
Also used : ResultSet(java.sql.ResultSet) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Aggregations

ExcludeIn (com.querydsl.core.testutil.ExcludeIn)40 Test (org.junit.Test)38 Tuple (com.querydsl.core.Tuple)9 SQLInsertClause (com.querydsl.sql.dml.SQLInsertClause)6 ResultSet (java.sql.ResultSet)6 SAnimal (com.querydsl.jpa.domain.sql.SAnimal)4 QEmployee (com.querydsl.sql.domain.QEmployee)4 BigDecimal (java.math.BigDecimal)4 Date (java.sql.Date)4 Ignore (org.junit.Ignore)4 AbstractBaseTest (com.querydsl.sql.AbstractBaseTest)3 Group (com.querydsl.core.group.Group)2 IncludeIn (com.querydsl.core.testutil.IncludeIn)2 QCat (com.querydsl.jpa.domain.QCat)2 BigInteger (java.math.BigInteger)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 ImmutableList (com.google.common.collect.ImmutableList)1 MockTuple (com.querydsl.core.group.MockTuple)1 StringPath (com.querydsl.core.types.dsl.StringPath)1 QBookMark (com.querydsl.jpa.domain4.QBookMark)1