From 50d9c31265db6cbcfd61c528b37e081a9bb09292 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Wed, 9 Nov 2011 18:55:54 +0000 Subject: [PATCH] [#913] NoClassDefFoundError in JooqUtil.isJPAAvailable() --- .../test/util/maven/TestGeneratedSources.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/jOOQ-codegen-maven-example/src/test/java/org/jooq/test/util/maven/TestGeneratedSources.java b/jOOQ-codegen-maven-example/src/test/java/org/jooq/test/util/maven/TestGeneratedSources.java index fff1bd2dcd..5ec4cdc662 100644 --- a/jOOQ-codegen-maven-example/src/test/java/org/jooq/test/util/maven/TestGeneratedSources.java +++ b/jOOQ-codegen-maven-example/src/test/java/org/jooq/test/util/maven/TestGeneratedSources.java @@ -46,6 +46,7 @@ import org.jooq.Record; import org.jooq.Result; import org.jooq.util.maven.example.PublicFactory; import org.jooq.util.maven.example.tables.TBook; +import org.jooq.util.maven.example.tables.records.TBookRecord; import org.junit.Test; @@ -58,7 +59,7 @@ public class TestGeneratedSources { private static final List BOOK_TITLES = Arrays.asList("1984", "Animal Farm", "O Alquimista", "Brida"); @Test - public void run() throws Exception { + public void testFetch() throws Exception { Connection connection = DriverManager.getConnection("jdbc:postgresql:postgres", "postgres", "test"); PublicFactory create = new PublicFactory(connection); @@ -71,4 +72,21 @@ public class TestGeneratedSources { assertEquals(BOOK_IDS, books.getValues(0)); assertEquals(BOOK_TITLES, books.getValues(1)); } + + @Test + public void testFetchInto() throws Exception { + Connection connection = DriverManager.getConnection("jdbc:postgresql:postgres", "postgres", "test"); + PublicFactory create = new PublicFactory(connection); + + List books = + create.select(TBook.ID, TBook.TITLE) + .from(TBook.T_BOOK) + .orderBy(TBook.ID) + .fetchInto(TBookRecord.class); + + for (int i = 0; i < BOOK_IDS.size(); i++) { + assertEquals(BOOK_IDS.get(i), books.get(i).getId()); + assertEquals(BOOK_TITLES.get(i), books.get(i).getTitle()); + } + } }