mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
This commit is contained in:
parent
9420612257
commit
4b108ffdab
@ -7,6 +7,9 @@ package com.mysema.query;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import com.mysema.testutil.JPAConfig;
|
||||
import com.mysema.testutil.JPATestRunner;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -7,6 +7,9 @@ package com.mysema.query;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import com.mysema.testutil.HibernateConfig;
|
||||
import com.mysema.testutil.HibernateTestRunner;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -7,6 +7,9 @@ package com.mysema.query;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import com.mysema.testutil.JPAConfig;
|
||||
import com.mysema.testutil.JPATestRunner;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -7,6 +7,9 @@ package com.mysema.query;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import com.mysema.testutil.HibernateConfig;
|
||||
import com.mysema.testutil.HibernateTestRunner;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -7,6 +7,9 @@ package com.mysema.query;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import com.mysema.testutil.HibernateConfig;
|
||||
import com.mysema.testutil.HibernateTestRunner;
|
||||
|
||||
|
||||
@RunWith(HibernateTestRunner.class)
|
||||
@HibernateConfig("mysql.properties")
|
||||
|
||||
@ -7,6 +7,9 @@ package com.mysema.query;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import com.mysema.testutil.HibernateConfig;
|
||||
import com.mysema.testutil.HibernateTestRunner;
|
||||
|
||||
|
||||
@RunWith(HibernateTestRunner.class)
|
||||
@HibernateConfig("mysql.properties")
|
||||
|
||||
@ -50,7 +50,7 @@ import com.mysema.query.types.expr.Expr;
|
||||
* @author tiwe
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ParserTest implements Constants {
|
||||
public class HQLExamplesTest implements Constants {
|
||||
|
||||
protected TestQuery query() {
|
||||
return new TestQuery();
|
||||
@ -99,7 +99,9 @@ public class ParserTest implements Constants {
|
||||
@Test
|
||||
public void joins() throws RecognitionException, TokenStreamException{
|
||||
query().from(cat).join(cat.mate).select(cat).parse();
|
||||
|
||||
query().from(cat).innerJoin(cat.mate).select(cat).parse();
|
||||
|
||||
query().from(cat).leftJoin(cat.mate).select(cat).parse();
|
||||
}
|
||||
|
||||
@ -17,8 +17,6 @@ import org.junit.runner.RunWith;
|
||||
import antlr.RecognitionException;
|
||||
import antlr.TokenStreamException;
|
||||
|
||||
import com.mysema.query.HibernateConfig;
|
||||
import com.mysema.query.HibernateTestRunner;
|
||||
import com.mysema.query.hql.domain.Cat;
|
||||
import com.mysema.query.hql.domain.QCat;
|
||||
import com.mysema.query.hql.hibernate.HibernateDeleteClause;
|
||||
@ -26,6 +24,8 @@ import com.mysema.query.hql.hibernate.HibernateQuery;
|
||||
import com.mysema.query.hql.hibernate.HibernateUpdateClause;
|
||||
import com.mysema.query.hql.hibernate.HibernateUtil;
|
||||
import com.mysema.query.types.path.PEntity;
|
||||
import com.mysema.testutil.HibernateConfig;
|
||||
import com.mysema.testutil.HibernateTestRunner;
|
||||
|
||||
/**
|
||||
* HibernatePersistenceTest provides.
|
||||
@ -35,26 +35,21 @@ import com.mysema.query.types.path.PEntity;
|
||||
*/
|
||||
@RunWith(HibernateTestRunner.class)
|
||||
@HibernateConfig("hsqldb.properties")
|
||||
public class HibernateIntegrationTest extends ParserTest {
|
||||
public class HibernateIntegrationTest extends HQLExamplesTest {
|
||||
|
||||
private Session session;
|
||||
|
||||
protected TestQuery query() {
|
||||
return new TestQuery() {
|
||||
public void parse() throws RecognitionException,
|
||||
TokenStreamException {
|
||||
public void parse() throws RecognitionException, TokenStreamException {
|
||||
try {
|
||||
System.out.println("query : " + toString().replace('\n', ' '));
|
||||
|
||||
// create Query and execute it
|
||||
Query query = session.createQuery(toString());
|
||||
HibernateUtil.setConstants(query, getConstants());
|
||||
try {
|
||||
query.list();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
query.list();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@ -14,9 +14,9 @@ import org.junit.runner.RunWith;
|
||||
import antlr.RecognitionException;
|
||||
import antlr.TokenStreamException;
|
||||
|
||||
import com.mysema.query.JPAConfig;
|
||||
import com.mysema.query.JPATestRunner;
|
||||
import com.mysema.query.hql.jpa.JPAUtil;
|
||||
import com.mysema.testutil.JPAConfig;
|
||||
import com.mysema.testutil.JPATestRunner;
|
||||
|
||||
/**
|
||||
* HibernatePersistenceTest provides.
|
||||
@ -26,7 +26,7 @@ import com.mysema.query.hql.jpa.JPAUtil;
|
||||
*/
|
||||
@RunWith(JPATestRunner.class)
|
||||
@JPAConfig("hsqldb")
|
||||
public class JPAIntegrationTest extends ParserTest {
|
||||
public class JPAIntegrationTest extends HQLExamplesTest {
|
||||
|
||||
private EntityManager entityManager;
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
package com.mysema.query;
|
||||
package com.mysema.testutil;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
@ -3,9 +3,8 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
package com.mysema.query;
|
||||
package com.mysema.testutil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Properties;
|
||||
@ -3,7 +3,7 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
package com.mysema.query;
|
||||
package com.mysema.testutil;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
@ -3,7 +3,7 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
package com.mysema.query;
|
||||
package com.mysema.testutil;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user