openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r1197994 [8/10] - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-jdbc/src/main/java/org/...
Date Sat, 05 Nov 2011 17:17:33 GMT
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/TestMappingToolTemporal.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/TestMappingToolTemporal.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/TestMappingToolTemporal.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/TestMappingToolTemporal.java Sat Nov  5 17:17:26 2011
@@ -36,7 +36,8 @@ public class TestMappingToolTemporal ext
         ClassMapping mapping = (ClassMapping)
             ((OpenJPAEntityManagerFactorySPI) OpenJPAPersistence.cast(emf))
                 .getConfiguration().getMetaDataRepositoryInstance()
-                .getMetaData("TemporalFieldTypes", true);
+                .getMetaData("TemporalFieldTypes", getClass().getClassLoader(),
+                        true);
 
         assertEquals(java.sql.Types.TIMESTAMP, mapping.getFieldMapping(
                "dateDefaultField").getValueMapping().getColumns()[0].getType());

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestDynamicClassRegistration.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestDynamicClassRegistration.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestDynamicClassRegistration.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestDynamicClassRegistration.java Sat Nov  5 17:17:26 2011
@@ -73,8 +73,8 @@ public class TestDynamicClassRegistratio
         // trigger class initialization
         ManagedClassSubclasser.prepareUnenhancedClasses(
             emf1.getConfiguration(),
-            Collections.singleton(UnenhancedFieldAccess.class)
-            );
+            Collections.singleton(UnenhancedFieldAccess.class),
+            null);
 
         ClassMetaData meta =
             JPAFacadeHelper.getMetaData(emf1, UnenhancedFieldAccess.class);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/lib/conf/TestAnchorParsing.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/lib/conf/TestAnchorParsing.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/lib/conf/TestAnchorParsing.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/lib/conf/TestAnchorParsing.java Sat Nov  5 17:17:26 2011
@@ -70,12 +70,16 @@ public class TestAnchorParsing extends T
     public void testProductDerivationsLoadResource() {
         ProductDerivations.load(
             "org/apache/openjpa/lib/conf/product-derivations-load.xml",
-            "foo");
+            "foo", null);
 
-        ProductDerivations.load("org/apache/openjpa/lib/conf/product-derivations-load.xml", null);
+        ProductDerivations.load(
+            "org/apache/openjpa/lib/conf/product-derivations-load.xml",
+            null, null);
 
         try {
-            ProductDerivations.load("org/apache/openjpa/lib/conf/product-derivations-load.xml", "nonexistant");
+            ProductDerivations.load(
+                "org/apache/openjpa/lib/conf/product-derivations-load.xml",
+                "nonexistant", null);
             fail("pu 'nonexistant' does not exist");
         } catch (MissingResourceException mre) {
             // expected
@@ -84,7 +88,7 @@ public class TestAnchorParsing extends T
         try {
             ProductDerivations.load(
                 "org/apache/openjpa/lib/conf/product-derivations-load.xml",
-                "");
+                "", null);
             fail("pu '' does not exist");
         } catch (MissingResourceException mre) {
             // expected
@@ -93,7 +97,7 @@ public class TestAnchorParsing extends T
 
     public void testNonexistantResourceLoad() {
         try {
-            ProductDerivations.load("nonexistant-resource", null);
+            ProductDerivations.load("nonexistant-resource", null, null);
             fail("resource 'nonexistant-resource' should not exist");
         } catch (MissingResourceException e) {
             // expected
@@ -104,19 +108,19 @@ public class TestAnchorParsing extends T
         File validFile = resourceToTemporaryFile(
             "org/apache/openjpa/lib/conf/product-derivations-load.xml");
 
-        ProductDerivations.load(validFile, "foo");
+        ProductDerivations.load(validFile, "foo", null);
 
-        ProductDerivations.load(validFile, null);
+        ProductDerivations.load(validFile, null, null);
 
         try {
-            ProductDerivations.load(validFile, "nonexistant");
+            ProductDerivations.load(validFile, "nonexistant", null);
             fail("pu 'nonexistant' does not exist");
         } catch (MissingResourceException mre) {
             // expected
         }
 
         try {
-            ProductDerivations.load(validFile, "");
+            ProductDerivations.load(validFile, "", null);
             fail("pu '' does not exist");
         } catch (MissingResourceException mre) {
             // expected
@@ -128,7 +132,7 @@ public class TestAnchorParsing extends T
         File f = new File("this-should-not-exist");
         assertFalse(f.exists());
         try {
-            ProductDerivations.load(f, null);
+            ProductDerivations.load(f, null, null);
             fail(f.getName() + " does not exist");
         } catch (MissingResourceException e) {
             // expected

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/TestExplicitAccess.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/TestExplicitAccess.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/TestExplicitAccess.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/TestExplicitAccess.java Sat Nov  5 17:17:26 2011
@@ -944,7 +944,7 @@ public class TestExplicitAccess extends 
             em.getConfiguration().getMetaDataRepositoryInstance();
         
         ClassMetaData cmd = mdr.getMetaData(PropAccessFieldStratsEntity.class, 
-            true);
+            null, true);
         // Assert expected persistent fields and properties were created
         assertNotNull(cmd.getField("embedId"));
         assertNotNull(cmd.getField("m2one"));
@@ -1035,7 +1035,8 @@ public class TestExplicitAccess extends 
         MetaDataRepository mdr = 
             em.getConfiguration().getMetaDataRepositoryInstance();
         
-        ClassMetaData cmd = mdr.getMetaData(FieldAccessPropStratsEntity.class, true);
+        ClassMetaData cmd = mdr.getMetaData(FieldAccessPropStratsEntity.class, 
+            null, true);
         // Assert expected persistent fields and properties were created
         assertNotNull(cmd.getField("eid"));
         assertNotNull(cmd.getField("elementCollection"));

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestVersion.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestVersion.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestVersion.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/TestVersion.java Sat Nov  5 17:17:26 2011
@@ -229,7 +229,8 @@ public class TestVersion extends Annotat
            ClassMapping cls =
                    ((JDBCConfigurationImpl) ((OpenJPAEntityManagerSPI)
                    OpenJPAPersistence.cast(pm)).getConfiguration())
-                   .getMappingRepositoryInstance().getMapping(EmbedOwner.class, true);
+                   .getMappingRepositoryInstance().getMapping(EmbedOwner.class,
+                           null, true);
            assertEquals(NoneVersionStrategy.getInstance(),
                    cls.getVersion().getStrategy()); assertEquals(0,
                            cls.getVersion().getColumns().length);
@@ -242,7 +243,8 @@ public class TestVersion extends Annotat
                (OpenJPAEntityManager) currentEntityManager();
            ClassMapping cls = ((JDBCConfigurationImpl)((OpenJPAEntityManagerSPI)
                    OpenJPAPersistence.cast(pm)).getConfiguration())
-                   .getMappingRepositoryInstance().getMapping(AnnoTest1.class, true);
+                   .getMappingRepositoryInstance().getMapping(AnnoTest1.class,
+                           null, true);
 		   assertTrue(NoneVersionStrategy.getInstance() !=
 			   cls.getVersion().getStrategy()); assertEquals(1,
                        cls.getVersion().getColumns().length);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/xml/TestMetaDataComplete.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/xml/TestMetaDataComplete.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/xml/TestMetaDataComplete.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/xml/TestMetaDataComplete.java Sat Nov  5 17:17:26 2011
@@ -58,10 +58,10 @@ public class TestMetaDataComplete extend
 			MetaDataRepository repos = oemf.getConfiguration()
 					.getMetaDataRepositoryInstance();
 
-			entityA = repos.getMetaData(EntityA.class, true);
-			entityB = repos.getMetaData(EntityB.class, true);
-            derivedA = repos.getMetaData(DerivedA.class, true);
-            derivedB = repos.getMetaData(DerivedB.class, true);
+			entityA = repos.getMetaData(EntityA.class, null, true);
+			entityB = repos.getMetaData(EntityB.class, null, true);
+            derivedA = repos.getMetaData(DerivedA.class, null, true);
+            derivedB = repos.getMetaData(DerivedB.class, null, true);
 		}
 	}
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheModeTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheModeTestCase.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheModeTestCase.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheModeTestCase.java Sat Nov  5 17:17:26 2011
@@ -451,7 +451,7 @@ public abstract class AbstractCacheModeT
     private String getAlias(Class<?> cls) {
         ClassMapping mapping =
             (ClassMapping) getEntityManagerFactory().getConfiguration().getMetaDataRepositoryInstance().getMetaData(
-                cls, true);
+                cls, null, true);
         return mapping.getTypeAlias();
     }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/TestCacheModeInvalid.java Sat Nov  5 17:17:26 2011
@@ -38,11 +38,13 @@ public class TestCacheModeInvalid extend
                 "openjpa.jdbc.JDBCListeners", new JDBCListener [] { getListener() });
             emf = (OpenJPAEntityManagerFactorySPI) OpenJPAPersistence.createEntityManagerFactory("cache-mode-invalid",
                 "META-INF/caching-persistence-invalid.xml", propertiesMap );
-            fail("Expected SAX parse error for invalid entry");
         } catch (Throwable e) {
+            exceptionCaught = true;
+            assertException(e, org.apache.openjpa.util.GeneralException.class);
             String msg = e.getMessage();
             assertTrue(msg.contains("org.xml.sax.SAXException"));
         }
+        assertTrue(exceptionCaught);
     }
 
     @Override

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/compat/TestEmbeddableSuperclass.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/compat/TestEmbeddableSuperclass.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/compat/TestEmbeddableSuperclass.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/compat/TestEmbeddableSuperclass.java Sat Nov  5 17:17:26 2011
@@ -64,7 +64,7 @@ public class TestEmbeddableSuperclass
     public void testRelationMappings() {
         JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
         ClassMapping cls = conf.getMappingRepositoryInstance().
-            getMapping(EmbeddableSuperSub.class, true);
+            getMapping(EmbeddableSuperSub.class, null, true);
         FieldMapping fm = cls.getFieldMapping("sub");
         assertTrue(fm.getStrategy() instanceof RelationFieldStrategy);
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/CacheTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/CacheTest.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/CacheTest.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/CacheTest.java Sat Nov  5 17:17:26 2011
@@ -384,14 +384,17 @@ public abstract class CacheTest extends 
         DataCache cache = cacheManager(factory).getSystemDataCache();
         assertEquals(defaultCache, cache);
 
-        ClassMetaData aMeta = repos.getMetaData(CacheObjectA.class, true);
-        ClassMetaData aChild1Meta = repos.getMetaData(CacheObjectAChild1.class, true);
-        ClassMetaData aChild2Meta = repos.getMetaData(CacheObjectAChild2.class, true);
-        ClassMetaData bMeta = repos.getMetaData(CacheObjectB.class, true);
-        ClassMetaData bChild1Meta = repos.getMetaData(CacheObjectBChild1.class, true);
-        ClassMetaData cMeta = repos.getMetaData(CacheObjectC.class, true);
-        ClassMetaData dMeta = repos.getMetaData(CacheObjectD.class, true);
-        ClassMetaData eMeta = repos.getMetaData(CacheObjectE.class, true);
+        ClassMetaData aMeta = repos.getMetaData(CacheObjectA.class, null, true);
+        ClassMetaData aChild1Meta = repos.getMetaData(CacheObjectAChild1.class,
+            null, true);
+        ClassMetaData aChild2Meta = repos.getMetaData(CacheObjectAChild2.class,
+            null, true);
+        ClassMetaData bMeta = repos.getMetaData(CacheObjectB.class, null, true);
+        ClassMetaData bChild1Meta = repos.getMetaData(CacheObjectBChild1.class,
+            null, true);
+        ClassMetaData cMeta = repos.getMetaData(CacheObjectC.class, null, true);
+        ClassMetaData dMeta = repos.getMetaData(CacheObjectD.class, null, true);
+        ClassMetaData eMeta = repos.getMetaData(CacheObjectE.class, null, true);
 
         cache = aMeta.getDataCache();
         assertEquals(defaultCache, cache);
@@ -457,7 +460,7 @@ public abstract class CacheTest extends 
         Object relationOid = em.getObjectId(a.getRelatedObject());
         relationOid = new Id(CacheObjectA.class, relationOid.toString());
 
-        ClassMetaData meta = repos.getMetaData(CacheObjectA.class, true);
+        ClassMetaData meta = repos.getMetaData(CacheObjectA.class, null, true);
         DataCache cache = meta.getDataCache();
 
         // drop the related data from the cache
@@ -909,7 +912,7 @@ public abstract class CacheTest extends 
                 ((((OpenJPAEntityManagerFactorySPI) factory2))
                 .getConfiguration()).getMetaDataRepositoryInstance();
             ClassMetaData meta = repos2
-                .getMetaData(CacheObjectA.class, true);
+                .getMetaData(CacheObjectA.class, em2.getClassLoader(), true);
             cache = meta.getDataCache();
             assertTrue(cache.contains(oidwithclass));
 
@@ -1619,7 +1622,8 @@ public abstract class CacheTest extends 
             ClassMetaData meta =
                 ((OpenJPAEntityManagerFactorySPI) OpenJPAPersistence
                     .cast(factory)).getConfiguration()
-                    .getMetaDataRepositoryInstance().getMetaData(a.getClass(), false);
+                    .getMetaDataRepositoryInstance().getMetaData(a.getClass(),
+                    null, false);
             FieldMetaData fmd = meta.getField("date");
             d = (Date) data.getData(fmd.getIndex());
             Broker broker = JPAFacadeHelper.toBroker(em1);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestPartitionedDataCache.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestPartitionedDataCache.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestPartitionedDataCache.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestPartitionedDataCache.java Sat Nov  5 17:17:26 2011
@@ -53,16 +53,7 @@ public class TestPartitionedDataCache ex
         } catch (UserException e) {
             System.err.println(e);
         }
-        
-    }
-    
-    /**
-     * This test will not run because of Configuration is not assigned
-     * if a cache is directly instantiated in a test.
-     */
-    public void xtestMisConfiguration() {
-        PartitionedDataCache cache = new PartitionedDataCache();
-        String badProperty = "(cacheSize=100),(name=b,cacheSize=200)";// missing name
+        badProperty = "(cacheSize=100),(name=b,cacheSize=200)";// missing name
         try {
             cache.setPartitions(badProperty);
             fail("Expected parse error on " + badProperty);
@@ -83,6 +74,7 @@ public class TestPartitionedDataCache ex
         } catch (UserException e) {
             System.err.println(e);
         }
+        
     }
     
     public void testPolicyConfiguration() {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/stats/TestStatistics.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/stats/TestStatistics.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/stats/TestStatistics.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/stats/TestStatistics.java Sat Nov  5 17:17:26 2011
@@ -48,7 +48,7 @@ public class TestStatistics extends Sing
 
 	void startCaching(Class<?> cls) {
 		ClassMetaData meta = emf.getConfiguration()
-                .getMetaDataRepositoryInstance().getMetaData(cls, true);
+                .getMetaDataRepositoryInstance().getMetaData(cls, null, true);
 		meta.setDataCacheName(DataCache.NAME_DEFAULT);
 	}
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/TestDynamicSchemas.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/TestDynamicSchemas.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/TestDynamicSchemas.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/TestDynamicSchemas.java Sat Nov  5 17:17:26 2011
@@ -197,14 +197,16 @@ public class TestDynamicSchemas extends 
         DBDictionary dict = conf.getDBDictionaryInstance();
         ClassMapping mapping =  (ClassMapping)conf.
             getMetaDataRepositoryInstance().
-            getMetaData(EntityVeryLongNames.class, true);
+            getMetaData(EntityVeryLongNames.class,getClass().
+                getClassLoader(), true);
         Table table = mapping.getTable();
         assertTrue(table.getName().length() > 0);
         assertTrue(table.getName().length() <= dict.maxTableNameLength);
         validateColumnNames(table, dict);
         mapping =  (ClassMapping)conf.
             getMetaDataRepositoryInstance().
-            getMetaData(EntityReservedWords.class, true);
+            getMetaData(EntityReservedWords.class,getClass().
+                getClassLoader(), true);
         table = mapping.getTable();
         assertTrue(table.getName().length() > 0);
         assertTrue(table.getName().length() <= dict.maxTableNameLength);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddable.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddable.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddable.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddable.java Sat Nov  5 17:17:26 2011
@@ -2828,7 +2828,8 @@ public class TestEmbeddable extends SQLL
             conf, 
             new String[] { "org.apache.openjpa.persistence.embed.Book" },
             flags,
-            conf.getClassLoader());        
+            conf.getClassResolverInstance().
+            getClassLoader(MappingTool.class, null));        
     }
 
     /*

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestNoNoArgs.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestNoNoArgs.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestNoNoArgs.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestNoNoArgs.java Sat Nov  5 17:17:26 2011
@@ -33,6 +33,7 @@ public class TestNoNoArgs
 
     OpenJPAConfiguration conf;
     MetaDataRepository repos;
+    ClassLoader loader;
     private PCEnhancer.Flags flags = new PCEnhancer.Flags();
 
     public TestNoNoArgs(String s) {
@@ -40,14 +41,19 @@ public class TestNoNoArgs
     }
 
     public void setUp() {
-        OpenJPAEntityManager em = (OpenJPAEntityManager) currentEntityManager();
+        OpenJPAEntityManager em =
+            (OpenJPAEntityManager) currentEntityManager();
         conf = ((OpenJPAEntityManagerSPI) em).getConfiguration();
         repos = conf.newMetaDataRepositoryInstance();
+        loader = em.getClassLoader();
         endEm(em);
     }
 
-    public void testNoNoArgs() throws IOException {
-        PCEnhancer.run((OpenJPAConfiguration) conf, new String[]{ }, flags, repos, null);
+    public void testNoNoArgs()
+        throws IOException {
+        PCEnhancer.run((OpenJPAConfiguration) conf,
+            new String[]{ },
+            flags, repos, null, loader);
     }
 
     public void testNo2NoArgs()
@@ -55,7 +61,8 @@ public class TestNoNoArgs
         flags.addDefaultConstructor = false;
         boolean caughtException = false;
         try {
-            PCEnhancer.run((OpenJPAConfiguration) conf, new String[]{ },  flags, repos, null);
+            PCEnhancer.run((OpenJPAConfiguration) conf, new String[]{ },
+                flags, repos, null, loader);
         } catch (OpenJPAException e) {
             caughtException = true;
         }
@@ -65,6 +72,7 @@ public class TestNoNoArgs
     public void testNo3NoArgs()
         throws IOException {
         PCEnhancer.run((OpenJPAConfiguration) conf,
-            new String[]{ "persistence.enhance.common.apps.Entity1" }, flags, repos, null);
+            new String[]{ "persistence.enhance.common.apps.Entity1" },
+            flags, repos, null, loader);
     }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestSubclassedBehavior.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestSubclassedBehavior.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestSubclassedBehavior.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestSubclassedBehavior.java Sat Nov  5 17:17:26 2011
@@ -541,7 +541,7 @@ public class TestSubclassedBehavior exte
         // registry-parsing code.
         ClassMetaData meta = getConfiguration()
             .getMetaDataRepositoryInstance().
-            getMetaData(DerivedEntity.class, false);
+            getMetaData(DerivedEntity.class, null, false);
         assertTrue("meta's access should be ACCESS_PROPERTY",
         		AccessCode.isProperty(meta.getAccessType()));
         FieldMetaData[] fmds = meta.getFields();

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestLifecycleEventManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestLifecycleEventManager.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestLifecycleEventManager.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestLifecycleEventManager.java Sat Nov  5 17:17:26 2011
@@ -52,7 +52,7 @@ public class TestLifecycleEventManager
                 OpenJPAPersistence.createEntityManagerFactory("TestConv2", "")))
                 .
                     getConfiguration().getMetaDataRepositoryInstance();
-        ClassMetaData meta = repos.getMetaData(RuntimeTest2.class, true);
+        ClassMetaData meta = repos.getMetaData(RuntimeTest2.class, null, true);
         LifecycleEventManager mgr = new LifecycleEventManager();
         RuntimeTest2 pc = new RuntimeTest2();
         Listener listener = new Listener();
@@ -126,7 +126,7 @@ public class TestLifecycleEventManager
                 OpenJPAPersistence.createEntityManagerFactory("TestConv2", "")))
                 .
                     getConfiguration().getMetaDataRepositoryInstance();
-        ClassMetaData meta = repos.getMetaData(RuntimeTest2.class, true);
+        ClassMetaData meta = repos.getMetaData(RuntimeTest2.class, null, true);
 
         LifecycleEventManager mgr = new LifecycleEventManager();
         RuntimeTest2 pc = new RuntimeTest2();

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestTableGeneratorMultithreaded.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestTableGeneratorMultithreaded.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestTableGeneratorMultithreaded.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestTableGeneratorMultithreaded.java Sat Nov  5 17:17:26 2011
@@ -43,8 +43,8 @@ public class TestTableGeneratorMultithre
         ClassLoader loader = Thread.currentThread().getContextClassLoader();
         MetaDataRepository repo = emf.getConfiguration().getMetaDataRepositoryInstance();
         // Initialize MetaData
-        repo.getMetaData(Dog.class, true);
-        repo.getSequenceMetaData("Dog_Gen", true);
+        repo.getMetaData(Dog.class, loader, true);
+        repo.getSequenceMetaData("Dog_Gen", loader, true);
 
     }
 
@@ -82,14 +82,15 @@ public class TestTableGeneratorMultithre
         }
 
         public void run() {
-            SequenceMetaData meta = _repo.getSequenceMetaData("Dog_Gen", true);
+            ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
+            SequenceMetaData meta = _repo.getSequenceMetaData("Dog_Gen", contextLoader, true);
             meta.setInitialValue(1);
             meta.setIncrement(10000);
             _em = (EntityManagerImpl) emf.createEntityManager();
             _ctx = (StoreContext) _em.getBroker();
-            _cmd = _repo.getMetaData(Dog.class, true);
+            _cmd = _repo.getMetaData(Dog.class, contextLoader, true);
 
-            _seq = (TableJDBCSeq) meta.getInstance();
+            _seq = (TableJDBCSeq) meta.getInstance(contextLoader);
             // Change defaults so this test doesn't take so long to run.
             _seq.setAllocate(ALLOC_SIZE);
             _seq.setInitialValue(1);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/graph/TestPersistentGraph.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/graph/TestPersistentGraph.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/graph/TestPersistentGraph.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/graph/TestPersistentGraph.java Sat Nov  5 17:17:26 2011
@@ -111,7 +111,7 @@ public class TestPersistentGraph extends
     FieldMapping getFieldMapping(Class<?> pcClass, String field) {
         MappingRepository repos = (MappingRepository) emf.getConfiguration()
                 .getMetaDataRepositoryInstance();
-        ClassMapping cmd = repos.getMapping(pcClass, true);
+        ClassMapping cmd = repos.getMapping(pcClass, null, true);
         assertNotNull("No metadata found for " + pcClass, cmd);
         FieldMapping fmd = cmd.getFieldMapping(field);
         assertNotNull("No metadata found for " + pcClass.getName() + "." + field + " Fields are "
@@ -150,8 +150,8 @@ public class TestPersistentGraph extends
 
     FieldStrategy getStrategy(Class<?> cls, String field) {
         MetaDataRepository repos = emf.getConfiguration().getMetaDataRepositoryInstance();
-        ClassMetaData cmd = repos.getMetaData(cls, true);
-        assertNotNull("No metadata found for " + cls, cmd);
+        ClassMetaData cmd = repos.getMetaData(cls, null, true);
+        assertNotNull("No metadat found for " + cls, cmd);
         FieldMetaData fmd = cmd.getField(field);
         assertNotNull("No metadata found for " + cls.getName() + "." + field + " Fields are "
                 + Arrays.toString(cmd.getFieldNames()), fmd);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/TestSharedUnqualifiedClassNames.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/TestSharedUnqualifiedClassNames.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/TestSharedUnqualifiedClassNames.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/TestSharedUnqualifiedClassNames.java Sat Nov  5 17:17:26 2011
@@ -54,7 +54,7 @@ public class TestSharedUnqualifiedClassN
     public void testMappedSuperclass() {
         ClassMetaData meta = emf.getConfiguration()
             .getMetaDataRepositoryInstance()
-            .getMetaData("SharedName1", true);
+            .getMetaData("SharedName1", getClass().getClassLoader(), true);
         assertEquals(
             org.apache.openjpa.persistence.inheritance.entity.SharedName1.class,
             meta.getDescribedType());
@@ -63,7 +63,7 @@ public class TestSharedUnqualifiedClassN
     public void testEmbeddable() {
         ClassMetaData meta = emf.getConfiguration()
             .getMetaDataRepositoryInstance()
-            .getMetaData("SharedName2", true);
+            .getMetaData("SharedName2", getClass().getClassLoader(), true);
         assertEquals(
             org.apache.openjpa.persistence.inheritance.entity.SharedName2.class,
             meta.getDescribedType());

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/TestFKColumnNames.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/TestFKColumnNames.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/TestFKColumnNames.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/TestFKColumnNames.java Sat Nov  5 17:17:26 2011
@@ -52,10 +52,10 @@ public class TestFKColumnNames extends A
                 (MappingRepository) emf.getConfiguration()
                         .getMetaDataRepositoryInstance();
 
-        assertEquals("SELECT_ID", repos.getMapping(Inner1.class, true)
+        assertEquals("SELECT_ID", repos.getMapping(Inner1.class, null, true)
                 .getFieldMapping("select").getColumns()[0].getName());
 
-        assertEquals("FROM_ID", repos.getMapping(Inner2.class, true)
+        assertEquals("FROM_ID", repos.getMapping(Inner2.class, null, true)
                 .getFieldMapping("from").getColumns()[0].getName());
         closeEMF(emf);
     }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestDiscriminator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestDiscriminator.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestDiscriminator.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestDiscriminator.java Sat Nov  5 17:17:26 2011
@@ -62,7 +62,8 @@ public class TestDiscriminator
     public void testJoinedDiscriminatorWithColumn() {
         JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
         MappingRepository repo = conf.getMappingRepositoryInstance();
-        ClassMapping cls = repo.getMapping(AnnoTest1.class, true);
+        ClassMapping cls = repo.getMapping(AnnoTest1.class, 
+            null, true);
         assertTrue(cls.getDiscriminator().getStrategy()
             instanceof ValueMapDiscriminatorStrategy);
         assertEquals(1, cls.getDiscriminator().getColumns().length);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestEJBEmbedded.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestEJBEmbedded.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestEJBEmbedded.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestEJBEmbedded.java Sat Nov  5 17:17:26 2011
@@ -157,7 +157,8 @@ public class TestEJBEmbedded extends Sin
 
     public void testMappingTransferAndOverride() {
         JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
-        ClassMapping cls = conf.getMappingRepositoryInstance().getMapping(EmbedOwner.class, true);
+        ClassMapping cls = conf.getMappingRepositoryInstance().getMapping
+            (EmbedOwner.class, null, true);
         assertEquals("OWN_BASIC", cls.getFieldMapping("basic").
             getColumns()[0].getName());
         ClassMapping embed = cls.getFieldMapping("embed").getEmbeddedMapping();

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestEmbeddableSuperclass.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestEmbeddableSuperclass.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestEmbeddableSuperclass.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestEmbeddableSuperclass.java Sat Nov  5 17:17:26 2011
@@ -49,7 +49,8 @@ public class TestEmbeddableSuperclass
 
     public void testSuperclassEmbeddedOnly() {
         ClassMapping cls = ((JDBCConfiguration) emf.getConfiguration()).
-            getMappingRepositoryInstance().getMapping(EmbeddableSuper.class, true);
+            getMappingRepositoryInstance().getMapping(EmbeddableSuper.class, 
+            null, true);
         assertTrue(cls.isEmbeddedOnly());
         assertEquals(NoneClassStrategy.getInstance(), cls.getStrategy());
     }
@@ -57,7 +58,7 @@ public class TestEmbeddableSuperclass
     public void testSubclassMappingDefaultsAndOverrides() {
         JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
         ClassMapping cls = conf.getMappingRepositoryInstance().
-            getMapping(EmbeddableSuperSub.class, true);
+            getMapping(EmbeddableSuperSub.class, null, true);
         assertTrue(!cls.isEmbeddedOnly());
         assertTrue(cls.getStrategy() instanceof FullClassStrategy);
         assertEquals(ClassMapping.ID_APPLICATION, cls.getIdentityType());
@@ -86,7 +87,7 @@ public class TestEmbeddableSuperclass
     public void testSubclassDiscriminatorMapping() {
         JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
         ClassMapping cls = conf.getMappingRepositoryInstance().
-            getMapping(EmbeddableSuperSub.class, true);
+            getMapping(EmbeddableSuperSub.class, null, true);
         assertEquals("DISC", cls.getDiscriminator().getColumns()[0].
             getName());
     }
@@ -94,14 +95,14 @@ public class TestEmbeddableSuperclass
     public void testVersionOverrideMapping() {
         JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
         ClassMapping cls = conf.getMappingRepositoryInstance().
-            getMapping(EmbeddableSuperSub.class, true);
+            getMapping(EmbeddableSuperSub.class, null, true);
         assertEquals("VERSVAL", cls.getVersion().getColumns()[0].getName());
     }
 
     public void testRelationMappings() {
         JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
         ClassMapping cls = conf.getMappingRepositoryInstance().
-            getMapping(EmbeddableSuperSub.class, true);
+            getMapping(EmbeddableSuperSub.class, null, true);
         FieldMapping fm = cls.getFieldMapping("sub");
         assertTrue(fm.getStrategy() instanceof RelationFieldStrategy);
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestEnumerated.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestEnumerated.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestEnumerated.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestEnumerated.java Sat Nov  5 17:17:26 2011
@@ -41,7 +41,7 @@ public class TestEnumerated
     public void testMapping() {
         ClassMapping cls = (ClassMapping) emf.getConfiguration().
             getMetaDataRepositoryInstance().getMetaData(AnnoTest1.class, 
-            true);
+            null, true);
         FieldMapping fm = cls.getDeclaredFieldMapping("enumeration");
         assertNotNull(fm);
         assertEquals(FieldMapping.MANAGE_PERSISTENT, fm.getManagement());

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestExtensionAnnotations.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestExtensionAnnotations.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestExtensionAnnotations.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestExtensionAnnotations.java Sat Nov  5 17:17:26 2011
@@ -41,7 +41,8 @@ public class TestExtensionAnnotations
     public void setUp() {
         setUp(ExtensionsEntity.class);
         _mapping = ((JDBCConfiguration) emf.getConfiguration()).
-            getMappingRepositoryInstance().getMapping(ExtensionsEntity.class, true);
+            getMappingRepositoryInstance().getMapping(ExtensionsEntity.class,
+            null, true);
     }
 
     public void testDataStoreId() {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestGenerators.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestGenerators.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestGenerators.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestGenerators.java Sat Nov  5 17:17:26 2011
@@ -42,7 +42,7 @@ public class TestGenerators extends Sing
 
     public void testGet() {
         if (!PersistenceCapable.class.isAssignableFrom(Generator.class)
-            && !ClassRedefiner.canRedefineClasses(emf.getConfiguration()))
+            && !ClassRedefiner.canRedefineClasses(_log))
             fail("This test requires a higher level of enhancement than"
                 + " is available in the current environment.");
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMapKey.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMapKey.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMapKey.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMapKey.java Sat Nov  5 17:17:26 2011
@@ -46,33 +46,36 @@ public class TestMapKey
 
     public void testDefaultMapKeyMapping() {
         ClassMapping mapping = ((JDBCConfiguration) emf.getConfiguration())
-            .getMappingRepositoryInstance().getMapping(AnnoTest1.class, true);
+            .getMappingRepositoryInstance().getMapping(AnnoTest1.class,
+                null, true);
         FieldMapping fm = mapping.getFieldMapping("defaultMapKey");
         assertTrue(fm.getStrategy() instanceof RelationMapTableFieldStrategy);
         assertEquals("pk", fm.getKey().getValueMappedBy());
-        assertEquals(mapping.getRepository().getMetaData(Flat1.class, true).getField("pk"), 
-        		fm.getKey().getValueMappedByMetaData());
+        assertEquals(mapping.getRepository().getMetaData(Flat1.class, null,
+            true).getField("pk"), fm.getKey().getValueMappedByMetaData());
     }
 
     public void testNamedMapKeyMapping() {
         ClassMapping mapping = ((JDBCConfiguration) emf.getConfiguration())
-            .getMappingRepositoryInstance().getMapping(AnnoTest1.class, true);
+            .getMappingRepositoryInstance().getMapping(AnnoTest1.class,
+                null, true);
         FieldMapping fm = mapping.getFieldMapping("namedMapKey");
         assertTrue(fm.getStrategy() instanceof RelationMapTableFieldStrategy);
         assertEquals("basic", fm.getKey().getValueMappedBy());
-        assertEquals(mapping.getRepository().getMetaData(Flat1.class, true)
-        		.getField("basic"), fm.getKey().getValueMappedByMetaData());
+        assertEquals(mapping.getRepository().getMetaData(Flat1.class, null,
+            true).getField("basic"), fm.getKey().getValueMappedByMetaData());
     }
 
     public void testInverseOwnerMapKeyMapping() {
         ClassMapping mapping = ((JDBCConfiguration) emf.getConfiguration())
-            .getMappingRepositoryInstance().getMapping(AnnoTest1.class, true);
+            .getMappingRepositoryInstance().getMapping(AnnoTest1.class,
+                null, true);
         FieldMapping fm = mapping.getFieldMapping("inverseOwnerMapKey");
         assertTrue(fm.getStrategy() instanceof
             RelationMapInverseKeyFieldStrategy);
         assertEquals("basic", fm.getKey().getValueMappedBy());
         assertEquals(mapping.getRepository().getMetaData(AnnoTest2.class,
-            true).getField("basic"), fm.getKey().
+            null, true).getField("basic"), fm.getKey().
             getValueMappedByMetaData());
     }
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestTablePerClassInheritance.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestTablePerClassInheritance.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestTablePerClassInheritance.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestTablePerClassInheritance.java Sat Nov  5 17:17:26 2011
@@ -42,7 +42,8 @@ public class TestTablePerClassInheritanc
 
     public void testMapping() {
         ClassMapping mapping = ((JDBCConfiguration) emf.getConfiguration()).
-            getMappingRepositoryInstance().getMapping(TablePerClass2.class, true);
+            getMappingRepositoryInstance().getMapping(TablePerClass2.class,
+            null, true);
         assertTrue(mapping.getStrategy() instanceof FullClassStrategy);
         assertTrue(mapping.getDiscriminator().getStrategy()
             instanceof NoneDiscriminatorStrategy);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestVersion.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestVersion.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestVersion.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestVersion.java Sat Nov  5 17:17:26 2011
@@ -180,7 +180,8 @@ public class TestVersion extends SingleE
 
     public void testNoDefaultVersionWithoutFieldOrColumn() {
         ClassMapping cls = ((JDBCConfiguration) emf.getConfiguration()).
-            getMappingRepositoryInstance().getMapping(EmbedOwner.class, true);
+            getMappingRepositoryInstance().getMapping(EmbedOwner.class, 
+            null, true);
         assertEquals(NoneVersionStrategy.getInstance(),
             cls.getVersion().getStrategy());
         assertEquals(0, cls.getVersion().getColumns().length);
@@ -188,7 +189,8 @@ public class TestVersion extends SingleE
 
     public void testVersionWithField() {
         ClassMapping cls = ((JDBCConfiguration) emf.getConfiguration()).
-            getMappingRepositoryInstance().getMapping(AnnoTest1.class, true);
+            getMappingRepositoryInstance().getMapping(AnnoTest1.class, 
+            null, true);
         assertTrue(NoneVersionStrategy.getInstance() !=
             cls.getVersion().getStrategy());
         assertEquals(1, cls.getVersion().getColumns().length);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/JDBCTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/JDBCTestCase.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/JDBCTestCase.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/JDBCTestCase.java Sat Nov  5 17:17:26 2011
@@ -57,7 +57,8 @@ public abstract class JDBCTestCase exten
     public ClassMapping getClassMapping(Class c) {
         
         OpenJPAConfiguration jdoConf = getConfiguration();
-        return ((JDBCConfiguration) jdoConf).getMappingRepositoryInstance().getMapping(c, true);
+        return ((JDBCConfiguration) jdoConf).getMappingRepositoryInstance().
+            getMapping(c, getClass().getClassLoader(), true);
     }
 
     public FieldMapping getFieldMapping(Class c, String field) {
@@ -65,6 +66,7 @@ public abstract class JDBCTestCase exten
     }
 
     public boolean isInheritanceStrategyVertical() {
-        return VerticalClassStrategy.class.isAssignableFrom(getDefaultInheritanceStrategy());
+        return VerticalClassStrategy.class.
+            isAssignableFrom(getDefaultInheritanceStrategy());
     }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/TestDataStoreTrips.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/TestDataStoreTrips.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/TestDataStoreTrips.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/TestDataStoreTrips.java Sat Nov  5 17:17:26 2011
@@ -77,8 +77,10 @@ public class TestDataStoreTrips extends 
             (JDBCConfiguration) ((OpenJPAEntityManagerSPI) kem)
             .getConfiguration();        
 
-        ClassMapping mapping = conf.getMappingRepositoryInstance().getMapping(DataStoreTripsPC.class, true);
-        String table = conf.getDBDictionaryInstance().getFullName(mapping.getTable(), false);
+        ClassMapping mapping = conf.getMappingRepositoryInstance().getMapping
+            (DataStoreTripsPC.class, null, true);
+        String table = conf.getDBDictionaryInstance()
+            .getFullName(mapping.getTable(), false);
 
         // get factory with counter listener
         _factory = getEmf();

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/TestEfficientAttach.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/TestEfficientAttach.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/TestEfficientAttach.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/TestEfficientAttach.java Sat Nov  5 17:17:26 2011
@@ -73,7 +73,7 @@ public class TestEfficientAttach extends
         MetaDataRepository repos = conf.getMappingRepositoryInstance();
         ClassMetaData meta;
         for (int i = 0; i < clss.length; i++) {
-            meta = repos.getMetaData(clss[i], true);
+            meta = repos.getMetaData(clss[i], null, true);
             detachedStateFields[i] = meta.getDetachedState();
             meta.setDetachedState(null);
 
@@ -85,7 +85,7 @@ public class TestEfficientAttach extends
         } finally {
             // set detached state back
             for (int i = 0; i < clss.length; i++)
-                repos.getMetaData(clss[i], true).setDetachedState
+                repos.getMetaData(clss[i], null, true).setDetachedState
                     (detachedStateFields[i]);
         }
     }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/TestIncrementalJDBCFlushes.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/TestIncrementalJDBCFlushes.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/TestIncrementalJDBCFlushes.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/kernel/TestIncrementalJDBCFlushes.java Sat Nov  5 17:17:26 2011
@@ -74,7 +74,8 @@ public class TestIncrementalJDBCFlushes
         JDBCStore store = (JDBCStore) getStoreManager(em, true);
         Connection conn = store.getConnection();
         ClassMapping mapping = store.getConfiguration().
-                getMappingRepositoryInstance().getMapping(RuntimeTest1.class, true);
+                getMappingRepositoryInstance().getMapping(RuntimeTest1.class,
+                null, true);
         FieldMapping fm = mapping.getFieldMapping("stringField");
         String tableName =
             store.getConfiguration().getDBDictionaryInstance().getFullName(

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/mapping/bidi/TestOneSidedParentChildWithImplicitForeignKey.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/mapping/bidi/TestOneSidedParentChildWithImplicitForeignKey.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/mapping/bidi/TestOneSidedParentChildWithImplicitForeignKey.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/mapping/bidi/TestOneSidedParentChildWithImplicitForeignKey.java Sat Nov  5 17:17:26 2011
@@ -70,7 +70,8 @@ public class TestOneSidedParentChildWith
 		MetaDataRepository repos = emf.getConfiguration()
 				.getMetaDataRepositoryInstance();
 		for (int i = 0; i < VALUE_STRATEGIES.length; i++) {
-            ClassMetaData meta = repos.getMetaData(PARENT_ID_TYPES[i], true);
+            ClassMetaData meta = repos.getMetaData(PARENT_ID_TYPES[i], null,
+                    true);
 			FieldMetaData fmd = meta.getPrimaryKeyFields()[0];
             assertEquals(fmd + " strategy is " + fmd.getValueStrategy(),
                     VALUE_STRATEGIES[i], fmd.getValueStrategy());

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestJDBCType.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestJDBCType.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestJDBCType.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestJDBCType.java Sat Nov  5 17:17:26 2011
@@ -70,7 +70,7 @@ public class TestJDBCType
         DBDictionary dict = conf.getDBDictionaryInstance();
         MappingRepository repos = conf.getMappingRepositoryInstance();
         repos.setStrategyInstaller(new RefreshStrategyInstaller(repos));
-        ClassMapping mapping = repos.getMapping(Column.class, true);
+        ClassMapping mapping = repos.getMapping(Column.class, null, true);
 
         Class cls;
         if (dict.getPreferredType(JavaSQLTypes.CLOB) ==  JavaSQLTypes.CLOB) {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestJoinToBaseClass.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestJoinToBaseClass.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestJoinToBaseClass.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestJoinToBaseClass.java Sat Nov  5 17:17:26 2011
@@ -60,7 +60,7 @@ public class TestJoinToBaseClass
     public void testMapping() {
         ClassMapping mapping = ((JDBCConfiguration) getConfiguration()).
             getMappingRepositoryInstance().
-            getMapping(MappingTest5.class, true);
+            getMapping(MappingTest5.class, null, true);
 
         Table supTable = mapping.getPCSuperclassMapping().getTable();
         assertTrue(mapping.getTable() != supTable);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestMappedByKeyMaps.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestMappedByKeyMaps.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestMappedByKeyMaps.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestMappedByKeyMaps.java Sat Nov  5 17:17:26 2011
@@ -58,10 +58,12 @@ public class TestMappedByKeyMaps
     
     public void testInverseKeyMapMapping() {
         JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
-        ClassMapping pc = conf.getMappingRepositoryInstance().getMapping(InverseKeyMapPC.class, true);
+        ClassMapping pc = conf.getMappingRepositoryInstance().getMapping
+                (InverseKeyMapPC.class, null, true);
         FieldMapping map = pc.getFieldMapping("helpers");
         
-        ClassMapping helper = conf.getMappingRepositoryInstance().getMapping(HelperPC.class, true);
+        ClassMapping helper = conf.getMappingRepositoryInstance().getMapping
+                (HelperPC.class, null, true);
         FieldMapping str = helper.getFieldMapping("stringField");
         
         assertEquals("stringField", map.getKey().getValueMappedBy());
@@ -75,10 +77,12 @@ public class TestMappedByKeyMaps
     
     public void testJoinTableMapMapping() {
         JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
-        ClassMapping pc = conf.getMappingRepositoryInstance().getMapping(JoinTableMapPC.class, true);
+        ClassMapping pc = conf.getMappingRepositoryInstance().getMapping
+                (JoinTableMapPC.class, null, true);
         FieldMapping map = pc.getFieldMapping("helpers");
         
-        ClassMapping helper = conf.getMappingRepositoryInstance().getMapping(HelperPC.class, true);
+        ClassMapping helper = conf.getMappingRepositoryInstance().getMapping
+                (HelperPC.class, null, true);
         FieldMapping str = helper.getFieldMapping("stringField");
         
         assertEquals("stringField", map.getKey().getValueMappedBy());
@@ -253,13 +257,13 @@ public class TestMappedByKeyMaps
     
     private void setLRS(Class cls, boolean lrs) {
         ClassMapping cm = ((JDBCConfiguration) getConfiguration()).
-                getMappingRepositoryInstance().getMapping(cls, true);
+                getMappingRepositoryInstance().getMapping(cls, null, true);
         cm.getFieldMapping("helpers").setLRS(lrs);
     }
     
     private void unsetLRS(Class cls) {
         ClassMapping cm = ((JDBCConfiguration) getConfiguration()).
-                getMappingRepositoryInstance().getMapping(cls, true);
+                getMappingRepositoryInstance().getMapping(cls, null, true);
         cm.getFieldMapping("helpers").setLRS(false);
     }
     

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestMetaDataValueIndicator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestMetaDataValueIndicator.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestMetaDataValueIndicator.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/meta/TestMetaDataValueIndicator.java Sat Nov  5 17:17:26 2011
@@ -62,6 +62,7 @@ public class TestMetaDataValueIndicator
     }
     
     public void setUp() {
+        // ### I hate that we have to do this
         Class c = MultiE.class;
         c = MultiF.class;
         
@@ -69,13 +70,16 @@ public class TestMetaDataValueIndicator
         
         eMapping =
             (ClassMapping) ((OpenJPAEntityManagerSPI) pm).getConfiguration().
-            getMetaDataRepositoryInstance().getMetaData(MultiE.class, true);
+            getMetaDataRepositoryInstance().getMetaData(MultiE.class,
+            pm.getClassLoader(), true);
         fMapping =
             (ClassMapping) ((OpenJPAEntityManagerSPI) pm).getConfiguration().
-            getMetaDataRepositoryInstance().getMetaData(MultiF.class, true);
+            getMetaDataRepositoryInstance().getMetaData(MultiF.class,
+            pm.getClassLoader(), true);
     }
     
-    public void tearDown() throws Exception {
+    public void tearDown()
+    throws Exception {
         if (pm.getTransaction().isActive())
             pm.getTransaction().rollback();
         pm.close();

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/order/TestOrderColumn.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/order/TestOrderColumn.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/order/TestOrderColumn.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/order/TestOrderColumn.java Sat Nov  5 17:17:26 2011
@@ -992,7 +992,7 @@ public class TestOrderColumn extends Sin
         Class clazz, String fieldName) {
         JDBCConfiguration conf = (JDBCConfiguration) emf1.getConfiguration();
         ClassMapping cls = conf.getMappingRepositoryInstance().
-            getMapping(clazz, true);
+            getMapping(clazz, null, true);
         FieldMapping fm = cls.getFieldMapping(fieldName);
         Column oc = fm.getOrderColumn();
         assertNotNull(oc);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/order/TestOrderColumnXML.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/order/TestOrderColumnXML.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/order/TestOrderColumnXML.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/order/TestOrderColumnXML.java Sat Nov  5 17:17:26 2011
@@ -65,7 +65,7 @@ public class TestOrderColumnXML extends 
         MetaDataRepository repos = conf.getMetaDataRepositoryInstance();
 
         // Force entity resolution
-        repos.getMetaData(BaseTestEntity2.class, true);
+        repos.getMetaData(BaseTestEntity2.class, null, true);
         
         OpenJPAEntityManagerSPI em = emf1.createEntityManager();
 
@@ -240,7 +240,7 @@ public class TestOrderColumnXML extends 
         MetaDataRepository repos = conf.newMetaDataRepositoryInstance();
 
         // Force entity resolution
-        repos.getMetaData(BaseTestEntity1.class, true);
+        repos.getMetaData(BaseTestEntity1.class, null, true);
 
         XMLPersistenceMappingSerializer ser =
             new XMLPersistenceMappingSerializer((JDBCConfiguration)conf);
@@ -256,7 +256,7 @@ public class TestOrderColumnXML extends 
         MetaDataRepository mdr2 = parser.getRepository();
 
         ClassMetaData _entityMeta2 = 
-            mdr2.getMetaData(BaseTestEntity1.class, true);
+            mdr2.getMetaData(BaseTestEntity1.class, null, true);
 
         // Assert metadata is populated correctly
         FieldMapping fm = (FieldMapping)_entityMeta2.getField("one2Melems");
@@ -286,7 +286,7 @@ public class TestOrderColumnXML extends 
         Class clazz, String fieldName) {
         JDBCConfiguration conf = (JDBCConfiguration) emf1.getConfiguration();
         ClassMapping cls = conf.getMappingRepositoryInstance().
-            getMapping(clazz, true);
+            getMapping(clazz, null, true);
         FieldMapping fm = cls.getFieldMapping(fieldName);
         Column oc = fm.getOrderColumn();
         assertNotNull(oc);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/JDBCTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/JDBCTestCase.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/JDBCTestCase.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/JDBCTestCase.java Sat Nov  5 17:17:26 2011
@@ -62,7 +62,8 @@ public abstract class JDBCTestCase exten
     
     public ClassMapping getClassMapping(Class c) {
         OpenJPAConfiguration jdoConf = getConfiguration();
-        return ((JDBCConfiguration) jdoConf).getMappingRepositoryInstance().getMapping(c, true);
+        return ((JDBCConfiguration) jdoConf).getMappingRepositoryInstance().
+                getMapping(c, getClass().getClassLoader(), true);
     }
     
     public FieldMapping getFieldMapping(Class c, String field) {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestSQLQueries.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestSQLQueries.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestSQLQueries.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestSQLQueries.java Sat Nov  5 17:17:26 2011
@@ -90,7 +90,8 @@ public class TestSQLQueries
             .getConfiguration();
         DBDictionary dict = conf.getDBDictionaryInstance();
         MappingRepository repos = conf.getMappingRepositoryInstance();
-        ClassMapping mapping = repos.getMapping(RuntimeTest1.class, true);
+        ClassMapping mapping = repos.getMapping(RuntimeTest1.class,
+                pm.getClassLoader(), true);
         
         _tableName = mapping.getTable().getName();
         _fullTableName = dict.getFullName(mapping.getTable(), false);
@@ -381,13 +382,15 @@ public class TestSQLQueries
         DBDictionary dict = conf.getDBDictionaryInstance();
         MappingRepository repos = conf.getMappingRepositoryInstance();
         
-        ClassMapping mappingA = repos.getMapping(AttachD.class, true);
+        ClassMapping mappingA = repos.getMapping(AttachD.class,
+                pm.getClassLoader(), true);
         String tableNameA = mappingA.getTable().getName();
         String fullTableNameA = dict.getFullName(mappingA.getTable(), false);
         String relColNameA = mappingA.getFieldMapping("a").
                 getColumns()[0].getName();
         
-        ClassMapping mappingD = repos.getMapping(AttachA.class, true);
+        ClassMapping mappingD = repos.getMapping(AttachA.class,
+                pm.getClassLoader(), true);
         String tableNameD = mappingD.getTable().getName();
         String fullTableNameD = dict.getFullName(mappingD.getTable(), false);
         String pkColNameD = mappingD.getTable().getPrimaryKey().

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestClassDBSequenceFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestClassDBSequenceFactory.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestClassDBSequenceFactory.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestClassDBSequenceFactory.java Sat Nov  5 17:17:26 2011
@@ -226,7 +226,7 @@ public class TestClassDBSequenceFactory
                 ClassMapping mapping =
                         ((JDBCConfiguration) _broker.getConfiguration()).
                         getMappingRepositoryInstance().
-                        getMapping(SeqD.class, true);
+                        getMapping(SeqD.class, null, true);
                 ClassTableJDBCSeq seq = (ClassTableJDBCSeq)
                 _broker.getIdentitySequence(mapping);
                 for (int i = 0; i < 51; i++)

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestClassSequenceFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestClassSequenceFactory.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestClassSequenceFactory.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestClassSequenceFactory.java Sat Nov  5 17:17:26 2011
@@ -135,11 +135,11 @@ public class TestClassSequenceFactory ex
             return;
         
         ClassMapping aMapping = conf.getMappingRepositoryInstance().
-                getMapping(SeqA.class, true);
+                getMapping(SeqA.class, null, true);
         ClassMapping bMapping = conf.getMappingRepositoryInstance().
-                getMapping(SeqB.class, true);
+                getMapping(SeqB.class, null, true);
         ClassMapping cMapping = conf.getMappingRepositoryInstance().
-                getMapping(SeqC.class, true);
+                getMapping(SeqC.class, null, true);
         DataSource ds = conf.getDataSource2(null);
         
         // hold a and c and start b
@@ -192,7 +192,7 @@ public class TestClassSequenceFactory ex
             try {
                 Seq seq = _conf.getSequenceInstance();
                 ClassMapping mapping = _conf.getMappingRepositoryInstance().
-                        getMapping(SeqA.class, true);
+                        getMapping(SeqA.class, null, true);
                 for (int i = 0; i < 51; i++)
                     _set.add(seq.next(_broker, mapping));
             } catch (Exception e) {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestDBSequenceFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestDBSequenceFactory.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestDBSequenceFactory.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestDBSequenceFactory.java Sat Nov  5 17:17:26 2011
@@ -105,7 +105,7 @@ public class TestDBSequenceFactory
                 for (int i = 0; i < 51; i++)
                     _set.add(seq.next(_broker, 
                         conf.getMetaDataRepositoryInstance().
-                        getMetaData(RuntimeTest1.class, true)));
+                        getMetaData(RuntimeTest1.class, null, true)));
             } catch (Exception e) {
                 throw new RuntimeException(e.getMessage());
             }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestDynamicSchemaFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestDynamicSchemaFactory.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestDynamicSchemaFactory.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestDynamicSchemaFactory.java Sat Nov  5 17:17:26 2011
@@ -67,7 +67,7 @@ public class TestDynamicSchemaFactory
         JDBCConfiguration conf = new JDBCConfigurationImpl();
         conf.setSchemaFactory(DynamicSchemaFactory.class.getName());
         MappingRepository repos = conf.newMappingRepositoryInstance();
-        _mapping = repos.getMapping(MappingTest1.class, true);
+        _mapping = repos.getMapping(MappingTest1.class, null, true);
     }
 
     public void testClassMapping() {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestPerClassSequenceFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestPerClassSequenceFactory.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestPerClassSequenceFactory.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestPerClassSequenceFactory.java Sat Nov  5 17:17:26 2011
@@ -30,12 +30,10 @@ package org.apache.openjpa.persistence.j
 import java.util.*;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.jdbc.meta.ClassMapping;
-import org.apache.openjpa.jdbc.meta.MappingRepository;
 import org.apache.openjpa.jdbc.schema.Sequence;
 import org.apache.openjpa.kernel.Seq;
 import org.apache.openjpa.kernel.StoreContext;
 import org.apache.openjpa.meta.ClassMetaData;
-import org.apache.openjpa.meta.MetaDataRepository;
 
 import org.apache.openjpa.persistence.jdbc.common.apps.*;
 
@@ -61,18 +59,36 @@ public class TestPerClassSequenceFactory
 
     public void testPerClassSequenceFactory()
         throws Exception {
-        Map props = new HashMap();
+        Map props=new HashMap();
         props.put("openjpa.Sequence", "table");
         
-        OpenJPAEntityManagerFactory factory =(OpenJPAEntityManagerFactory)getEmf(props);
+        OpenJPAEntityManagerFactory factory =(OpenJPAEntityManagerFactory)
+                getEmf(props);
 
-        JDBCConfiguration conf = (JDBCConfiguration) factory.getConfiguration();
-        MappingRepository repos = conf.getMappingRepositoryInstance();
-        ClassMapping mapping1 = repos.getMapping(RuntimeTest1.class, true);
-        ClassMapping mapping2 = repos.getMapping(PerClassTestObject.class, true);
-        ClassMapping mapping3 = repos.getMapping(PerClassTestObject2.class, true);
+        JDBCConfiguration conf = (JDBCConfiguration)
+            factory.getConfiguration();
+        ClassMapping mapping1 = conf.getMappingRepositoryInstance().
+            getMapping(RuntimeTest1.class, null, true);
+        ClassMapping mapping2 = conf.getMappingRepositoryInstance().
+            getMapping(PerClassTestObject.class, null, true);
+        ClassMapping mapping3 = conf.getMappingRepositoryInstance().
+            getMapping(PerClassTestObject2.class, null, true);
 
         OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
+        //FIXME jthomas
+        /*
+        Sequence s1 = pm.getIdentitySequence(mapping1.getDescribedType());
+        Sequence s2 = pm.getIdentitySequence(mapping2.getDescribedType());
+        Sequence s3 = pm.getFieldSequence(mapping3.getDescribedType(), "age");
+        assertTrue(((SequenceImpl) s1).getDelegate()
+            instanceof TableJDBCSeq);
+        assertTrue(((SequenceImpl) s2).getDelegate().toString(),
+            ((SequenceImpl) s2).getDelegate()
+                instanceof DummySequenceFactory);
+        assertTrue(((SequenceImpl) s2).getDelegate().toString(),
+            ((SequenceImpl) s3).getDelegate()
+                instanceof DummySequenceFactory);
+         */
     }
 
     public static class DummySequenceFactory

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestSequenceGeneratorEnsureCapacityCall.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestSequenceGeneratorEnsureCapacityCall.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestSequenceGeneratorEnsureCapacityCall.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestSequenceGeneratorEnsureCapacityCall.java Sat Nov  5 17:17:26 2011
@@ -84,9 +84,9 @@ public class TestSequenceGeneratorEnsure
     private Seq seqForClass(Class cls) {
         OpenJPAConfiguration conf = getConfiguration();
         ClassMetaData meta = conf.getMetaDataRepositoryInstance().getMetaData
-            (cls, true);
+            (cls, null, true);
         SequenceMetaData smeta = meta.getIdentitySequenceMetaData();
         return (smeta == null) ? conf.getSequenceInstance()
-            : smeta.getInstance();
+            : smeta.getInstance(null);
     }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java Sat Nov  5 17:17:26 2011
@@ -1324,7 +1324,7 @@ public class TestPreparedQueryCache exte
             return name;
         return emf.getConfiguration()
                   .getMetaDataRepositoryInstance()
-                  .getQueryMetaData(null, name, true)
+                  .getQueryMetaData(null, name, null, true)
                   .getQueryString();
     }
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPCClass.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPCClass.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPCClass.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPCClass.java Sat Nov  5 17:17:26 2011
@@ -60,7 +60,7 @@ public class TestPCClass extends BaseKer
 
         MetaDataRepository repos = getConfiguration()
             .getMetaDataRepositoryInstance();
-        ClassMetaData meta = repos.getMetaData(PCClassPC.class, true);
+        ClassMetaData meta = repos.getMetaData(PCClassPC.class, null, true);
 
         FieldMetaData fmd = meta.getField("specificPC");
         assertNotNull("fmd is nulll", fmd);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPersistenceManagerFactoryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPersistenceManagerFactoryImpl.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPersistenceManagerFactoryImpl.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestPersistenceManagerFactoryImpl.java Sat Nov  5 17:17:26 2011
@@ -162,11 +162,11 @@ public class TestPersistenceManagerFacto
             assertTrue("no listeners defined added to Runtimetest4",
                 broker.getLifecycleEventManager().hasLoadListeners(
                     new RuntimeTest4("foo"),
-                    repos.getMetaData(RuntimeTest4.class, true)));
+                    repos.getMetaData(RuntimeTest4.class, null, true)));
             assertFalse("there should be listeners def for runtimetest1",
                 broker.getLifecycleEventManager().hasLoadListeners
                     (new RuntimeTest1(), repos.getMetaData
-                        (RuntimeTest1.class, true)));
+                        (RuntimeTest1.class, null, true)));
             broker.close();
         } finally {
             pmfSPI.removeLifecycleListener(listener);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/managedinterface/TestSimpleManagedInterface.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/managedinterface/TestSimpleManagedInterface.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/managedinterface/TestSimpleManagedInterface.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/managedinterface/TestSimpleManagedInterface.java Sat Nov  5 17:17:26 2011
@@ -42,7 +42,7 @@ public class TestSimpleManagedInterface
         MetaDataRepository repos = bf.getConfiguration()
             .getMetaDataRepositoryInstance();
         ClassMetaData meta = repos.getMetaData(SimpleManagedInterface.class,
-            false);
+            null, false);
         assertNotNull(meta);
         assertTrue(meta.isManagedInterface());
         assertEquals(SimpleManagedInterface.class, meta.getDescribedType());



Mime
View raw message