Return-Path: Delivered-To: apmail-incubator-cayenne-commits-archive@locus.apache.org Received: (qmail 43352 invoked from network); 30 Nov 2006 11:40:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Nov 2006 11:40:56 -0000 Received: (qmail 55075 invoked by uid 500); 30 Nov 2006 11:41:06 -0000 Delivered-To: apmail-incubator-cayenne-commits-archive@incubator.apache.org Received: (qmail 55052 invoked by uid 500); 30 Nov 2006 11:41:06 -0000 Mailing-List: contact cayenne-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cayenne-dev@incubator.apache.org Delivered-To: mailing list cayenne-commits@incubator.apache.org Received: (qmail 55042 invoked by uid 99); 30 Nov 2006 11:41:06 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Nov 2006 03:41:06 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Nov 2006 03:40:56 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 8841E1A9846; Thu, 30 Nov 2006 03:40:17 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r480893 - in /incubator/cayenne/main/trunk/integration-test/jpa-chapter9: .classpath src/test/java/org/apache/cayenne/jpa/itest/ch9/_9_1_18_BasicAnnotationTest.java src/test/java/org/apache/cayenne/jpa/itest/ch9/_9_1_8_IdAnnotationTest.java Date: Thu, 30 Nov 2006 11:40:16 -0000 To: cayenne-commits@incubator.apache.org From: aadamchik@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061130114017.8841E1A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: aadamchik Date: Thu Nov 30 03:40:13 2006 New Revision: 480893 URL: http://svn.apache.org/viewvc?view=rev&rev=480893 Log: CAY-713: Improved Meaningful PK support (CAY-713 accomplished + switching JPA enhancer to the new generic pojo enhancement code + uncommenting a number of JPA relationship itests that work now with the new enhancer) Modified: incubator/cayenne/main/trunk/integration-test/jpa-chapter9/.classpath incubator/cayenne/main/trunk/integration-test/jpa-chapter9/src/test/java/org/apache/cayenne/jpa/itest/ch9/_9_1_18_BasicAnnotationTest.java incubator/cayenne/main/trunk/integration-test/jpa-chapter9/src/test/java/org/apache/cayenne/jpa/itest/ch9/_9_1_8_IdAnnotationTest.java Modified: incubator/cayenne/main/trunk/integration-test/jpa-chapter9/.classpath URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-chapter9/.classpath?view=diff&rev=480893&r1=480892&r2=480893 ============================================================================== --- incubator/cayenne/main/trunk/integration-test/jpa-chapter9/.classpath (original) +++ incubator/cayenne/main/trunk/integration-test/jpa-chapter9/.classpath Thu Nov 30 03:40:13 2006 @@ -1,7 +1,7 @@ - + Modified: incubator/cayenne/main/trunk/integration-test/jpa-chapter9/src/test/java/org/apache/cayenne/jpa/itest/ch9/_9_1_18_BasicAnnotationTest.java URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-chapter9/src/test/java/org/apache/cayenne/jpa/itest/ch9/_9_1_18_BasicAnnotationTest.java?view=diff&rev=480893&r1=480892&r2=480893 ============================================================================== --- incubator/cayenne/main/trunk/integration-test/jpa-chapter9/src/test/java/org/apache/cayenne/jpa/itest/ch9/_9_1_18_BasicAnnotationTest.java (original) +++ incubator/cayenne/main/trunk/integration-test/jpa-chapter9/src/test/java/org/apache/cayenne/jpa/itest/ch9/_9_1_18_BasicAnnotationTest.java Thu Nov 30 03:40:13 2006 @@ -64,7 +64,7 @@ }); BasicEntity o1 = getEntityManager().find(BasicEntity.class, 3); - // application may or may not support lazy loading, but when the procerty is + // application may or may not support lazy loading, but when the property is // accessed via getter, it must get resolved one way or another... assertEquals("c", o1.getBasicLazy()); } Modified: incubator/cayenne/main/trunk/integration-test/jpa-chapter9/src/test/java/org/apache/cayenne/jpa/itest/ch9/_9_1_8_IdAnnotationTest.java URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-chapter9/src/test/java/org/apache/cayenne/jpa/itest/ch9/_9_1_8_IdAnnotationTest.java?view=diff&rev=480893&r1=480892&r2=480893 ============================================================================== --- incubator/cayenne/main/trunk/integration-test/jpa-chapter9/src/test/java/org/apache/cayenne/jpa/itest/ch9/_9_1_8_IdAnnotationTest.java (original) +++ incubator/cayenne/main/trunk/integration-test/jpa-chapter9/src/test/java/org/apache/cayenne/jpa/itest/ch9/_9_1_8_IdAnnotationTest.java Thu Nov 30 03:40:13 2006 @@ -24,62 +24,74 @@ public class _9_1_8_IdAnnotationTest extends EntityManagerCase { - // needed, since all real tests are disabled - public void testDummy() { + public void testUserProvidedId() throws Exception { + getDbHelper().deleteAll("IdEntity"); - } + IdEntity o1 = new IdEntity(); + o1.setIdValue(15); - // TODO: andrus, 9/10/2006 - fails - public void _testUserProvidedId() throws Exception { - getDbHelper().deleteAll("IdEntity"); + getEntityManager().persist(o1); + getEntityManager().getTransaction().commit(); - IdEntity o1 = new IdEntity(); - o1.setIdValue(15); + assertEquals(15, getDbHelper().getInt("IdEntity", "id")); + assertEquals(15, o1.getIdValue()); + } - getEntityManager().persist(o1); - getEntityManager().getTransaction().commit(); + public void testGeneratedId() throws Exception { + getDbHelper().deleteAll("IdEntity"); - assertEquals(15, getDbHelper().getInt("IdEntity", "id")); - assertEquals(15, o1.getIdValue()); - } + IdEntity o1 = new IdEntity(); - // TODO: andrus, 9/10/2006 - fails - public void _testGeneratedId() throws Exception { - getDbHelper().deleteAll("IdEntity"); + getEntityManager().persist(o1); + getEntityManager().getTransaction().commit(); - IdEntity o1 = new IdEntity(); + assertTrue(getDbHelper().getInt("IdEntity", "id") > 0); + assertTrue(o1.getIdValue() > 0); + } - getEntityManager().persist(o1); - getEntityManager().getTransaction().commit(); + public void testUserProvidedIdColumnAnnotation() throws Exception { + getDbHelper().deleteAll("IdColumnEntity"); - assertTrue(getDbHelper().getInt("IdEntity", "id") > 0); - assertTrue(o1.getIdValue() > 0); - } + IdColumnEntity o1 = new IdColumnEntity(); + o1.setIdValue(15); - // TODO: andrus, 9/10/2006 - fails - public void _testUserProvidedIdColumnAnnotation() throws Exception { - getDbHelper().deleteAll("IdColumnEntity"); + getEntityManager().persist(o1); + getEntityManager().getTransaction().commit(); - IdColumnEntity o1 = new IdColumnEntity(); - o1.setIdValue(15); + assertEquals(15, getDbHelper().getInt("IdColumnEntity", "idcolumn")); + assertEquals(15, o1.getIdValue()); + } - getEntityManager().persist(o1); - getEntityManager().getTransaction().commit(); + public void testGeneratedIdColumnAnnotation() throws Exception { + getDbHelper().deleteAll("IdColumnEntity"); - assertEquals(15, getDbHelper().getInt("IdColumnEntity", "idcolumn")); - assertEquals(15, o1.getIdValue()); - } + IdColumnEntity o1 = new IdColumnEntity(); - // TODO: andrus, 9/10/2006 - fails - public void _testGeneratedIdColumnAnnotation() throws Exception { - getDbHelper().deleteAll("IdColumnEntity"); + getEntityManager().persist(o1); + getEntityManager().getTransaction().commit(); - IdColumnEntity o1 = new IdColumnEntity(); + assertTrue(getDbHelper().getInt("IdColumnEntity", "idcolumn") > 0); + assertTrue(o1.getIdValue() > 0); + } - getEntityManager().persist(o1); - getEntityManager().getTransaction().commit(); + public void testFind() throws Exception { + getDbHelper().deleteAll("IdEntity"); - assertTrue(getDbHelper().getInt("IdColumnEntity", "idcolumn") > 0); - assertTrue(o1.getIdValue() > 0); - } + getDbHelper().insert("IdEntity", new String[] { + "id", + }, new Object[] { + 25 + }); + + assertNull(getEntityManager().find(IdEntity.class, new Integer(14))); + + IdEntity o1 = (IdEntity) getEntityManager().find(IdEntity.class, new Integer(25)); + assertNotNull(o1); + assertEquals(25, o1.getIdValue()); + + assertNull(getEntityManager().find(IdEntity.class, new Integer(16))); + + IdEntity o2 = (IdEntity) getEntityManager().find(IdEntity.class, new Integer(25)); + assertSame(o1, o2); + } }