cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r427870 - /incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/XMLMappingAssertion.java
Date Wed, 02 Aug 2006 03:17:47 GMT
Author: aadamchik
Date: Tue Aug  1 20:17:46 2006
New Revision: 427870

URL: http://svn.apache.org/viewvc?rev=427870&view=rev
Log:
adding persistence unit defaults assertions

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/XMLMappingAssertion.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/XMLMappingAssertion.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/XMLMappingAssertion.java?rev=427870&r1=427869&r2=427870&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/XMLMappingAssertion.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/XMLMappingAssertion.java
Tue Aug  1 20:17:46 2006
@@ -24,6 +24,7 @@
 import org.apache.cayenne.jpa.map.JpaEntity;
 import org.apache.cayenne.jpa.map.JpaEntityMap;
 import org.apache.cayenne.jpa.map.JpaMappedSuperclass;
+import org.apache.cayenne.jpa.map.JpaPersistenceUnitMetadata;
 
 class XMLMappingAssertion extends MappingAssertion {
 
@@ -35,17 +36,24 @@
         assertEquals("default_package", entityMap.getPackageName());
         assertEquals("default_catalog", entityMap.getCatalog());
         assertEquals(AccessType.FIELD, entityMap.getAccess());
+        assertUnitMetadata(entityMap.getPersistenceUnitMetadata());
 
         super.testEntityMap(entityMap);
     }
 
+    protected void assertUnitMetadata(JpaPersistenceUnitMetadata md) {
+        assertNotNull(md);
+        assertNotNull(md.getPersistenceUnitDefaults());
+        assertEntityListeners(md.getPersistenceUnitDefaults().getEntityListeners());
+    }
+
     @Override
     protected void assertEntity1(JpaEntity entity1) {
         super.assertEntity1(entity1);
         assertTrue(entity1.isMetadataComplete());
         assertSame(AccessType.PROPERTY, entity1.getAccess());
     }
-    
+
     @Override
     protected void assertEntity2(JpaEntity entity2) {
         super.assertEntity2(entity2);
@@ -58,7 +66,7 @@
         assertTrue(embeddable1.isMetadataComplete());
         assertSame(AccessType.FIELD, embeddable1.getAccess());
     }
-    
+
     @Override
     protected void assertMappedSuperclass1(JpaMappedSuperclass mappedSuperclass1) {
         super.assertMappedSuperclass1(mappedSuperclass1);



Mime
View raw message