From 662837154fc0701e3f4e2dff534820154006754e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Westk=C3=A4mper?= Date: Wed, 30 Apr 2014 11:08:27 +0300 Subject: [PATCH] Fix JDO test --- .../com/mysema/query/jdo/JDOSQLQueryTest.java | 17 +++++-------- .../query/jdo/test/domain/sql/SProduct.java | 25 +++++++++++++------ 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/querydsl-jdo/src/test/java/com/mysema/query/jdo/JDOSQLQueryTest.java b/querydsl-jdo/src/test/java/com/mysema/query/jdo/JDOSQLQueryTest.java index dcf5bc2cc..8efdd20c9 100644 --- a/querydsl-jdo/src/test/java/com/mysema/query/jdo/JDOSQLQueryTest.java +++ b/querydsl-jdo/src/test/java/com/mysema/query/jdo/JDOSQLQueryTest.java @@ -13,19 +13,10 @@ */ package com.mysema.query.jdo; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; - -import java.sql.SQLException; -import java.util.List; - import javax.jdo.PersistenceManager; import javax.jdo.Transaction; - -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; +import java.sql.SQLException; +import java.util.List; import com.mysema.query.NonUniqueResultException; import com.mysema.query.SearchResults; @@ -40,6 +31,10 @@ import com.mysema.query.types.ConstructorExpression; import com.mysema.query.types.Expression; import com.mysema.query.types.SubQueryExpression; import com.mysema.query.types.expr.BooleanExpression; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import static org.junit.Assert.*; public class JDOSQLQueryTest extends AbstractJDOTest{ diff --git a/querydsl-jdo/src/test/java/com/mysema/query/jdo/test/domain/sql/SProduct.java b/querydsl-jdo/src/test/java/com/mysema/query/jdo/test/domain/sql/SProduct.java index c3c161e46..1f3023b0a 100644 --- a/querydsl-jdo/src/test/java/com/mysema/query/jdo/test/domain/sql/SProduct.java +++ b/querydsl-jdo/src/test/java/com/mysema/query/jdo/test/domain/sql/SProduct.java @@ -13,18 +13,13 @@ */ package com.mysema.query.jdo.test.domain.sql; -import static com.mysema.query.types.PathMetadataFactory.forVariable; - +import com.mysema.query.sql.ColumnMetadata; import com.mysema.query.sql.ForeignKey; import com.mysema.query.sql.PrimaryKey; import com.mysema.query.sql.RelationalPathBase; import com.mysema.query.types.PathMetadata; -import com.mysema.query.types.path.BeanPath; -import com.mysema.query.types.path.DatePath; -import com.mysema.query.types.path.DateTimePath; -import com.mysema.query.types.path.NumberPath; -import com.mysema.query.types.path.StringPath; -import com.mysema.query.types.path.TimePath; +import com.mysema.query.types.path.*; +import static com.mysema.query.types.PathMetadataFactory.forVariable; /** @@ -63,14 +58,28 @@ public class SProduct extends RelationalPathBase { public SProduct(String variable) { super(SProduct.class, forVariable(variable), null, "PRODUCT"); + addMetadata(); } public SProduct(BeanPath entity) { super(entity.getType(),entity.getMetadata(), null, "PRODUCT"); + addMetadata(); } public SProduct(PathMetadata metadata) { super(SProduct.class, metadata, null, "PRODUCT"); + addMetadata(); + } + + public void addMetadata() { + addMetadata(amount, ColumnMetadata.named("AMOUNT")); + addMetadata(datefield, ColumnMetadata.named("DATEFIELD")); + addMetadata(description, ColumnMetadata.named("DESCRIPTION")); + addMetadata(name, ColumnMetadata.named("NAME")); + addMetadata(price, ColumnMetadata.named("PRICE")); + addMetadata(productId, ColumnMetadata.named("PRODUCT_ID")); + addMetadata(publicationdate, ColumnMetadata.named("PUBLICATIONDATE")); + addMetadata(timefield, ColumnMetadata.named("TIMEFIELD")); } }