cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r398461 - in /incubator/cayenne/jpa/trunk/cayenne-jpa/src: main/java/org/apache/cayenne/jpa/bridge/ main/java/org/apache/cayenne/jpa/conf/ main/java/org/apache/cayenne/jpa/cspi/ main/java/org/apache/cayenne/jpa/enhancer/ main/java/org/apach...
Date Sun, 30 Apr 2006 23:27:29 GMT
Author: aadamchik
Date: Sun Apr 30 16:27:26 2006
New Revision: 398461

URL: http://svn.apache.org/viewcvs?rev=398461&view=rev
Log:
refactoring

Added:
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoaderContext.java
      - copied, changed from r398449, incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/JpaLoaderContext.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/UnitDescriptorParser.java
      - copied, changed from r398457, incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/PersistenceDescriptorParser.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/UnitLoader.java
      - copied, changed from r398457, incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/PersistenceUnitLoader.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/enhancer/
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/enhancer/EnhancerContext.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaUnit.java
      - copied, changed from r398457, incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfo.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaUnitFactory.java
      - copied, changed from r398457, incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfoFactory.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/UnitDescriptorParserTest.java
      - copied, changed from r398457, incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/PersistenceDescriptorParserTest.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/JpaUnitTest.java
      - copied, changed from r398457, incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfoTest.java
Removed:
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/JpaLoaderContext.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/PersistenceDescriptorParser.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/PersistenceUnitLoader.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfo.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfoFactory.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfoTest.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/PersistenceDescriptorParserTest.java
Modified:
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorStack.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapMergeProcessor.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/cspi/CjpaPersistenceProvider.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceProvider.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/bridge/DataMapConverterTest.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoaderTest.java
    incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessorTest.java

Modified: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java?rev=398461&r1=398460&r2=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java
Sun Apr 30 16:27:26 2006
@@ -19,7 +19,7 @@
 import java.lang.reflect.Field;
 
 import org.apache.cayenne.jpa.JpaProviderException;
-import org.apache.cayenne.jpa.conf.JpaLoaderContext;
+import org.apache.cayenne.jpa.conf.EntityMapLoaderContext;
 import org.apache.cayenne.jpa.conf.JpaPropertyDescriptor;
 import org.apache.cayenne.jpa.map.AccessType;
 import org.apache.cayenne.jpa.map.JpaAttribute;
@@ -59,12 +59,12 @@
  */
 public class DataMapConverter {
 
-    protected JpaLoaderContext context;
+    protected EntityMapLoaderContext context;
 
     protected ProjectPath targetPath;
     protected HierarchicalTreeVisitor visitor;
 
-    public synchronized DataMap toDataMap(String name, JpaLoaderContext context) {
+    public synchronized DataMap toDataMap(String name, EntityMapLoaderContext context) {
         this.context = context;
 
         // reset

Modified: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorStack.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorStack.java?rev=398461&r1=398460&r2=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorStack.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorStack.java
Sun Apr 30 16:27:26 2006
@@ -28,7 +28,7 @@
     /**
      * Returns parent context.
      */
-    JpaLoaderContext getContext();
+    EntityMapLoaderContext getContext();
 
     void push(Object object);
 

Modified: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java?rev=398461&r1=398460&r2=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java
Sun Apr 30 16:27:26 2006
@@ -87,7 +87,7 @@
         // 'attribute' is implied...
     }
 
-    protected JpaLoaderContext context;
+    protected EntityMapLoaderContext context;
 
     protected Comparator<Annotation> typeAnnotationsSorter;
     protected Comparator<Annotation> memberAnnotationsSorter;
@@ -96,7 +96,7 @@
     protected AnnotationProcessorFactory memberProcessorFactory;
     protected AnnotationProcessorFactory callbackProcessorFactory;
 
-    public EntityMapAnnotationLoader(JpaLoaderContext context) {
+    public EntityMapAnnotationLoader(EntityMapLoaderContext context) {
         this.context = context;
         this.typeAnnotationsSorter = new AnnotationSorter(
                 TYPE_ANNOTATION_ORDERING_WEIGHTS);

Modified: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java?rev=398461&r1=398460&r2=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java
Sun Apr 30 16:27:26 2006
@@ -46,9 +46,9 @@
 public class EntityMapDefaultsProcessor {
 
     protected HierarchicalTreeVisitor visitor;
-    protected JpaLoaderContext context;
+    protected EntityMapLoaderContext context;
 
-    public EntityMapDefaultsProcessor(JpaLoaderContext context) {
+    public EntityMapDefaultsProcessor(EntityMapLoaderContext context) {
         this.context = context;
     }
 

Modified: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java?rev=398461&r1=398460&r2=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java
Sun Apr 30 16:27:26 2006
@@ -62,7 +62,7 @@
     static final String DESCRIPTOR_LOCATION = "META-INF/orm.xml";
 
     protected JpaEntityMap entityMap;
-    protected JpaLoaderContext context;
+    protected EntityMapLoaderContext context;
     protected Map<String, JpaClassDescriptor> descriptors;
 
     /**
@@ -88,7 +88,7 @@
             throws JpaProviderException {
 
         this.entityMap = new JpaEntityMap();
-        this.context = new JpaLoaderContext(entityMap);
+        this.context = new EntityMapLoaderContext(entityMap);
 
         try {
             loadFromAnnotations(persistenceUnit);
@@ -190,7 +190,7 @@
         }
     }
 
-    public JpaLoaderContext getContext() {
+    public EntityMapLoaderContext getContext() {
         return context;
     }
 }

Copied: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoaderContext.java
(from r398449, incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/JpaLoaderContext.java)
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoaderContext.java?p2=incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoaderContext.java&p1=incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/JpaLoaderContext.java&r1=398449&r2=398461&rev=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/JpaLoaderContext.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoaderContext.java
Sun Apr 30 16:27:26 2006
@@ -31,13 +31,13 @@
  * 
  * @author Andrus Adamchik
  */
-public class JpaLoaderContext {
+public class EntityMapLoaderContext {
 
     protected Map<String, JpaClassDescriptor> descriptors;
     protected ValidationResult conflicts;
     protected JpaEntityMap entityMap;
 
-    public JpaLoaderContext(JpaEntityMap map) {
+    public EntityMapLoaderContext(JpaEntityMap map) {
         this.conflicts = new ValidationResult();
         this.entityMap = map;
     }
@@ -106,8 +106,8 @@
 
         LinkedList stack = new LinkedList();
 
-        public JpaLoaderContext getContext() {
-            return JpaLoaderContext.this;
+        public EntityMapLoaderContext getContext() {
+            return EntityMapLoaderContext.this;
         }
 
         public int depth() {
@@ -140,7 +140,7 @@
                 buffer.append(", details: ").append(message);
             }
 
-            JpaLoaderContext.this.recordConflict(new SimpleValidationFailure(
+            EntityMapLoaderContext.this.recordConflict(new SimpleValidationFailure(
                     peek(),
                     buffer.toString()));
         }

Modified: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapMergeProcessor.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapMergeProcessor.java?rev=398461&r1=398460&r2=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapMergeProcessor.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapMergeProcessor.java
Sun Apr 30 16:27:26 2006
@@ -25,9 +25,9 @@
 public class EntityMapMergeProcessor {
 
     protected JpaEntityMap baseMap;
-    protected JpaLoaderContext context;
+    protected EntityMapLoaderContext context;
 
-    public EntityMapMergeProcessor(JpaEntityMap baseMap, JpaLoaderContext context) {
+    public EntityMapMergeProcessor(JpaEntityMap baseMap, EntityMapLoaderContext context)
{
         this.baseMap = baseMap;
         this.context = context;
     }

Copied: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/UnitDescriptorParser.java
(from r398457, incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/PersistenceDescriptorParser.java)
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/UnitDescriptorParser.java?p2=incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/UnitDescriptorParser.java&p1=incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/PersistenceDescriptorParser.java&r1=398457&r2=398461&rev=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/PersistenceDescriptorParser.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/UnitDescriptorParser.java
Sun Apr 30 16:27:26 2006
@@ -30,8 +30,8 @@
 import javax.xml.validation.SchemaFactory;
 
 import org.apache.cayenne.jpa.spi.JpaPersistenceProvider;
-import org.apache.cayenne.jpa.spi.JpaPersistenceUnitInfo;
-import org.apache.cayenne.jpa.spi.JpaPersistenceUnitInfoFactory;
+import org.apache.cayenne.jpa.spi.JpaUnit;
+import org.apache.cayenne.jpa.spi.JpaUnitFactory;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
@@ -44,7 +44,7 @@
  * 
  * @author Andrus Adamchik
  */
-public class PersistenceDescriptorParser {
+public class UnitDescriptorParser {
 
     static final String PERSISTENCE_SCHEMA = "META-INF/schemas/persistence_1_0.xsd";
 
@@ -65,14 +65,14 @@
     static final String VALUE = "value";
 
     protected SAXParser parser;
-    protected JpaPersistenceUnitInfoFactory unitFactory;
+    protected JpaUnitFactory unitFactory;
 
-    public PersistenceDescriptorParser() throws SAXException,
+    public UnitDescriptorParser() throws SAXException,
             ParserConfigurationException {
         this(null, false);
     }
 
-    public PersistenceDescriptorParser(JpaPersistenceUnitInfoFactory unitFactory,
+    public UnitDescriptorParser(JpaUnitFactory unitFactory,
             boolean validatesAgainstSchema) throws SAXException,
             ParserConfigurationException {
 
@@ -104,17 +104,17 @@
     /**
      * Loads and returns a Collection of PersistenceUnitInfos from the XML descriptor.
      */
-    public synchronized Collection<JpaPersistenceUnitInfo> getPersistenceUnits(
+    public synchronized Collection<JpaUnit> getPersistenceUnits(
             InputSource in,
             final URL persistenceUnitRootUrl) throws SAXException, IOException {
 
-        final Collection<JpaPersistenceUnitInfo> unitInfos = new ArrayList<JpaPersistenceUnitInfo>(
+        final Collection<JpaUnit> unitInfos = new ArrayList<JpaUnit>(
                 2);
 
         parser.reset();
         parser.parse(in, new DefaultHandler() {
 
-            JpaPersistenceUnitInfo unit;
+            JpaUnit unit;
             Properties properties;
             StringBuilder charBuffer;
 
@@ -136,7 +136,7 @@
 
                     unit = unitFactory != null
                             ? unitFactory.newUnitInfo()
-                            : new JpaPersistenceUnitInfo();
+                            : new JpaUnit();
                     unit.setPersistenceUnitName(name);
                     unit.setPersistenceUnitRootUrl(persistenceUnitRootUrl);
 

Copied: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/UnitLoader.java
(from r398457, incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/PersistenceUnitLoader.java)
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/UnitLoader.java?p2=incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/UnitLoader.java&p1=incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/PersistenceUnitLoader.java&r1=398457&r2=398461&rev=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/PersistenceUnitLoader.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/UnitLoader.java
Sun Apr 30 16:27:26 2006
@@ -19,8 +19,8 @@
 import java.util.Collection;
 import java.util.Enumeration;
 
-import org.apache.cayenne.jpa.spi.JpaPersistenceUnitInfo;
-import org.apache.cayenne.jpa.spi.JpaPersistenceUnitInfoFactory;
+import org.apache.cayenne.jpa.spi.JpaUnit;
+import org.apache.cayenne.jpa.spi.JpaUnitFactory;
 import org.xml.sax.InputSource;
 
 /**
@@ -28,16 +28,16 @@
  * 
  * @author Andrus Adamchik
  */
-public class PersistenceUnitLoader {
+public class UnitLoader {
 
     static final String DESCRIPTOR_LOCATION = "META-INF/persistence.xml";
 
-    protected PersistenceDescriptorParser parser;
+    protected UnitDescriptorParser parser;
 
-    public PersistenceUnitLoader(JpaPersistenceUnitInfoFactory unitFactory,
+    public UnitLoader(JpaUnitFactory unitFactory,
             boolean validateDescriptors) {
         try {
-            this.parser = new PersistenceDescriptorParser(
+            this.parser = new UnitDescriptorParser(
                     unitFactory,
                     validateDescriptors);
         }
@@ -54,7 +54,7 @@
      * scan all available peristence unit descriptors every time this method is called.</i>
      * </p>
      */
-    public JpaPersistenceUnitInfo getInfo(String persistenceUnitName) {
+    public JpaUnit loadUnit(String persistenceUnitName) {
 
         if (persistenceUnitName == null) {
             throw new IllegalArgumentException("Null persistenceUnitName");
@@ -73,11 +73,11 @@
                 String descriptorRoot = descriptorURL.substring(0, descriptorURL.length()
                         - DESCRIPTOR_LOCATION.length());
 
-                Collection<JpaPersistenceUnitInfo> units = parser.getPersistenceUnits(
+                Collection<JpaUnit> units = parser.getPersistenceUnits(
                         new InputSource(descriptorURL),
                         new URL(descriptorRoot));
 
-                for (JpaPersistenceUnitInfo unit : units) {
+                for (JpaUnit unit : units) {
                     if (persistenceUnitName.equals(unit.getPersistenceUnitName())) {
                         return unit;
                     }

Modified: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/cspi/CjpaPersistenceProvider.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/cspi/CjpaPersistenceProvider.java?rev=398461&r1=398460&r2=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/cspi/CjpaPersistenceProvider.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/cspi/CjpaPersistenceProvider.java
Sun Apr 30 16:27:26 2006
@@ -27,7 +27,7 @@
 
 import org.apache.cayenne.jpa.bridge.DataMapConverter;
 import org.apache.cayenne.jpa.conf.EntityMapLoader;
-import org.apache.cayenne.jpa.conf.JpaLoaderContext;
+import org.apache.cayenne.jpa.conf.EntityMapLoaderContext;
 import org.apache.cayenne.jpa.spi.JpaPersistenceProvider;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -69,20 +69,27 @@
         Configuration.configureCommonLogging();
 
         this.logger = LogFactory.getLog(getClass());
-
-        // override default properties
-        defaultProperties.put(DATA_SOURCE_FACTORY_PROPERTY, CjpaDataSourceFactory.class
-                .getName());
-        defaultProperties.put(
-                TRANSACTION_TYPE_PROPERTY,
-                PersistenceUnitTransactionType.RESOURCE_LOCAL.name());
-
+        
         this.configuration = new LazyConfiguration();
 
         // set a singleton that may be used by Cayenne
         Configuration.initializeSharedConfiguration(configuration);
     }
 
+    protected void configureDefaultProperties() {
+        if (!defaultProperties.containsKey(DATA_SOURCE_FACTORY_PROPERTY)) {
+            defaultProperties.put(
+                    DATA_SOURCE_FACTORY_PROPERTY,
+                    CjpaDataSourceFactory.class.getName());
+        }
+
+        if (!defaultProperties.containsKey(TRANSACTION_TYPE_PROPERTY)) {
+            defaultProperties.put(
+                    TRANSACTION_TYPE_PROPERTY,
+                    PersistenceUnitTransactionType.RESOURCE_LOCAL.name());
+        }
+    }
+
     /**
      * Maps PersistenceUnitInfo to Cayenne DataDomain and returns a
      * {@link CjpaEntityManagerFactory} which is a DataDomain wrapper.
@@ -144,7 +151,7 @@
     }
 
     protected DbAdapter createCustomAdapter(
-            JpaLoaderContext context,
+            EntityMapLoaderContext context,
             PersistenceUnitInfo info) {
 
         String adapterKey = CjpaDataSourceFactory.getPropertyName(info

Added: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/enhancer/EnhancerContext.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/enhancer/EnhancerContext.java?rev=398461&view=auto
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/enhancer/EnhancerContext.java
(added)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/enhancer/EnhancerContext.java
Sun Apr 30 16:27:26 2006
@@ -0,0 +1,34 @@
+/*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.cayenne.jpa.enhancer;
+
+/**
+ * Registers
+ * 
+ * @author
+ */
+public class EnhancerContext {
+
+    static final EnhancerContext shared = new EnhancerContext();
+
+    public static EnhancerContext getShared() {
+        return shared;
+    }
+
+    public void addManagedClass(String managedClassName) {
+
+    }
+}

Modified: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceProvider.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceProvider.java?rev=398461&r1=398460&r2=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceProvider.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceProvider.java
Sun Apr 30 16:27:26 2006
@@ -24,7 +24,7 @@
 import javax.persistence.spi.PersistenceUnitTransactionType;
 
 import org.apache.cayenne.jpa.JpaProviderException;
-import org.apache.cayenne.jpa.conf.PersistenceUnitLoader;
+import org.apache.cayenne.jpa.conf.UnitLoader;
 
 /**
  * <code>PersistenceProvider</code> implementation that doesn't provide its own
ORM
@@ -42,10 +42,10 @@
 
     // provider-specific properties
     public static final String DATA_SOURCE_FACTORY_PROPERTY = "org.apache.cayenne.jpa.jpaDataSourceFactory";
-    public static final String PERSISTENCE_UNIT_INFO_FACTORY_PROPERTY = "org.apache.cayenne.jpa.jpaPersistenceUnitInfoFactory";
+    public static final String UNIT_FACTORY_PROPERTY = "org.apache.cayenne.jpa.jpaUnitFactory";
 
     protected boolean validateDescriptors;
-    protected PersistenceUnitLoader unitLoader;
+    protected UnitLoader unitLoader;
     protected Properties defaultProperties;
 
     /**
@@ -64,19 +64,52 @@
         this.validateDescriptors = validateDescriptors;
         this.defaultProperties = new Properties();
 
-        defaultProperties.put(
-                DATA_SOURCE_FACTORY_PROPERTY,
-                JndiJpaDataSourceFactory.class.getName());
-        defaultProperties.put(
-                TRANSACTION_TYPE_PROPERTY,
-                PersistenceUnitTransactionType.JTA.name());
+        configureEnvironmentProperties();
+        configureDefaultProperties();
+    }
+
+    /**
+     * Loads default properties from the Java environment.
+     */
+    protected void configureEnvironmentProperties() {
+        String dsFactory = System.getProperty(DATA_SOURCE_FACTORY_PROPERTY);
+        if (dsFactory != null) {
+            defaultProperties.put(DATA_SOURCE_FACTORY_PROPERTY, dsFactory);
+        }
+
+        String transactionType = System.getProperty(TRANSACTION_TYPE_PROPERTY);
+        if (transactionType != null) {
+            defaultProperties.put(TRANSACTION_TYPE_PROPERTY, transactionType);
+        }
+
+        String unitFactory = System.getProperty(UNIT_FACTORY_PROPERTY);
+        if (unitFactory != null) {
+            defaultProperties.put(UNIT_FACTORY_PROPERTY, unitFactory);
+        }
+    }
+
+    /**
+     * Configures default properties.
+     */
+    protected void configureDefaultProperties() {
+        if (!defaultProperties.containsKey(DATA_SOURCE_FACTORY_PROPERTY)) {
+            defaultProperties.put(
+                    DATA_SOURCE_FACTORY_PROPERTY,
+                    JndiJpaDataSourceFactory.class.getName());
+        }
+
+        if (!defaultProperties.containsKey(TRANSACTION_TYPE_PROPERTY)) {
+            defaultProperties.put(
+                    TRANSACTION_TYPE_PROPERTY,
+                    PersistenceUnitTransactionType.JTA.name());
+        }
     }
 
     public EntityManagerFactory createEntityManagerFactory(String emName, Map map) {
 
         // TODO: Andrus, 2/11/2006 - cache loaded units (or factories)...
 
-        JpaPersistenceUnitInfo ui = getUnitLoader().getInfo(emName);
+        JpaUnit ui = getUnitLoader().loadUnit(emName);
 
         if (ui == null) {
             return null;
@@ -107,12 +140,12 @@
     /**
      * Returns unit loader, lazily creating it on first invocation.
      */
-    protected PersistenceUnitLoader getUnitLoader() {
+    protected UnitLoader getUnitLoader() {
         if (unitLoader == null) {
 
-            JpaPersistenceUnitInfoFactory factory = null;
+            JpaUnitFactory factory = null;
 
-            String unitFactoryName = getDefaultProperty(PERSISTENCE_UNIT_INFO_FACTORY_PROPERTY);
+            String unitFactoryName = getDefaultProperty(UNIT_FACTORY_PROPERTY);
             if (unitFactoryName != null) {
 
                 try {
@@ -120,7 +153,7 @@
                             .currentThread()
                             .getContextClassLoader());
 
-                    factory = (JpaPersistenceUnitInfoFactory) factoryClass.newInstance();
+                    factory = (JpaUnitFactory) factoryClass.newInstance();
                 }
                 catch (Exception e) {
                     throw new JpaProviderException("Error loading unit infor factory '"
@@ -129,7 +162,7 @@
                 }
             }
 
-            this.unitLoader = new PersistenceUnitLoader(factory, validateDescriptors);
+            this.unitLoader = new UnitLoader(factory, validateDescriptors);
         }
 
         return unitLoader;

Copied: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaUnit.java
(from r398457, incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfo.java)
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaUnit.java?p2=incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaUnit.java&p1=incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfo.java&r1=398457&r2=398461&rev=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfo.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaUnit.java
Sun Apr 30 16:27:26 2006
@@ -31,12 +31,12 @@
 import org.apache.cayenne.jpa.JpaProviderException;
 
 /**
- * A java bean that provides access to persistent unit properties per
- * <code>javax.persistence.spi.PersistenceUnitInfo</code> interface.
+ * A <code>javax.persistence.spi.PersistenceUnitInfo</code> implementor used
by Cayenne
+ * JPA provider.
  * 
  * @author Andrus Adamchik
  */
-public class JpaPersistenceUnitInfo implements PersistenceUnitInfo {
+public class JpaUnit implements PersistenceUnitInfo {
 
     // spec defaults
     static final PersistenceUnitTransactionType DEFAULT_TRANSACTION_TYPE = PersistenceUnitTransactionType.JTA;
@@ -53,7 +53,7 @@
     // properties not exposed directly
     protected ClassLoader classLoader;
 
-    public JpaPersistenceUnitInfo() {
+    public JpaUnit() {
 
         this.mappingFileNames = new ArrayList<String>(2);
         this.jarFileUrls = new ArrayList<URL>(2);
@@ -72,9 +72,8 @@
 
     /**
      * Adds a {@link ClassTransformer} to the persistence unit. Default implementation
-     * does nothing, although a provider can defines a
-     * {@link JpaPersistenceUnitInfoFactory} to integrate with its own class loading
-     * mechanism.
+     * does nothing, although a provider can defines a {@link JpaUnitFactory} to integrate
+     * with its own class loading mechanism.
      * <h3>JPA Specification, 7.1.4:</h3>
      * Add a transformer supplied by the provider that will be called for every new class
      * definition or class redefinition that gets loaded by the loader returned by the

Copied: incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaUnitFactory.java
(from r398457, incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfoFactory.java)
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaUnitFactory.java?p2=incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaUnitFactory.java&p1=incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfoFactory.java&r1=398457&r2=398461&rev=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfoFactory.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/spi/JpaUnitFactory.java
Sun Apr 30 16:27:26 2006
@@ -16,14 +16,17 @@
 package org.apache.cayenne.jpa.spi;
 
 /**
- * A factory of JpaPersistenceUnitInfos.
+ * A factory of {@link org.apache.cayenne.jpa.spi.JpaUnit} instances. Custom factory can
+ * be configured by setting a
+ * {@link org.apache.cayenne.jpa.spi.JpaPersistenceProvider#UNIT_FACTORY_PROPERTY}
+ * property.
  * 
  * @author Andrus Adamchik
  */
-public interface JpaPersistenceUnitInfoFactory {
+public interface JpaUnitFactory {
 
     /**
      * Creates a new instance of JpaPersistenceUnitInfo.
      */
-    JpaPersistenceUnitInfo newUnitInfo();
+    JpaUnit newUnitInfo();
 }

Modified: incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/bridge/DataMapConverterTest.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/bridge/DataMapConverterTest.java?rev=398461&r1=398460&r2=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/bridge/DataMapConverterTest.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/bridge/DataMapConverterTest.java
Sun Apr 30 16:27:26 2006
@@ -19,7 +19,7 @@
 
 import org.apache.cayenne.jpa.conf.EntityMapAnnotationLoader;
 import org.apache.cayenne.jpa.conf.EntityMapDefaultsProcessor;
-import org.apache.cayenne.jpa.conf.JpaLoaderContext;
+import org.apache.cayenne.jpa.conf.EntityMapLoaderContext;
 import org.apache.cayenne.jpa.entity.cayenne.MockCayenneEntity1;
 import org.apache.cayenne.jpa.entity.cayenne.MockCayenneEntity2;
 import org.apache.cayenne.jpa.entity.cayenne.MockCayenneEntityMap1;
@@ -38,7 +38,7 @@
         // TODO: unsupported by DataMap
         // jpaMap.setCatalog("c1");
 
-        DataMap cayenneMap = new DataMapConverter().toDataMap("n1", new JpaLoaderContext(
+        DataMap cayenneMap = new DataMapConverter().toDataMap("n1", new EntityMapLoaderContext(
                 jpaMap));
         assertEquals("n1", cayenneMap.getName());
         assertEquals("p1", cayenneMap.getDefaultPackage());
@@ -50,7 +50,7 @@
      */
     public void testLoadClassMapping() throws Exception {
         JpaEntityMap map = new JpaEntityMap();
-        JpaLoaderContext context = new JpaLoaderContext(map);
+        EntityMapLoaderContext context = new EntityMapLoaderContext(map);
         EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(context);
 
         loader.loadClassMapping(MockCayenneEntity1.class);

Modified: incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoaderTest.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoaderTest.java?rev=398461&r1=398460&r2=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoaderTest.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoaderTest.java
Sun Apr 30 16:27:26 2006
@@ -46,7 +46,7 @@
     public void testSortAnnotations() throws Exception {
 
         EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(
-                new JpaLoaderContext(new JpaEntityMap()));
+                new EntityMapLoaderContext(new JpaEntityMap()));
 
         Annotation[] a1 = new Annotation[3];
         a1[0] = MockAnnotatedBean1.class.getAnnotation(NamedQuery.class);
@@ -66,7 +66,7 @@
      */
     public void testAttributeOverride() {
         JpaEntityMap map = new JpaEntityMap();
-        JpaLoaderContext context = new JpaLoaderContext(map);
+        EntityMapLoaderContext context = new EntityMapLoaderContext(map);
         EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(context);
         loader.loadClassMapping(MockAnnotatedBean2.class);
 
@@ -96,7 +96,7 @@
      */
     public void testLoadClassMapping() throws Exception {
         JpaEntityMap map = new JpaEntityMap();
-        JpaLoaderContext context = new JpaLoaderContext(map);
+        EntityMapLoaderContext context = new EntityMapLoaderContext(map);
         EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(context);
 
         loader.loadClassMapping(MockEntity1.class);

Modified: incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessorTest.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessorTest.java?rev=398461&r1=398460&r2=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessorTest.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessorTest.java
Sun Apr 30 16:27:26 2006
@@ -27,7 +27,7 @@
 public class EntityMapDefaultsProcessorTest extends TestCase {
 
     protected JpaEntity entity;
-    protected JpaLoaderContext context;
+    protected EntityMapLoaderContext context;
 
     @Override
     protected void setUp() throws Exception {
@@ -35,7 +35,7 @@
         assertFalse(Serializable.class.isAssignableFrom(MockAnnotatedBean3.class));
 
         JpaEntityMap map = new JpaEntityMap();
-        context = new JpaLoaderContext(map);
+        context = new EntityMapLoaderContext(map);
         EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(context);
         loader.loadClassMapping(MockAnnotatedBean1.class);
         loader.loadClassMapping(MockAnnotatedBean3.class);

Copied: incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/UnitDescriptorParserTest.java
(from r398457, incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/PersistenceDescriptorParserTest.java)
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/UnitDescriptorParserTest.java?p2=incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/UnitDescriptorParserTest.java&p1=incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/PersistenceDescriptorParserTest.java&r1=398457&r2=398461&rev=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/PersistenceDescriptorParserTest.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/conf/UnitDescriptorParserTest.java
Sun Apr 30 16:27:26 2006
@@ -13,7 +13,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.cayenne.jpa.spi;
+package org.apache.cayenne.jpa.conf;
 
 import java.io.InputStream;
 import java.net.URL;
@@ -24,14 +24,15 @@
 
 import junit.framework.TestCase;
 
-import org.apache.cayenne.jpa.conf.PersistenceDescriptorParser;
+import org.apache.cayenne.jpa.spi.JpaPersistenceProvider;
+import org.apache.cayenne.jpa.spi.JpaUnit;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXParseException;
 
-public class PersistenceDescriptorParserTest extends TestCase {
+public class UnitDescriptorParserTest extends TestCase {
 
     public void testSample1() throws Exception {
-        PersistenceDescriptorParser parser = new PersistenceDescriptorParser();
+        UnitDescriptorParser parser = new UnitDescriptorParser();
 
         URL root = new URL("file:///xyz");
         InputStream in = Thread
@@ -42,7 +43,7 @@
 
         assertEquals(1, units.size());
 
-        JpaPersistenceUnitInfo info = (JpaPersistenceUnitInfo) units.iterator().next();
+        JpaUnit info = (JpaUnit) units.iterator().next();
 
         assertEquals("OrderManagement", info.getPersistenceUnitName());
 
@@ -62,7 +63,7 @@
     }
 
     public void testSampleSchemaHeadersValidating() throws Exception {
-        PersistenceDescriptorParser parser = new PersistenceDescriptorParser(null, true);
+        UnitDescriptorParser parser = new UnitDescriptorParser(null, true);
 
         URL root = new URL("file:///xyz");
         InputStream in = Thread
@@ -73,7 +74,7 @@
 
         assertEquals(1, units.size());
 
-        JpaPersistenceUnitInfo info = (JpaPersistenceUnitInfo) units.iterator().next();
+        JpaUnit info = (JpaUnit) units.iterator().next();
 
         assertEquals("OrderManagement", info.getPersistenceUnitName());
 
@@ -93,7 +94,7 @@
     }
 
     public void testSample2() throws Exception {
-        PersistenceDescriptorParser parser = new PersistenceDescriptorParser();
+        UnitDescriptorParser parser = new UnitDescriptorParser();
 
         URL root = new URL("file:///xyz");
         InputStream in = Thread
@@ -106,7 +107,7 @@
 
         Iterator it = units.iterator();
         for (int i = 1; i <= 3; i++) {
-            JpaPersistenceUnitInfo info = (JpaPersistenceUnitInfo) it.next();
+            JpaUnit info = (JpaUnit) it.next();
 
             assertEquals("Unit" + i, info.getPersistenceUnitName());
             assertEquals(root, info.getPersistenceUnitRootUrl());
@@ -119,7 +120,7 @@
     }
 
     public void testSample3() throws Exception {
-        PersistenceDescriptorParser parser = new PersistenceDescriptorParser();
+        UnitDescriptorParser parser = new UnitDescriptorParser();
 
         URL root = new URL("file:///xyz");
         InputStream in = Thread
@@ -130,7 +131,7 @@
 
         assertEquals(1, units.size());
 
-        JpaPersistenceUnitInfo info = (JpaPersistenceUnitInfo) units.iterator().next();
+        JpaUnit info = (JpaUnit) units.iterator().next();
 
         assertEquals("OrderManagement4", info.getPersistenceUnitName());
         assertEquals(PersistenceUnitTransactionType.RESOURCE_LOCAL, info
@@ -151,7 +152,7 @@
     }
 
     public void testSampleSchemaHeaders() throws Exception {
-        PersistenceDescriptorParser parser = new PersistenceDescriptorParser();
+        UnitDescriptorParser parser = new UnitDescriptorParser();
 
         URL root = new URL("file:///xyz");
         InputStream in = Thread
@@ -162,7 +163,7 @@
 
         assertEquals(1, units.size());
 
-        JpaPersistenceUnitInfo info = (JpaPersistenceUnitInfo) units.iterator().next();
+        JpaUnit info = (JpaUnit) units.iterator().next();
 
         assertEquals("OrderManagement", info.getPersistenceUnitName());
 
@@ -182,7 +183,7 @@
     }
 
     public void testInvalidSample1() throws Exception {
-        PersistenceDescriptorParser parser = new PersistenceDescriptorParser(null, true);
+        UnitDescriptorParser parser = new UnitDescriptorParser(null, true);
 
         URL root = new URL("file:///xyz");
         InputStream in = Thread
@@ -201,7 +202,7 @@
     }
 
     public void testInvalidSample2() throws Exception {
-        PersistenceDescriptorParser parser = new PersistenceDescriptorParser(null, true);
+        UnitDescriptorParser parser = new UnitDescriptorParser(null, true);
 
         URL root = new URL("file:///xyz");
         InputStream in = Thread

Copied: incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/JpaUnitTest.java
(from r398457, incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfoTest.java)
URL: http://svn.apache.org/viewcvs/incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/JpaUnitTest.java?p2=incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/JpaUnitTest.java&p1=incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfoTest.java&r1=398457&r2=398461&rev=398461&view=diff
==============================================================================
--- incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/JpaPersistenceUnitInfoTest.java
(original)
+++ incubator/cayenne/jpa/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/spi/JpaUnitTest.java
Sun Apr 30 16:27:26 2006
@@ -23,11 +23,11 @@
 
 import junit.framework.TestCase;
 
-public class JpaPersistenceUnitInfoTest extends TestCase {
+public class JpaUnitTest extends TestCase {
 
     public void testTransactionType() {
 
-        JpaPersistenceUnitInfo info = new JpaPersistenceUnitInfo();
+        JpaUnit info = new JpaUnit();
         info.addProperties(Collections.singletonMap(
                 JpaPersistenceProvider.TRANSACTION_TYPE_PROPERTY,
                 PersistenceUnitTransactionType.JTA.name()));
@@ -41,7 +41,7 @@
     }
 
     public void testClassLoader() {
-        JpaPersistenceUnitInfo info = new JpaPersistenceUnitInfo();
+        JpaUnit info = new JpaUnit();
 
         ClassLoader topLoader = new URLClassLoader(new URL[0], Thread
                 .currentThread()
@@ -51,7 +51,7 @@
     }
 
     public void testGetNewTempClassLoader() {
-        JpaPersistenceUnitInfo info = new JpaPersistenceUnitInfo();
+        JpaUnit info = new JpaUnit();
 
         ClassLoader topLoader = new URLClassLoader(new URL[0], Thread
                 .currentThread()



Mime
View raw message