openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1491915 - in /openjpa/trunk: ./ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/jointable/onetomany/
Date Tue, 11 Jun 2013 19:23:05 GMT
Author: hthomann
Date: Tue Jun 11 19:23:05 2013
New Revision: 1491915

URL: http://svn.apache.org/r1491915
Log:
OPENJPA-2373: Made updates to the test created for this JIRA.

Modified:
    openjpa/trunk/   (props changed)
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/PartPK.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/jointable/onetomany/TestMapsIdWithAutoGeneratedKey.java

Propchange: openjpa/trunk/
------------------------------------------------------------------------------
  Merged /openjpa/branches/2.2.x:r1485013
  Merged /openjpa/branches/2.1.x:r1485010

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/PartPK.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/PartPK.java?rev=1491915&r1=1491914&r2=1491915&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/PartPK.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/PartPK.java
Tue Jun 11 19:23:05 2013
@@ -26,11 +26,11 @@ import javax.persistence.Embeddable;
 public class PartPK implements Serializable {
     /*Textile Id*/
 
-    @Column(name="ID_TXE", length=4)
+    @Column(name="ID_TXE")
     private Integer textileId;
 
     /*Part Number*/
-    @Column(name="NU_PT", length=4)
+    @Column(name="NU_PT")
     private Integer partNumber;
 
     public PartPK() {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/jointable/onetomany/TestMapsIdWithAutoGeneratedKey.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/jointable/onetomany/TestMapsIdWithAutoGeneratedKey.java?rev=1491915&r1=1491914&r2=1491915&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/jointable/onetomany/TestMapsIdWithAutoGeneratedKey.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/jointable/onetomany/TestMapsIdWithAutoGeneratedKey.java
Tue Jun 11 19:23:05 2013
@@ -19,10 +19,13 @@
 package org.apache.openjpa.persistence.inheritance.jointable.onetomany;
 
 
-import javax.naming.NamingException;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityTransaction;
 
+import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
+import org.apache.openjpa.jdbc.sql.DB2Dictionary;
+import org.apache.openjpa.jdbc.sql.DBDictionary;
+import org.apache.openjpa.jdbc.sql.DerbyDictionary;
 import org.apache.openjpa.persistence.common.apps.Part;
 import org.apache.openjpa.persistence.common.apps.PartPK;
 import org.apache.openjpa.persistence.common.apps.Shirt;
@@ -62,15 +65,26 @@ import org.apache.openjpa.persistence.te
  *
  */
 public class TestMapsIdWithAutoGeneratedKey extends SingleEMFTestCase {
+    boolean disabled = true;
+    
     public void setUp() {
         super.setUp(DROP_TABLES, 
         	Textile.class, TextilePK.class,
         	Shirt.class, Trousers.class,
         	Part.class, PartPK.class);
+        
+        DBDictionary dic = ((JDBCConfiguration)emf.getConfiguration()).getDBDictionaryInstance();
+        if (dic.supportsAutoAssign && (dic instanceof DB2Dictionary || dic instanceof
DerbyDictionary)) {
+            disabled = false;
+        }
     }
 
 
-    public void testPersistShirtWithPart() throws NamingException {
+    public void testPersistShirtWithPart() {
+        if (disabled) {
+            return;
+        }
+        
         EntityManager em = emf.createEntityManager();
         EntityTransaction tx = em.getTransaction();
         int nPart = 3;



Mime
View raw message