cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [05/16] cayenne git commit: CAY-2335: New XML loading/saving mechanics with support of plugable handlers - new XML loader for DataMap - new project version - updated test projects
Date Tue, 25 Jul 2017 12:25:20 GMT
http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderTest.java
deleted file mode 100644
index a9c88b6..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderTest.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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.configuration;
-
-import org.apache.cayenne.ConfigurationException;
-import org.apache.cayenne.di.AdhocObjectFactory;
-import org.apache.cayenne.di.Binder;
-import org.apache.cayenne.di.ClassLoaderManager;
-import org.apache.cayenne.di.DIBootstrap;
-import org.apache.cayenne.di.Injector;
-import org.apache.cayenne.di.Module;
-import org.apache.cayenne.di.spi.DefaultAdhocObjectFactory;
-import org.apache.cayenne.di.spi.DefaultClassLoaderManager;
-import org.apache.cayenne.map.DataMap;
-import org.apache.cayenne.resource.URLResource;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.net.URL;
-import java.util.Collection;
-import java.util.Iterator;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-
-public class XMLDataChannelDescriptorLoaderTest {
-
-    private Injector injector;
-
-    @Before
-    public void setUp() throws Exception {
-        Module testModule = new Module() {
-
-            public void configure(Binder binder) {
-                binder.bind(ClassLoaderManager.class).to(DefaultClassLoaderManager.class);
-                binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
-                binder.bind(DataMapLoader.class).to(XMLDataMapLoader.class);
-                binder.bind(ConfigurationNameMapper.class).to(DefaultConfigurationNameMapper.class);
-            }
-        };
-
-        this.injector = DIBootstrap.createInjector(testModule);
-    }
-
-    @Test
-    public void testLoadEmpty() {
-
-        // create and initialize loader instance to test
-        XMLDataChannelDescriptorLoader loader = new XMLDataChannelDescriptorLoader();
-        injector.injectMembers(loader);
-
-        String testConfigName = "testConfig1";
-
-        URL url = getClass().getResource("cayenne-" + testConfigName + ".xml");
-        ConfigurationTree<DataChannelDescriptor> tree = loader.load(new URLResource(url));
-
-        assertNotNull(tree);
-        assertNotNull(tree.getRootNode());
-        assertEquals(testConfigName, tree.getRootNode().getName());
-    }
-
-    @Test
-    public void testLoad_MissingConfig() throws Exception {
-
-        // create and initialize loader instance to test
-        XMLDataChannelDescriptorLoader loader = new XMLDataChannelDescriptorLoader();
-        injector.injectMembers(loader);
-
-        try {
-            loader.load(new URLResource(new URL("file:///no_such_resource")));
-            fail("No exception was thrown on bad absent config name");
-        } catch (ConfigurationException e) {
-            // expected
-        }
-    }
-
-    @Test
-    public void testLoadDataMap() {
-
-        // create and initialize loader instance to test
-        XMLDataChannelDescriptorLoader loader = new XMLDataChannelDescriptorLoader();
-        injector.injectMembers(loader);
-
-        String testConfigName = "testConfig2";
-        URL url = getClass().getResource("cayenne-" + testConfigName + ".xml");
-
-        ConfigurationTree<DataChannelDescriptor> tree = loader.load(new URLResource(url));
-
-        assertNotNull(tree);
-        assertNotNull(tree.getRootNode());
-
-        assertEquals(testConfigName, tree.getRootNode().getName());
-
-        Collection<DataMap> maps = tree.getRootNode().getDataMaps();
-        assertEquals(1, maps.size());
-        assertEquals("testConfigMap2", maps.iterator().next().getName());
-    }
-
-    @Test
-    public void testLoadDataEverything() {
-
-        // create and initialize loader instance to test
-        XMLDataChannelDescriptorLoader loader = new XMLDataChannelDescriptorLoader();
-        injector.injectMembers(loader);
-
-        String testConfigName = "testConfig3";
-        URL url = getClass().getResource("cayenne-" + testConfigName + ".xml");
-
-        ConfigurationTree<DataChannelDescriptor> tree = loader.load(new URLResource(url));
-
-        assertNotNull(tree);
-
-        DataChannelDescriptor descriptor = tree.getRootNode();
-        assertNotNull(descriptor);
-        assertEquals(testConfigName, descriptor.getName());
-
-        Collection<DataMap> maps = descriptor.getDataMaps();
-        assertEquals(2, maps.size());
-
-        Iterator<DataMap> mapsIt = maps.iterator();
-
-        DataMap map1 = mapsIt.next();
-        DataMap map2 = mapsIt.next();
-
-        assertEquals("testConfigMap3_1", map1.getName());
-        assertEquals("testConfigMap3_2", map2.getName());
-
-        Collection<DataNodeDescriptor> nodes = descriptor.getNodeDescriptors();
-        assertEquals(1, nodes.size());
-
-        DataNodeDescriptor node1 = nodes.iterator().next();
-        assertEquals("testConfigNode3", node1.getName());
-        assertNull(node1.getParameters());
-        assertNotNull(node1.getDataSourceDescriptor());
-        assertEquals(1, node1.getDataSourceDescriptor().getMinConnections());
-        assertEquals(1, node1.getDataSourceDescriptor().getMaxConnections());
-
-        assertEquals("org.example.test.Adapter", node1.getAdapterType());
-        assertEquals("org.example.test.DataSourceFactory", node1.getDataSourceFactoryType());
-        assertEquals("org.example.test.SchemaUpdateStartegy", node1.getSchemaUpdateStrategyType());
-        assertNotNull(node1.getDataMapNames());
-
-        assertEquals(1, node1.getDataMapNames().size());
-
-        assertEquals("testConfigMap3_2", node1.getDataMapNames().iterator().next());
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/BaseHandlerTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/BaseHandlerTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/BaseHandlerTest.java
new file mode 100644
index 0000000..4cefbff
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/BaseHandlerTest.java
@@ -0,0 +1,76 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.configuration.xml;
+
+import java.io.InputStream;
+
+import org.apache.cayenne.util.Util;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * @since 4.1
+ */
+public abstract class BaseHandlerTest {
+
+    protected void parse(String tag, HandlerFactory factory) throws Exception {
+        try(InputStream in = DbKeyGeneratorHandlerTest.class.getResource(getClass().getSimpleName() + ".xml").openStream()) {
+            XMLReader parser = Util.createXmlReader();
+            DefaultHandler handler = new TestRootHandler(parser, tag, factory);
+            parser.setContentHandler(handler);
+            parser.parse(new InputSource(in));
+        }
+    }
+
+    public interface HandlerFactory {
+        NamespaceAwareNestedTagHandler createHandler(NamespaceAwareNestedTagHandler parent);
+    }
+
+    public static class TestRootHandler extends NamespaceAwareNestedTagHandler {
+
+        private String rootTag;
+        private BaseHandlerTest.HandlerFactory factory;
+
+        public TestRootHandler(XMLReader parser, String rootTag, BaseHandlerTest.HandlerFactory factory) {
+            super(new LoaderContext(parser, new DefaultHandlerFactory()));
+            setTargetNamespace("");
+            this.rootTag = rootTag;
+            this.factory = factory;
+        }
+
+        @Override
+        protected boolean processElement(String namespaceURI, String localName, Attributes attributes) throws SAXException {
+            return false;
+        }
+
+        @Override
+        protected ContentHandler createChildTagHandler(String namespaceURI, String localName, String qName, Attributes attributes) {
+            if(localName.equals(rootTag)) {
+                return factory.createHandler(this);
+            }
+            return super.createChildTagHandler(namespaceURI, localName, qName, attributes);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/DbEntityHandlerTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/DbEntityHandlerTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/DbEntityHandlerTest.java
new file mode 100644
index 0000000..1a7da41
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/DbEntityHandlerTest.java
@@ -0,0 +1,82 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.configuration.xml;
+
+import java.sql.Types;
+
+import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.map.DbAttribute;
+import org.apache.cayenne.map.DbEntity;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * @since 4.1
+ */
+public class DbEntityHandlerTest extends BaseHandlerTest {
+
+    @Test
+    public void testLoad() throws Exception {
+
+        final DataMap map = new DataMap();
+        assertTrue(map.getDbEntities().isEmpty());
+
+        parse("db-entity", new HandlerFactory() {
+            @Override
+            public NamespaceAwareNestedTagHandler createHandler(NamespaceAwareNestedTagHandler parent) {
+                return new DbEntityHandler(parent, map);
+            }
+        });
+
+        assertEquals(1, map.getDbEntities().size());
+
+        DbEntity entity = map.getDbEntity("ARTGROUP");
+        assertNotNull(entity);
+        assertNull(entity.getPrimaryKeyGenerator());
+        assertEquals(3, entity.getAttributes().size());
+        assertEquals("catalog", entity.getCatalog());
+        assertEquals("schema", entity.getSchema());
+        assertEquals("name = \"test\"", entity.getQualifier().toString());
+
+        DbAttribute attribute = entity.getAttribute("GROUP_ID");
+        assertNotNull(attribute);
+        assertTrue(attribute.isMandatory());
+        assertTrue(attribute.isPrimaryKey());
+        assertTrue(attribute.isGenerated());
+        assertEquals(Types.INTEGER, attribute.getType());
+
+        attribute = entity.getAttribute("NAME");
+        assertNotNull(attribute);
+        assertTrue(attribute.isMandatory());
+        assertFalse(attribute.isPrimaryKey());
+        assertFalse(attribute.isGenerated());
+        assertEquals(100, attribute.getMaxLength());
+        assertEquals(Types.VARCHAR, attribute.getType());
+
+        attribute = entity.getAttribute("PARENT_GROUP_ID");
+        assertNotNull(attribute);
+        assertFalse(attribute.isMandatory());
+        assertFalse(attribute.isPrimaryKey());
+        assertFalse(attribute.isGenerated());
+        assertEquals(10, attribute.getScale());
+        assertEquals(Types.BIT, attribute.getType());
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/DbKeyGeneratorHandlerTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/DbKeyGeneratorHandlerTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/DbKeyGeneratorHandlerTest.java
new file mode 100644
index 0000000..157f8d0
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/DbKeyGeneratorHandlerTest.java
@@ -0,0 +1,51 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.configuration.xml;
+
+import org.apache.cayenne.map.DbEntity;
+import org.apache.cayenne.map.DbKeyGenerator;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * @since 4.1
+ */
+public class DbKeyGeneratorHandlerTest extends BaseHandlerTest {
+
+    @Test
+    public void testParsing()throws Exception {
+        final DbEntity dbEntity = new DbEntity("TEST");
+
+        parse("db-key-generator", new HandlerFactory() {
+            @Override
+            public NamespaceAwareNestedTagHandler createHandler(NamespaceAwareNestedTagHandler parent) {
+                return new DbKeyGeneratorHandler(parent, dbEntity);
+            }
+        });
+
+        assertNotNull(dbEntity.getPrimaryKeyGenerator());
+        assertEquals("gallery_seq", dbEntity.getPrimaryKeyGenerator().getGeneratorName());
+        assertEquals(20, (int)dbEntity.getPrimaryKeyGenerator().getKeyCacheSize());
+        assertEquals(DbKeyGenerator.ORACLE_TYPE, dbEntity.getPrimaryKeyGenerator().getGeneratorType());
+    }
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/DbRelationshipHandlerTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/DbRelationshipHandlerTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/DbRelationshipHandlerTest.java
new file mode 100644
index 0000000..4aba0cb
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/DbRelationshipHandlerTest.java
@@ -0,0 +1,58 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.configuration.xml;
+
+import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.map.DbEntity;
+import org.apache.cayenne.map.DbRelationship;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * @since 4.1
+ */
+public class DbRelationshipHandlerTest extends BaseHandlerTest {
+
+    @Test
+    public void testParsing()throws Exception {
+        final DataMap map = new DataMap();
+        DbEntity entity = new DbEntity("ARTIST");
+        map.addDbEntity(entity);
+        assertEquals(0, entity.getRelationships().size());
+
+        parse("db-relationship", new HandlerFactory() {
+            @Override
+            public NamespaceAwareNestedTagHandler createHandler(NamespaceAwareNestedTagHandler parent) {
+                return new DbRelationshipHandler(parent, map);
+            }
+        });
+
+        assertEquals(1, entity.getRelationships().size());
+        DbRelationship relationship = entity.getRelationship("artistPaintings");
+        assertNotNull(relationship);
+
+        assertEquals("PAINTING", relationship.getTargetEntityName());
+        assertTrue(relationship.isToDependentPK());
+        assertTrue(relationship.isToMany());
+        assertEquals("ID", relationship.getJoins().get(0).getSourceName());
+        assertEquals("ARTIST_ID", relationship.getJoins().get(0).getTargetName());
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/ObjEntityHandlerTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/ObjEntityHandlerTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/ObjEntityHandlerTest.java
new file mode 100644
index 0000000..963bb9a
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/ObjEntityHandlerTest.java
@@ -0,0 +1,86 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.configuration.xml;
+
+import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.map.ObjAttribute;
+import org.apache.cayenne.map.ObjEntity;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * @since 4.1
+ */
+public class ObjEntityHandlerTest extends BaseHandlerTest {
+
+    @Test
+    public void testLoad() throws Exception {
+
+        final DataMap map = new DataMap();
+        assertEquals(0, map.getObjEntities().size());
+
+        parse("obj-entity", new HandlerFactory() {
+            @Override
+            public NamespaceAwareNestedTagHandler createHandler(NamespaceAwareNestedTagHandler parent) {
+                return new ObjEntityHandler(parent, map);
+            }
+        });
+
+        assertEquals(1, map.getObjEntities().size());
+        ObjEntity entity = map.getObjEntity("ArtistCallback");
+        assertNotNull(entity);
+        assertTrue(entity.isAbstract());
+        assertTrue(entity.isReadOnly());
+        assertTrue(entity.isServerOnly());
+        assertFalse(entity.isClientAllowed());
+        assertEquals(3, entity.getAttributes().size());
+        assertEquals(8, entity.getCallbackMethods().size());
+        assertEquals(ObjEntity.LOCK_TYPE_OPTIMISTIC, entity.getDeclaredLockType());
+        assertEquals("org.apache.cayenne.testdo.testmap.ArtistCallback", entity.getClassName());
+        assertNull("super.class should be suppressed by super entity", entity.getSuperClassName());
+        assertEquals("Artist", entity.getSuperEntityName());
+        assertEquals("client.class", entity.getClientClassName());
+        assertNull("client.super.class should be suppressed by super entity", entity.getClientSuperClassName());
+        assertEquals("ARTIST_CT", entity.getDbEntityName());
+
+        ObjAttribute attribute = entity.getAttribute("artistName");
+        assertNotNull(attribute);
+        assertEquals("NAME", attribute.getDbAttributeName());
+        assertEquals("java.lang.String", attribute.getType());
+        assertTrue(attribute.isUsedForLocking());
+
+        attribute = entity.getAttribute("dateOfBirth");
+        assertNotNull(attribute);
+        assertNull(attribute.getDbAttributeName());
+        assertEquals("java.util.Date", attribute.getType());
+        assertFalse(attribute.isUsedForLocking());
+
+        attribute = entity.getAttribute("embeddable1");
+        assertNotNull(attribute);
+        assertNull(attribute.getDbAttributeName());
+        assertEquals("org.apache.cayenne.testdo.embeddable.Embeddable1", attribute.getType());
+        assertFalse(attribute.isUsedForLocking());
+
+        String override = entity.getDeclaredAttributeOverrides().get("name");
+        assertEquals("parent.child.name", override);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/ObjRelationshipHandlerTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/ObjRelationshipHandlerTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/ObjRelationshipHandlerTest.java
new file mode 100644
index 0000000..2765955
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/ObjRelationshipHandlerTest.java
@@ -0,0 +1,61 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.configuration.xml;
+
+import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.map.DeleteRule;
+import org.apache.cayenne.map.ObjEntity;
+import org.apache.cayenne.map.ObjRelationship;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * @since 4.1
+ */
+public class ObjRelationshipHandlerTest extends BaseHandlerTest {
+
+    @Test
+    public void testLoad() throws Exception {
+
+        final DataMap map = new DataMap();
+        ObjEntity entity = new ObjEntity("ArtGroup");
+        map.addObjEntity(entity);
+        assertEquals(0, entity.getRelationships().size());
+
+
+        parse("obj-relationship", new HandlerFactory() {
+            @Override
+            public NamespaceAwareNestedTagHandler createHandler(NamespaceAwareNestedTagHandler parent) {
+                return new ObjRelationshipHandler(parent, map);
+            }
+        });
+
+        assertEquals(1, entity.getRelationships().size());
+        ObjRelationship relationship = entity.getRelationship("artistArray");
+        assertNotNull(relationship);
+
+        assertEquals(DeleteRule.CASCADE, relationship.getDeleteRule());
+        assertEquals("java.util.Map", relationship.getCollectionType());
+        assertEquals("artistName", relationship.getMapKey());
+        assertEquals("Artist", relationship.getTargetEntityName());
+        assertTrue(relationship.isUsedForLocking());
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoaderTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoaderTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoaderTest.java
new file mode 100644
index 0000000..fab4129
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/XMLDataChannelDescriptorLoaderTest.java
@@ -0,0 +1,171 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.configuration.xml;
+
+import org.apache.cayenne.ConfigurationException;
+import org.apache.cayenne.configuration.ConfigurationNameMapper;
+import org.apache.cayenne.configuration.ConfigurationTree;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
+import org.apache.cayenne.configuration.DataMapLoader;
+import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.configuration.DefaultConfigurationNameMapper;
+import org.apache.cayenne.di.AdhocObjectFactory;
+import org.apache.cayenne.di.Binder;
+import org.apache.cayenne.di.ClassLoaderManager;
+import org.apache.cayenne.di.DIBootstrap;
+import org.apache.cayenne.di.Injector;
+import org.apache.cayenne.di.Module;
+import org.apache.cayenne.di.spi.DefaultAdhocObjectFactory;
+import org.apache.cayenne.di.spi.DefaultClassLoaderManager;
+import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.resource.URLResource;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.net.URL;
+import java.util.Collection;
+import java.util.Iterator;
+
+import static org.junit.Assert.*;
+
+public class XMLDataChannelDescriptorLoaderTest {
+
+    private Injector injector;
+
+    @Before
+    public void setUp() throws Exception {
+        Module testModule = new Module() {
+
+            public void configure(Binder binder) {
+                binder.bind(ClassLoaderManager.class).to(DefaultClassLoaderManager.class);
+                binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
+                binder.bind(DataMapLoader.class).to(XMLDataMapLoader.class);
+                binder.bind(ConfigurationNameMapper.class).to(DefaultConfigurationNameMapper.class);
+                binder.bind(HandlerFactory.class).to(DefaultHandlerFactory.class);
+                binder.bind(DataChannelMetaData.class).to(NoopDataChannelMetaData.class);
+
+            }
+        };
+
+        this.injector = DIBootstrap.createInjector(testModule);
+    }
+
+    @Test
+    public void testLoadEmpty() {
+
+        // create and initialize loader instance to test
+        XMLDataChannelDescriptorLoader loader = new XMLDataChannelDescriptorLoader();
+        injector.injectMembers(loader);
+
+        String testConfigName = "testConfig1";
+
+        URL url = getClass().getResource("cayenne-" + testConfigName + ".xml");
+        ConfigurationTree<DataChannelDescriptor> tree = loader.load(new URLResource(url));
+
+        assertNotNull(tree);
+        assertNotNull(tree.getRootNode());
+        assertEquals(testConfigName, tree.getRootNode().getName());
+    }
+
+    @Test
+    public void testLoad_MissingConfig() throws Exception {
+
+        // create and initialize loader instance to test
+        XMLDataChannelDescriptorLoader loader = new XMLDataChannelDescriptorLoader();
+        injector.injectMembers(loader);
+
+        try {
+            loader.load(new URLResource(new URL("file:///no_such_resource")));
+            fail("No exception was thrown on bad absent config name");
+        } catch (ConfigurationException e) {
+            // expected
+        }
+    }
+
+    @Test
+    public void testLoadDataMap() {
+
+        // create and initialize loader instance to test
+        XMLDataChannelDescriptorLoader loader = new XMLDataChannelDescriptorLoader();
+        injector.injectMembers(loader);
+
+        String testConfigName = "testConfig2";
+        URL url = getClass().getResource("cayenne-" + testConfigName + ".xml");
+
+        ConfigurationTree<DataChannelDescriptor> tree = loader.load(new URLResource(url));
+
+        assertNotNull(tree);
+        assertNotNull(tree.getRootNode());
+
+        assertEquals(testConfigName, tree.getRootNode().getName());
+
+        Collection<DataMap> maps = tree.getRootNode().getDataMaps();
+        assertEquals(1, maps.size());
+        assertEquals("testConfigMap2", maps.iterator().next().getName());
+    }
+
+    @Test
+    public void testLoadDataEverything() {
+
+        // create and initialize loader instance to test
+        XMLDataChannelDescriptorLoader loader = new XMLDataChannelDescriptorLoader();
+        injector.injectMembers(loader);
+
+        String testConfigName = "testConfig3";
+        URL url = getClass().getResource("cayenne-" + testConfigName + ".xml");
+
+        ConfigurationTree<DataChannelDescriptor> tree = loader.load(new URLResource(url));
+
+        assertNotNull(tree);
+
+        DataChannelDescriptor descriptor = tree.getRootNode();
+        assertNotNull(descriptor);
+        assertEquals(testConfigName, descriptor.getName());
+
+        Collection<DataMap> maps = descriptor.getDataMaps();
+        assertEquals(2, maps.size());
+
+        Iterator<DataMap> mapsIt = maps.iterator();
+
+        DataMap map1 = mapsIt.next();
+        DataMap map2 = mapsIt.next();
+
+        assertEquals("testConfigMap3_1", map1.getName());
+        assertEquals("testConfigMap3_2", map2.getName());
+
+        Collection<DataNodeDescriptor> nodes = descriptor.getNodeDescriptors();
+        assertEquals(1, nodes.size());
+
+        DataNodeDescriptor node1 = nodes.iterator().next();
+        assertEquals("testConfigNode3", node1.getName());
+        assertNull(node1.getParameters());
+        assertNotNull(node1.getDataSourceDescriptor());
+        assertEquals(1, node1.getDataSourceDescriptor().getMinConnections());
+        assertEquals(1, node1.getDataSourceDescriptor().getMaxConnections());
+
+        assertEquals("org.example.test.Adapter", node1.getAdapterType());
+        assertEquals("org.example.test.DataSourceFactory", node1.getDataSourceFactoryType());
+        assertEquals("org.example.test.SchemaUpdateStartegy", node1.getSchemaUpdateStrategyType());
+        assertNotNull(node1.getDataMapNames());
+
+        assertEquals(1, node1.getDataMapNames().size());
+
+        assertEquals("testConfigMap3_2", node1.getDataMapNames().iterator().next());
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/XMLDataMapLoaderTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/XMLDataMapLoaderTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/XMLDataMapLoaderTest.java
new file mode 100644
index 0000000..e416774
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/xml/XMLDataMapLoaderTest.java
@@ -0,0 +1,158 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.configuration.xml;
+
+import java.net.URL;
+
+import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.configuration.ConfigurationNameMapper;
+import org.apache.cayenne.configuration.DataMapLoader;
+import org.apache.cayenne.configuration.DefaultConfigurationNameMapper;
+import org.apache.cayenne.di.AdhocObjectFactory;
+import org.apache.cayenne.di.Binder;
+import org.apache.cayenne.di.ClassLoaderManager;
+import org.apache.cayenne.di.DIBootstrap;
+import org.apache.cayenne.di.Injector;
+import org.apache.cayenne.di.Module;
+import org.apache.cayenne.di.spi.DefaultAdhocObjectFactory;
+import org.apache.cayenne.di.spi.DefaultClassLoaderManager;
+import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.map.DbAttribute;
+import org.apache.cayenne.map.SQLTemplateDescriptor;
+import org.apache.cayenne.resource.URLResource;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class XMLDataMapLoaderTest {
+
+    private Injector injector;
+
+    private DataMapLoader loader;
+
+    @Before
+    public void setUp() throws Exception {
+        Module testModule = new Module() {
+
+            public void configure(Binder binder) {
+                binder.bind(ClassLoaderManager.class).to(DefaultClassLoaderManager.class);
+                binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
+                binder.bind(DataMapLoader.class).to(XMLDataMapLoader.class);
+                binder.bind(ConfigurationNameMapper.class).to(DefaultConfigurationNameMapper.class);
+                binder.bind(HandlerFactory.class).to(DefaultHandlerFactory.class);
+                binder.bind(DataChannelMetaData.class).to(NoopDataChannelMetaData.class);
+            }
+        };
+
+        injector = DIBootstrap.createInjector(testModule);
+        loader = injector.getInstance(DataMapLoader.class);
+    }
+
+    @Test(expected = CayenneRuntimeException.class)
+    public void loadMissingConfig() throws Exception {
+        loader.load(new URLResource(new URL("file:/no_such_file_for_map_xml")));
+    }
+
+    @Test
+    public void loadEmptyConfig() throws Exception {
+        URL url = getClass().getResource("testConfigMap2.map.xml");
+        DataMap map = loader.load(new URLResource(url));
+
+        assertNotNull(map);
+        assertEquals("testConfigMap2", map.getName());
+        assertTrue(map.getDbEntities().isEmpty());
+        assertTrue(map.getObjEntities().isEmpty());
+        assertTrue(map.getProcedures().isEmpty());
+        assertTrue(map.getQueryDescriptors().isEmpty());
+        assertTrue(map.getEmbeddables().isEmpty());
+        assertNull(map.getDefaultCatalog());
+        assertNull(map.getDefaultSchema());
+        assertNull(map.getDefaultPackage());
+        assertFalse(map.isClientSupported());
+    }
+
+    @Test
+    public void loadFullDataMap() {
+        URL url = getClass().getResource("testConfigMap4.map.xml");
+        DataMap map = loader.load(new URLResource(url));
+
+        assertNotNull(map);
+        assertEquals("testConfigMap4", map.getName());
+
+        // check general state
+        assertEquals(12, map.getDbEntities().size());
+        assertEquals(17, map.getObjEntities().size());
+        assertEquals(4, map.getProcedures().size());
+        assertEquals(14, map.getQueryDescriptors().size());
+        assertEquals(1, map.getEmbeddables().size());
+        assertEquals("TEST_CATALOG", map.getDefaultCatalog());
+        assertNull(map.getDefaultSchema());
+        assertEquals("org.apache.cayenne.testdo.testmap", map.getDefaultPackage());
+        assertTrue(map.isClientSupported());
+
+        // check some loaded content
+        assertEquals("org.apache.cayenne.testdo.testmap.Artist",
+                map.getObjEntity("Artist").getClassName());
+        assertEquals(5,
+                map.getObjEntity("CompoundPainting").getAttributes().size());
+        assertEquals(3,
+                map.getObjEntity("Artist").getRelationships().size());
+        assertEquals(7,
+                map.getObjEntity("ArtistCallback").getCallbackMethods().size());
+
+        assertEquals("name = \"test\"",
+                map.getDbEntity("ARTGROUP").getQualifier().toString());
+        assertEquals(4,
+                map.getDbEntity("EXHIBIT").getAttributes().size());
+        assertEquals(3,
+                map.getDbEntity("PAINTING").getRelationships().size());
+        assertEquals("gallery_seq",
+                map.getDbEntity("GALLERY").getPrimaryKeyGenerator().getGeneratorName());
+
+        DbAttribute pk1 = map.getDbEntity("EXHIBIT").getAttribute("EXHIBIT_ID");
+        assertFalse(pk1.isGenerated());
+        assertTrue(pk1.isPrimaryKey());
+
+        DbAttribute pk2 = map.getDbEntity("GENERATED_COLUMN").getAttribute("GENERATED_COLUMN");
+        assertTrue(pk2.isGenerated());
+        assertTrue(pk2.isPrimaryKey());
+
+        assertEquals(true,
+                map.getProcedure("cayenne_tst_out_proc").isReturningValue());
+        assertEquals(1,
+                map.getProcedure("cayenne_tst_out_proc").getCallOutParameters().size());
+        assertEquals(2,
+                map.getProcedure("cayenne_tst_out_proc").getCallParameters().size());
+
+        assertEquals("true",
+                map.getQueryDescriptor("EjbqlQueryTest")
+                        .getProperty("cayenne.GenericSelectQuery.fetchingDataRows"));
+
+        SQLTemplateDescriptor descriptor = (SQLTemplateDescriptor)map.getQueryDescriptor("NonSelectingQuery");
+        assertEquals("INSERT INTO PAINTING (PAINTING_ID, PAINTING_TITLE, ESTIMATED_PRICE) " +
+                        "VALUES (512, 'No Painting Like This', 12.5)",
+                descriptor.getAdapterSql().get("org.apache.cayenne.dba.db2.DB2Adapter"));
+
+        assertEquals("TEST",
+                map.getEmbeddable("org.apache.cayenne.testdo.Embeddable")
+                        .getAttribute("test").getDbAttributeName());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/map/DataMapTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/DataMapTest.java b/cayenne-server/src/test/java/org/apache/cayenne/map/DataMapTest.java
index 87be992..cf81326 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/DataMapTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/DataMapTest.java
@@ -19,16 +19,21 @@
 
 package org.apache.cayenne.map;
 
+import org.apache.cayenne.configuration.ConfigurationNodeVisitor;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
+import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.configuration.EmptyConfigurationNodeVisitor;
+import org.apache.cayenne.configuration.xml.XMLDataMapLoader;
+import org.apache.cayenne.resource.URLResource;
 import org.apache.cayenne.util.Util;
 import org.apache.cayenne.util.XMLEncoder;
 import org.junit.Test;
-import org.xml.sax.InputSource;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.io.PrintWriter;
 import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
+import java.net.URL;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
@@ -40,6 +45,8 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
 /**
  * DataMap unit tests.
@@ -187,7 +194,7 @@ public class DataMapTest {
         try {
             map.addObjEntity(e2);
             fail("Should not be able to add more than one entity with the same name");
-        } catch (Exception e) {
+        } catch (Exception ignored) {
         }
     }
 
@@ -403,10 +410,10 @@ public class DataMapTest {
         assertNotNull(proceduresCollection);
         assertEquals(len, proceduresCollection.size());
 
-        for (int i = 0; i < len; i++) {
-            Procedure proc = map.getProcedure(expectedNames[i]);
+        for (String expectedName : expectedNames) {
+            Procedure proc = map.getProcedure(expectedName);
             assertNotNull(proc);
-            assertEquals(expectedNames[i], proc.getName());
+            assertEquals(expectedName, proc.getName());
         }
     }
 
@@ -416,32 +423,38 @@ public class DataMapTest {
         map.setQuotingSQLIdentifiers(true);
         StringWriter w = new StringWriter();
         XMLEncoder encoder = new XMLEncoder(new PrintWriter(w));
-        map.encodeAsXML(encoder);
+        map.encodeAsXML(encoder, new EmptyConfigurationNodeVisitor());
 
         assertTrue(map.quotingSQLIdentifiers);
 
-        MapLoader loader = new MapLoader();
+        XMLDataMapLoader loader = new XMLDataMapLoader();
         try {
+            URL url = mock(URL.class);
             InputStream is = new ByteArrayInputStream(w.getBuffer().toString().getBytes("UTF-8"));
-            DataMap newMap = loader.loadDataMap(new InputSource(is));
+            when(url.openStream()).thenReturn(is);
+
+            DataMap newMap = loader.load(new URLResource(url));
             assertTrue(newMap.quotingSQLIdentifiers);
 
-        } catch (UnsupportedEncodingException e) {
+        } catch (Exception e) {
             e.printStackTrace();
         }
 
         map.setQuotingSQLIdentifiers(false);
         StringWriter w2 = new StringWriter();
         XMLEncoder encoder2 = new XMLEncoder(new PrintWriter(w2));
-        map.encodeAsXML(encoder2);
+        map.encodeAsXML(encoder2, new EmptyConfigurationNodeVisitor());
 
         assertFalse(map.quotingSQLIdentifiers);
         try {
-            InputStream is = new ByteArrayInputStream(w2.getBuffer().toString().getBytes("UTF-8"));
-            DataMap newMap = loader.loadDataMap(new InputSource(is));
+            URL url = mock(URL.class);
+            InputStream is = new ByteArrayInputStream(w.getBuffer().toString().getBytes("UTF-8"));
+            when(url.openStream()).thenReturn(is);
+
+            DataMap newMap = loader.load(new URLResource(url));
             assertFalse(newMap.quotingSQLIdentifiers);
 
-        } catch (UnsupportedEncodingException e) {
+        } catch (Exception e) {
             e.printStackTrace();
         }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java b/cayenne-server/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java
deleted file mode 100644
index 41529da..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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.map;
-
-import org.apache.cayenne.query.*;
-import org.apache.cayenne.test.file.FileUtil;
-import org.apache.cayenne.testdo.embeddable.Embeddable1;
-import org.apache.cayenne.testdo.testmap.Artist;
-import org.apache.cayenne.testdo.testmap.Gallery;
-import org.apache.cayenne.util.XMLEncoder;
-import org.junit.Test;
-import org.xml.sax.InputSource;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.PrintWriter;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-public class MapLoaderLoadTest {
-
-    private InputSource getMapXml(String mapName) {
-        return new InputSource(getClass().getClassLoader().getResourceAsStream(mapName));
-    }
-
-    @Test
-    public void testLoadEmbeddableMap() throws Exception {
-        MapLoader mapLoader = new MapLoader();
-        DataMap map = mapLoader.loadDataMap(getMapXml("embeddable.map.xml"));
-        assertNotNull(map);
-
-        assertEquals(1, map.getEmbeddables().size());
-        Embeddable e = map.getEmbeddable(Embeddable1.class.getName());
-        assertNotNull(e);
-        assertEquals(Embeddable1.class.getName(), e.getClassName());
-
-        assertEquals(2, e.getAttributes().size());
-        EmbeddableAttribute ea1 = e.getAttribute("embedded10");
-        assertNotNull(ea1);
-        assertEquals("embedded10", ea1.getName());
-        assertEquals("java.lang.String", ea1.getType());
-        assertEquals("EMBEDDED10", ea1.getDbAttributeName());
-
-        EmbeddableAttribute ea2 = e.getAttribute("embedded20");
-        assertNotNull(ea2);
-        assertEquals("embedded20", ea2.getName());
-        assertEquals("java.lang.String", ea2.getType());
-        assertEquals("EMBEDDED20", ea2.getDbAttributeName());
-
-        ObjEntity oe = map.getObjEntity("EmbedEntity1");
-        assertNotNull(oe);
-        assertEquals(3, oe.getDeclaredAttributes().size());
-
-        EmbeddedAttribute oea1 = (EmbeddedAttribute) oe.getAttribute("embedded1");
-        assertNotNull(oea1);
-        assertEquals(Embeddable1.class.getName(), oea1.getType());
-        assertEquals(0, oea1.getAttributeOverrides().size());
-
-        EmbeddedAttribute oea2 = (EmbeddedAttribute) oe.getAttribute("embedded2");
-        assertNotNull(oea2);
-        assertEquals(Embeddable1.class.getName(), oea2.getType());
-        assertEquals(2, oea2.getAttributeOverrides().size());
-    }
-
-    @Test
-    public void testLoadTestMap() throws Exception {
-        MapLoader mapLoader = new MapLoader();
-        DataMap map = mapLoader.loadDataMap(getMapXml("testmap.map.xml"));
-        assertNotNull(map);
-
-        // test procedures
-        Procedure procedure = map.getProcedure("cayenne_tst_upd_proc");
-        assertNotNull(procedure);
-        List<ProcedureParameter> params = procedure.getCallParameters();
-        assertNotNull(params);
-        assertEquals(1, params.size());
-        ProcedureParameter param = params.get(0);
-        assertNotNull(param);
-        assertEquals("paintingPrice", param.getName());
-        assertEquals(ProcedureParameter.IN_PARAMETER, param.getDirection());
-
-        // test super class name
-        // We expect the artist entity to have a super class name... test map should be
-        // set up in that way.
-        // No other assertions can be made (the actual super class may change)
-        ObjEntity ent = map.getObjEntity("Painting");
-        assertNotNull(ent.getSuperClassName());
-
-        //text exclude... parameters
-        ObjEntity artistCallbackTestEntity = map.getObjEntity("ArtistCallback");
-        assertTrue(artistCallbackTestEntity.isExcludingDefaultListeners());
-        assertTrue(artistCallbackTestEntity.isExcludingSuperclassListeners());
-
-        checkLoadedQueries(map);
-    }
-
-    @Test
-    public void testEncodeAsXML() throws FileNotFoundException {
-        // load map
-        MapLoader mapLoader = new MapLoader();
-        DataMap map = mapLoader.loadDataMap(getMapXml("testmap.map.xml"));
-        assertNotNull(map);
-
-        // encode map
-        File file = new File(FileUtil.baseTestDirectory(), "testmap_generated.map.xml");
-        PrintWriter pw = new PrintWriter(new FileOutputStream(file));
-        map.encodeAsXML(new XMLEncoder(pw));
-        pw.close();
-    }
-
-    private void checkLoadedQueries(DataMap map) throws Exception {
-        SelectQueryDescriptor queryWithQualifier = (SelectQueryDescriptor) map.getQueryDescriptor("QueryWithQualifier");
-        assertNotNull(queryWithQualifier);
-        assertTrue(queryWithQualifier.getRoot() instanceof ObjEntity);
-        assertEquals("Artist", ((Entity) queryWithQualifier.getRoot()).getName());
-        assertNotNull(queryWithQualifier.getQualifier());
-
-        SelectQueryDescriptor queryWithOrdering = (SelectQueryDescriptor) map.getQueryDescriptor("QueryWithOrdering");
-        assertNotNull(queryWithOrdering);
-        assertTrue(queryWithOrdering.getRoot() instanceof ObjEntity);
-        assertEquals("Artist", ((Entity) queryWithOrdering.getRoot()).getName());
-        assertEquals(2, queryWithOrdering.getOrderings().size());
-
-        Ordering artistNameOrdering = queryWithOrdering.getOrderings().get(0);
-        assertEquals(Artist.ARTIST_NAME.getName(), artistNameOrdering.getSortSpecString());
-        assertFalse(artistNameOrdering.isAscending());
-        assertTrue(artistNameOrdering.isCaseInsensitive());
-
-        Ordering dobOrdering = queryWithOrdering.getOrderings().get(1);
-        assertEquals(Artist.DATE_OF_BIRTH.getName(), dobOrdering.getSortSpecString());
-        assertTrue(dobOrdering.isAscending());
-        assertFalse(dobOrdering.isCaseInsensitive());
-
-        SelectQueryDescriptor queryWithPrefetch = (SelectQueryDescriptor) map.getQueryDescriptor("QueryWithPrefetch");
-        assertNotNull(queryWithPrefetch);
-        assertTrue(queryWithPrefetch.getRoot() instanceof ObjEntity);
-        assertEquals("Gallery", ((Entity) queryWithPrefetch.getRoot()).getName());
-        assertNotNull(queryWithPrefetch.getPrefetches());
-        assertEquals(1, queryWithPrefetch.getPrefetches().size());
-        assertTrue(queryWithPrefetch.getPrefetches().contains(Gallery.PAINTING_ARRAY.getName()));
-
-        QueryDescriptor nonSelectingQuery = map.getQueryDescriptor("NonSelectingQuery");
-        assertNotNull(nonSelectingQuery);
-        assertEquals("NonSelectingQuery", nonSelectingQuery.getName());
-        assertEquals("UPPER", nonSelectingQuery.getProperties().get("cayenne.SQLTemplate.columnNameCapitalization"));
-        
-        EJBQLQueryDescriptor ejbqlQueryTest = (EJBQLQueryDescriptor) map.getQueryDescriptor("EjbqlQueryTest");
-        assertNotNull(ejbqlQueryTest);
-        assertEquals("EjbqlQueryTest", ejbqlQueryTest.getName());
-        assertNotNull(ejbqlQueryTest.getEjbql());
-        assertEquals("SHARED_CACHE", ejbqlQueryTest.getProperties().get("cayenne.GenericSelectQuery.cacheStrategy"));
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/map/MockAttribute.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/MockAttribute.java b/cayenne-server/src/test/java/org/apache/cayenne/map/MockAttribute.java
index 22ce347..238b58b 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/MockAttribute.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/MockAttribute.java
@@ -19,7 +19,7 @@
 
 package org.apache.cayenne.map;
 
-import org.apache.cayenne.map.Attribute;
+import org.apache.cayenne.configuration.ConfigurationNodeVisitor;
 import org.apache.cayenne.util.XMLEncoder;
 
 /**
@@ -35,7 +35,7 @@ public class MockAttribute extends Attribute {
     }
 
     @Override
-    public void encodeAsXML(XMLEncoder encoder) {
+    public void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate) {
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/map/MockEntity.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/MockEntity.java b/cayenne-server/src/test/java/org/apache/cayenne/map/MockEntity.java
index 26840aa..cfbb739 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/MockEntity.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/MockEntity.java
@@ -22,6 +22,7 @@ package org.apache.cayenne.map;
 import java.util.Iterator;
 import java.util.Map;
 
+import org.apache.cayenne.configuration.ConfigurationNodeVisitor;
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.exp.ExpressionException;
 import org.apache.cayenne.util.XMLEncoder;
@@ -56,7 +57,8 @@ public class MockEntity extends Entity {
         return null;
     }
 
-    public void encodeAsXML(XMLEncoder encoder) {
+    @Override
+    public void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate) {
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/map/MockRelationship.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/MockRelationship.java b/cayenne-server/src/test/java/org/apache/cayenne/map/MockRelationship.java
index 2150bcf..2b89a34 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/MockRelationship.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/MockRelationship.java
@@ -19,6 +19,7 @@
 
 package org.apache.cayenne.map;
 
+import org.apache.cayenne.configuration.ConfigurationNodeVisitor;
 import org.apache.cayenne.util.XMLEncoder;
 
 public class MockRelationship extends Relationship {
@@ -36,7 +37,8 @@ public class MockRelationship extends Relationship {
         return null;
     }
 
-    public void encodeAsXML(XMLEncoder encoder) {
+    @Override
+    public void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate) {
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/map/ObjRelationshipIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/ObjRelationshipIT.java b/cayenne-server/src/test/java/org/apache/cayenne/map/ObjRelationshipIT.java
index bc8f7a5..29bfa35 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/ObjRelationshipIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/ObjRelationshipIT.java
@@ -20,7 +20,11 @@
 package org.apache.cayenne.map;
 
 import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.configuration.ConfigurationNodeVisitor;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.DataMapLoader;
+import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.configuration.EmptyConfigurationNodeVisitor;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.exp.ExpressionException;
@@ -89,7 +93,7 @@ public class ObjRelationshipIT extends ServerCase {
         r.setCollectionType("java.util.Map");
         r.setMapKey("bla");
 
-        r.encodeAsXML(encoder);
+        r.encodeAsXML(encoder, new EmptyConfigurationNodeVisitor());
         out.close();
 
         String lineBreak = System.getProperty("line.separator");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/map/QueryDescriptorLoaderTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/QueryDescriptorLoaderTest.java b/cayenne-server/src/test/java/org/apache/cayenne/map/QueryDescriptorLoaderTest.java
index 4ca4843..757acc3 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/QueryDescriptorLoaderTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/QueryDescriptorLoaderTest.java
@@ -47,7 +47,7 @@ public class QueryDescriptorLoaderTest {
         DbEntity entity = new DbEntity("DB1");
         map.addDbEntity(entity);
 
-        builder.setRoot(map, MapLoader.DB_ENTITY_ROOT, "DB1");
+        builder.setRoot(map, QueryDescriptor.DB_ENTITY_ROOT, "DB1");
         assertSame(entity, builder.getRoot());
     }
 
@@ -57,7 +57,7 @@ public class QueryDescriptorLoaderTest {
         ObjEntity entity = new ObjEntity("OBJ1");
         map.addObjEntity(entity);
 
-        builder.setRoot(map, MapLoader.OBJ_ENTITY_ROOT, "OBJ1");
+        builder.setRoot(map, QueryDescriptor.OBJ_ENTITY_ROOT, "OBJ1");
         assertSame(entity, builder.getRoot());
     }
 
@@ -65,7 +65,7 @@ public class QueryDescriptorLoaderTest {
     public void testSetRootDataMap() throws Exception {
         DataMap map = new DataMap("map");
 
-        builder.setRoot(map, MapLoader.DATA_MAP_ROOT, null);
+        builder.setRoot(map, QueryDescriptor.DATA_MAP_ROOT, null);
         assertSame(map, builder.getRoot());
     }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java
index b1b2495..dbf4bde 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java
@@ -20,11 +20,13 @@ package org.apache.cayenne.query;
 
 import org.apache.cayenne.DataRow;
 import org.apache.cayenne.access.DataContext;
+import org.apache.cayenne.configuration.EmptyConfigurationNodeVisitor;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.ejbql.EJBQLCompiledExpression;
 import org.apache.cayenne.ejbql.EJBQLException;
 import org.apache.cayenne.exp.Expression;
+import org.apache.cayenne.map.EJBQLQueryDescriptor;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
@@ -307,28 +309,16 @@ public class EJBQLQueryIT extends ServerCase {
         XMLEncoder e = new XMLEncoder(new PrintWriter(w));
 
         String separator = System.getProperty("line.separator");
+        String s = "<query name=\"" + name + "\" type=\"EJBQLQuery\">" + separator +
+                "<ejbql><![CDATA[" + ejbql + "]]></ejbql>" + separator +
+                "</query>" + separator;
 
-        StringBuffer s = new StringBuffer("<query name=\"");
-        s.append(name);
-        s.append("\" factory=\"");
-        s.append("org.apache.cayenne.map.EjbqlBuilder");
-        s.append("\">");
-        s.append(separator);
+        EJBQLQueryDescriptor descriptor = new EJBQLQueryDescriptor();
+        descriptor.setEjbql(ejbql);
+        descriptor.setName(name);
+        descriptor.encodeAsXML(e, new EmptyConfigurationNodeVisitor());
 
-        EJBQLQuery query = new EJBQLQuery(ejbql);
-
-        if (query.getEjbqlStatement() != null) {
-            s.append("<ejbql><![CDATA[");
-            s.append(query.getEjbqlStatement());
-            s.append("]]></ejbql>");
-        }
-        s.append(separator);
-        s.append("</query>");
-        s.append(separator);
-        query.setName(name);
-        query.encodeAsXML(e);
-
-        assertEquals(w.getBuffer().toString(), s.toString());
+        assertEquals(w.getBuffer().toString(), s);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/DBCleaner.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/DBCleaner.java b/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/DBCleaner.java
index af12a3d..04f8629 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/DBCleaner.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/DBCleaner.java
@@ -21,7 +21,7 @@ package org.apache.cayenne.unit.di.server;
 
 import org.apache.cayenne.configuration.ConfigurationTree;
 import org.apache.cayenne.configuration.DataChannelDescriptor;
-import org.apache.cayenne.configuration.XMLDataChannelDescriptorLoader;
+import org.apache.cayenne.configuration.xml.XMLDataChannelDescriptorLoader;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.map.DataMap;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/SchemaBuilder.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/SchemaBuilder.java b/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/SchemaBuilder.java
index 69c4400..a8d6ad0 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/SchemaBuilder.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/SchemaBuilder.java
@@ -28,6 +28,8 @@ import org.apache.cayenne.access.translator.batch.DefaultBatchTranslatorFactory;
 import org.apache.cayenne.access.translator.select.DefaultSelectTranslatorFactory;
 import org.apache.cayenne.ashwood.AshwoodEntitySorter;
 import org.apache.cayenne.cache.MapQueryCache;
+import org.apache.cayenne.configuration.xml.DefaultHandlerFactory;
+import org.apache.cayenne.configuration.xml.XMLDataMapLoader;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.event.DefaultEventManager;
@@ -35,15 +37,14 @@ import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
-import org.apache.cayenne.map.MapLoader;
 import org.apache.cayenne.map.Procedure;
+import org.apache.cayenne.resource.URLResource;
 import org.apache.cayenne.testdo.extended_type.StringET1ExtendedType;
 import org.apache.cayenne.unit.UnitDbAdapter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.xml.sax.InputSource;
 
-import java.io.InputStream;
+import java.net.URL;
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
 import java.sql.ResultSet;
@@ -113,10 +114,11 @@ public class SchemaBuilder {
 		DataMap[] maps = new DataMap[MAPS_REQUIRING_SCHEMA_SETUP.length];
 
 		for (int i = 0; i < maps.length; i++) {
-			InputStream stream = getClass().getClassLoader().getResourceAsStream(MAPS_REQUIRING_SCHEMA_SETUP[i]);
-			InputSource in = new InputSource(stream);
-			in.setSystemId(MAPS_REQUIRING_SCHEMA_SETUP[i]);
-			maps[i] = new MapLoader().loadDataMap(in);
+			URL mapURL = getClass().getClassLoader().getResource(MAPS_REQUIRING_SCHEMA_SETUP[i]);
+			XMLDataMapLoader loader = new XMLDataMapLoader();
+			loader.setHandlerFactory(new DefaultHandlerFactory());
+			maps[i] = loader.load(new URLResource(mapURL));
+
 		}
 
 		this.domain = new DataDomain("temp");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java b/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java
index ae4e01b..3386c1b 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java
@@ -52,10 +52,14 @@ import org.apache.cayenne.configuration.DefaultObjectStoreFactory;
 import org.apache.cayenne.configuration.DefaultRuntimeProperties;
 import org.apache.cayenne.configuration.ObjectStoreFactory;
 import org.apache.cayenne.configuration.RuntimeProperties;
-import org.apache.cayenne.configuration.XMLDataMapLoader;
 import org.apache.cayenne.configuration.server.DataSourceFactory;
 import org.apache.cayenne.configuration.server.ServerModule;
 import org.apache.cayenne.configuration.server.ServerRuntime;
+import org.apache.cayenne.configuration.xml.DataChannelMetaData;
+import org.apache.cayenne.configuration.xml.DefaultHandlerFactory;
+import org.apache.cayenne.configuration.xml.HandlerFactory;
+import org.apache.cayenne.configuration.xml.NoopDataChannelMetaData;
+import org.apache.cayenne.configuration.xml.XMLDataMapLoader;
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcAdapter;
@@ -198,6 +202,8 @@ public class ServerCaseModule implements Module {
         binder.bind(ObjectStoreFactory.class).to(DefaultObjectStoreFactory.class);
         binder.bind(DataMapLoader.class).to(XMLDataMapLoader.class);
         binder.bind(ConfigurationNameMapper.class).to(DefaultConfigurationNameMapper.class);
+        binder.bind(HandlerFactory.class).to(DefaultHandlerFactory.class);
+        binder.bind(DataChannelMetaData.class).to(NoopDataChannelMetaData.class);
 
         // test-scoped objects
         binder.bind(EntityResolver.class).toProvider(ServerCaseEntityResolverProvider.class).in(testScope);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/array-type.map.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/array-type.map.xml b/cayenne-server/src/test/resources/array-type.map.xml
index 8cc8f27..d5165eb 100644
--- a/cayenne-server/src/test/resources/array-type.map.xml
+++ b/cayenne-server/src/test/resources/array-type.map.xml
@@ -1,18 +1,18 @@
 <?xml version="1.0" encoding="utf-8"?>
-<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap http://cayenne.apache.org/schema/9/modelMap.xsd"
-          project-version="9">
-    <property name="defaultPackage" value="org.apache.cayenne.testdo.array_type"/>
-    <property name="defaultSuperclass" value="org.apache.cayenne.CayenneDataObject"/>
-    <property name="clientSupported" value="true"/>
-    <property name="defaultClientPackage" value="test.client"/>
-    <property name="defaultClientSuperclass" value="org.apache.cayenne.PersistentObject"/>
-    <db-entity name="ARRAY_TEST">
-        <db-attribute name="DOUBLE_ARRAY" type="VARBINARY" length="1024"/>
-        <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
-    </db-entity>
-    <obj-entity name="ArrayTestEntity" className="org.apache.cayenne.testdo.array_type.ArrayTestEntity" dbEntityName="ARRAY_TEST">
-        <obj-attribute name="doubleArray" type="java.lang.Double[]" db-attribute-path="DOUBLE_ARRAY"/>
-    </obj-entity>
+<data-map xmlns="http://cayenne.apache.org/schema/10/modelMap"
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	 xsi:schemaLocation="http://cayenne.apache.org/schema/10/modelMap http://cayenne.apache.org/schema/10/modelMap.xsd"
+	 project-version="10">
+	<property name="defaultPackage" value="org.apache.cayenne.testdo.array_type"/>
+	<property name="defaultSuperclass" value="org.apache.cayenne.CayenneDataObject"/>
+	<property name="clientSupported" value="true"/>
+	<property name="defaultClientPackage" value="test.client"/>
+	<property name="defaultClientSuperclass" value="org.apache.cayenne.PersistentObject"/>
+	<db-entity name="ARRAY_TEST">
+		<db-attribute name="DOUBLE_ARRAY" type="VARBINARY" length="1024"/>
+		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+	</db-entity>
+	<obj-entity name="ArrayTestEntity" className="org.apache.cayenne.testdo.array_type.ArrayTestEntity" dbEntityName="ARRAY_TEST">
+		<obj-attribute name="doubleArray" type="java.lang.Double[]" db-attribute-path="DOUBLE_ARRAY"/>
+	</obj-entity>
 </data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/binary-pk.map.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/binary-pk.map.xml b/cayenne-server/src/test/resources/binary-pk.map.xml
index cd53ff2..775b10f 100644
--- a/cayenne-server/src/test/resources/binary-pk.map.xml
+++ b/cayenne-server/src/test/resources/binary-pk.map.xml
@@ -1,34 +1,34 @@
 <?xml version="1.0" encoding="utf-8"?>
-<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap http://cayenne.apache.org/schema/9/modelMap.xsd"
-          project-version="9">
-    <property name="defaultPackage" value="org.apache.cayenne.testdo.binary_pk"/>
-    <property name="defaultSuperclass" value="org.apache.cayenne.CayenneDataObject"/>
-    <property name="clientSupported" value="true"/>
-    <property name="defaultClientPackage" value="test.client"/>
-    <property name="defaultClientSuperclass" value="org.apache.cayenne.PersistentObject"/>
-    <db-entity name="BINARY_PK_TEST1">
-        <db-attribute name="BIN_ID" type="VARBINARY" isPrimaryKey="true" isMandatory="true" length="32"/>
-        <db-attribute name="NAME" type="VARCHAR" length="10"/>
-    </db-entity>
-    <db-entity name="BINARY_PK_TEST2">
-        <db-attribute name="DETAIL_NAME" type="VARCHAR" length="10"/>
-        <db-attribute name="FK_ID" type="VARBINARY" length="32"/>
-        <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
-    </db-entity>
-    <obj-entity name="BinaryPKTest1" className="org.apache.cayenne.testdo.binary_pk.BinaryPKTest1" dbEntityName="BINARY_PK_TEST1">
-        <obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
-    </obj-entity>
-    <obj-entity name="BinaryPKTest2" className="org.apache.cayenne.testdo.binary_pk.BinaryPKTest2" dbEntityName="BINARY_PK_TEST2">
-        <obj-attribute name="detailName" type="java.lang.String" db-attribute-path="DETAIL_NAME"/>
-    </obj-entity>
-    <db-relationship name="binaryPKDetails" source="BINARY_PK_TEST1" target="BINARY_PK_TEST2" toMany="true">
-        <db-attribute-pair source="BIN_ID" target="FK_ID"/>
-    </db-relationship>
-    <db-relationship name="toBinaryPKMaster" source="BINARY_PK_TEST2" target="BINARY_PK_TEST1" toMany="false">
-        <db-attribute-pair source="FK_ID" target="BIN_ID"/>
-    </db-relationship>
-    <obj-relationship name="binaryPKDetails" source="BinaryPKTest1" target="BinaryPKTest2" db-relationship-path="binaryPKDetails"/>
-    <obj-relationship name="toBinaryPKMaster" source="BinaryPKTest2" target="BinaryPKTest1" db-relationship-path="toBinaryPKMaster"/>
+<data-map xmlns="http://cayenne.apache.org/schema/10/modelMap"
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	 xsi:schemaLocation="http://cayenne.apache.org/schema/10/modelMap http://cayenne.apache.org/schema/10/modelMap.xsd"
+	 project-version="10">
+	<property name="defaultPackage" value="org.apache.cayenne.testdo.binary_pk"/>
+	<property name="defaultSuperclass" value="org.apache.cayenne.CayenneDataObject"/>
+	<property name="clientSupported" value="true"/>
+	<property name="defaultClientPackage" value="test.client"/>
+	<property name="defaultClientSuperclass" value="org.apache.cayenne.PersistentObject"/>
+	<db-entity name="BINARY_PK_TEST1">
+		<db-attribute name="BIN_ID" type="VARBINARY" isPrimaryKey="true" isMandatory="true" length="32"/>
+		<db-attribute name="NAME" type="VARCHAR" length="10"/>
+	</db-entity>
+	<db-entity name="BINARY_PK_TEST2">
+		<db-attribute name="DETAIL_NAME" type="VARCHAR" length="10"/>
+		<db-attribute name="FK_ID" type="VARBINARY" length="32"/>
+		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+	</db-entity>
+	<obj-entity name="BinaryPKTest1" className="org.apache.cayenne.testdo.binary_pk.BinaryPKTest1" dbEntityName="BINARY_PK_TEST1">
+		<obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
+	</obj-entity>
+	<obj-entity name="BinaryPKTest2" className="org.apache.cayenne.testdo.binary_pk.BinaryPKTest2" dbEntityName="BINARY_PK_TEST2">
+		<obj-attribute name="detailName" type="java.lang.String" db-attribute-path="DETAIL_NAME"/>
+	</obj-entity>
+	<db-relationship name="binaryPKDetails" source="BINARY_PK_TEST1" target="BINARY_PK_TEST2" toMany="true">
+		<db-attribute-pair source="BIN_ID" target="FK_ID"/>
+	</db-relationship>
+	<db-relationship name="toBinaryPKMaster" source="BINARY_PK_TEST2" target="BINARY_PK_TEST1">
+		<db-attribute-pair source="FK_ID" target="BIN_ID"/>
+	</db-relationship>
+	<obj-relationship name="binaryPKDetails" source="BinaryPKTest1" target="BinaryPKTest2" db-relationship-path="binaryPKDetails"/>
+	<obj-relationship name="toBinaryPKMaster" source="BinaryPKTest2" target="BinaryPKTest1" db-relationship-path="toBinaryPKMaster"/>
 </data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/cay-2032.map.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/cay-2032.map.xml b/cayenne-server/src/test/resources/cay-2032.map.xml
index 9a3b380..00b3875 100644
--- a/cayenne-server/src/test/resources/cay-2032.map.xml
+++ b/cayenne-server/src/test/resources/cay-2032.map.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
-<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap"
+<data-map xmlns="http://cayenne.apache.org/schema/10/modelMap"
 	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	 xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap http://cayenne.apache.org/schema/9/modelMap.xsd"
-	 project-version="9">
+	 xsi:schemaLocation="http://cayenne.apache.org/schema/10/modelMap http://cayenne.apache.org/schema/10/modelMap.xsd"
+	 project-version="10">
 	<property name="defaultPackage" value="org.apache.cayenne.testdo.cay_2032"/>
 	<db-entity name="TEAM">
 		<db-attribute name="team_id" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
@@ -15,8 +15,7 @@
 		<db-attribute name="team_id" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
 		<db-attribute name="user_id" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
 	</db-entity>
-	<obj-entity name="Team" className="org.apache.cayenne.testdo.cay_2032.Team" dbEntityName="TEAM">
-	</obj-entity>
+	<obj-entity name="Team" className="org.apache.cayenne.testdo.cay_2032.Team" dbEntityName="TEAM"/>
 	<obj-entity name="User" className="org.apache.cayenne.testdo.cay_2032.User" dbEntityName="USERS">
 		<obj-attribute name="name" type="byte[]" db-attribute-path="name"/>
 	</obj-entity>
@@ -26,10 +25,10 @@
 	<db-relationship name="userHasTeam" source="USERS" target="USER_HAS_TEAM" toMany="true">
 		<db-attribute-pair source="user_id" target="user_id"/>
 	</db-relationship>
-	<db-relationship name="team" source="USER_HAS_TEAM" target="TEAM" toMany="false">
+	<db-relationship name="team" source="USER_HAS_TEAM" target="TEAM">
 		<db-attribute-pair source="team_id" target="team_id"/>
 	</db-relationship>
-	<db-relationship name="user" source="USER_HAS_TEAM" target="USERS" toMany="false">
+	<db-relationship name="user" source="USER_HAS_TEAM" target="USERS">
 		<db-attribute-pair source="user_id" target="user_id"/>
 	</db-relationship>
 	<obj-relationship name="teamUsers" source="Team" target="User" deleteRule="Deny" db-relationship-path="userHasTeam.user"/>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/cay743/cayenne-domain.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/cay743/cayenne-domain.xml b/cayenne-server/src/test/resources/cay743/cayenne-domain.xml
index 5909898..b69e50c 100644
--- a/cayenne-server/src/test/resources/cay743/cayenne-domain.xml
+++ b/cayenne-server/src/test/resources/cay743/cayenne-domain.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<domain project-version="9">
+<domain project-version="10">
 	<map name="map1"/>
 	<map name="map2"/>
 </domain>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/cay743/map1.map.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/cay743/map1.map.xml b/cayenne-server/src/test/resources/cay743/map1.map.xml
index d13c6d5..07a0754 100644
--- a/cayenne-server/src/test/resources/cay743/map1.map.xml
+++ b/cayenne-server/src/test/resources/cay743/map1.map.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
-<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap"
+<data-map xmlns="http://cayenne.apache.org/schema/10/modelMap"
 	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	 xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap http://cayenne.apache.org/schema/9/modelMap.xsd"
-	 project-version="9">
+	 xsi:schemaLocation="http://cayenne.apache.org/schema/10/modelMap http://cayenne.apache.org/schema/10/modelMap.xsd"
+	 project-version="10">
 	<obj-entity name="Entity11">
 	</obj-entity>
 	<obj-entity name="Entity12" superEntityName="Entity22">

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/cay743/map2.map.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/cay743/map2.map.xml b/cayenne-server/src/test/resources/cay743/map2.map.xml
index 43b5d19..aab2c64 100644
--- a/cayenne-server/src/test/resources/cay743/map2.map.xml
+++ b/cayenne-server/src/test/resources/cay743/map2.map.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
-<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap"
+<data-map xmlns="http://cayenne.apache.org/schema/10/modelMap"
 	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	 xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap http://cayenne.apache.org/schema/9/modelMap.xsd"
-	 project-version="9">
+	 xsi:schemaLocation="http://cayenne.apache.org/schema/10/modelMap http://cayenne.apache.org/schema/10/modelMap.xsd"
+	 project-version="10">
 	<obj-entity name="Entity21" superEntityName="Entity11">
 	</obj-entity>
 	<obj-entity name="Entity22">

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/cayenne-array-type.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/cayenne-array-type.xml b/cayenne-server/src/test/resources/cayenne-array-type.xml
index fdf8c4e..424431b 100644
--- a/cayenne-server/src/test/resources/cayenne-array-type.xml
+++ b/cayenne-server/src/test/resources/cayenne-array-type.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<domain project-version="9">
-    <map name="array-type"/>
+<domain xmlns="http://cayenne.apache.org/schema/10/domain"
+	 project-version="10">
+	<map name="array-type"/>
 </domain>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/cayenne-binary-pk.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/cayenne-binary-pk.xml b/cayenne-server/src/test/resources/cayenne-binary-pk.xml
index d6d21b2..ff071fa 100644
--- a/cayenne-server/src/test/resources/cayenne-binary-pk.xml
+++ b/cayenne-server/src/test/resources/cayenne-binary-pk.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<domain project-version="9">
-    <map name="binary-pk"/>
+<domain xmlns="http://cayenne.apache.org/schema/10/domain"
+	 project-version="10">
+	<map name="binary-pk"/>
 </domain>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/cayenne-cay-2032.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/cayenne-cay-2032.xml b/cayenne-server/src/test/resources/cayenne-cay-2032.xml
index f9427a7..5b19286 100644
--- a/cayenne-server/src/test/resources/cayenne-cay-2032.xml
+++ b/cayenne-server/src/test/resources/cayenne-cay-2032.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<domain project-version="9">
+<domain xmlns="http://cayenne.apache.org/schema/10/domain"
+	 project-version="10">
 	<map name="cay-2032"/>
 </domain>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/cayenne-compound.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/cayenne-compound.xml b/cayenne-server/src/test/resources/cayenne-compound.xml
index b82d21f..1445b53 100644
--- a/cayenne-server/src/test/resources/cayenne-compound.xml
+++ b/cayenne-server/src/test/resources/cayenne-compound.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<domain project-version="9">
-    <map name="compound"/>
+<domain xmlns="http://cayenne.apache.org/schema/10/domain"
+	 project-version="10">
+	<map name="compound"/>
 </domain>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/cayenne-date-time.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/cayenne-date-time.xml b/cayenne-server/src/test/resources/cayenne-date-time.xml
index 3fda070..9e67951 100644
--- a/cayenne-server/src/test/resources/cayenne-date-time.xml
+++ b/cayenne-server/src/test/resources/cayenne-date-time.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<domain project-version="9">
-    <map name="date-time"/>
+<domain xmlns="http://cayenne.apache.org/schema/10/domain"
+	 project-version="10">
+	<map name="date-time"/>
 </domain>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/cayenne-delete-rules.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/cayenne-delete-rules.xml b/cayenne-server/src/test/resources/cayenne-delete-rules.xml
index 606e583..7dd2bb4 100644
--- a/cayenne-server/src/test/resources/cayenne-delete-rules.xml
+++ b/cayenne-server/src/test/resources/cayenne-delete-rules.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<domain project-version="9">
-    <map name="delete-rules"/>
+<domain xmlns="http://cayenne.apache.org/schema/10/domain"
+	 project-version="10">
+	<map name="delete-rules"/>
 </domain>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/cayenne-embeddable.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/cayenne-embeddable.xml b/cayenne-server/src/test/resources/cayenne-embeddable.xml
index 8aa7459..aedacf3 100644
--- a/cayenne-server/src/test/resources/cayenne-embeddable.xml
+++ b/cayenne-server/src/test/resources/cayenne-embeddable.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<domain project-version="9">
-    <map name="embeddable"/>
+<domain xmlns="http://cayenne.apache.org/schema/10/domain"
+	 project-version="10">
+	<map name="embeddable"/>
 </domain>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c58b6f40/cayenne-server/src/test/resources/cayenne-empty.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/resources/cayenne-empty.xml b/cayenne-server/src/test/resources/cayenne-empty.xml
index 3ee43c4..b0b7614 100644
--- a/cayenne-server/src/test/resources/cayenne-empty.xml
+++ b/cayenne-server/src/test/resources/cayenne-empty.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<domain project-version="9">
-    <map name="empty"/>
+<domain xmlns="http://cayenne.apache.org/schema/10/domain"
+	 project-version="10">
+	<map name="empty"/>
 </domain>


Mime
View raw message