db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject svn commit: r524803 [2/2] - in /db/jdo/trunk/api20: src/java/javax/jdo/ src/schema/javax/jdo/ test/java/javax/jdo/ test/schema/jdoconfig.xml/ test/schema/jdoconfig.xml/Negative0/ test/schema/jdoconfig.xml/Negative0/META-INF/ test/schema/jdoconfig.xml/N...
Date Mon, 02 Apr 2007 15:42:44 GMT
Added: db/jdo/trunk/api20/test/java/javax/jdo/JDOHelperConfigTest.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/java/javax/jdo/JDOHelperConfigTest.java?view=auto&rev=524803
==============================================================================
--- db/jdo/trunk/api20/test/java/javax/jdo/JDOHelperConfigTest.java (added)
+++ db/jdo/trunk/api20/test/java/javax/jdo/JDOHelperConfigTest.java Mon Apr  2 08:42:42 2007
@@ -0,0 +1,382 @@
+/*
+ * 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 javax.jdo;
+
+import junit.framework.TestSuite;
+
+import javax.jdo.util.AbstractTest;
+import javax.jdo.util.BatchTestRunner;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Iterator;
+import java.util.Random;
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * Tests class javax.jdo.JDOHelper for META-INF/jdoconfig.xml compliance.
+ */
+public class JDOHelperConfigTest extends AbstractTest implements Constants {
+
+    public static void main(String args[]) {
+        BatchTestRunner.run(JDOHelperConfigTest.class);
+    }
+
+    public static TestSuite suite() {
+        return new TestSuite(JDOHelperConfigTest.class);
+    }
+
+    protected static String JDOCONFIG_CLASSPATH_PREFIX
+        = "test/schema/jdoconfig.xml";
+
+    protected static Random RANDOM = new Random(System.currentTimeMillis());
+
+    /**
+     * Tests JDOHelper.getPersistenceUnitProperties using file
+     * Positive0-jdoconfig.xml and PU name
+     * "persistence-unit-name.positive0.pmf0"
+     */
+    public void testGetNamedPMFProperties_positive0_pmf0() throws IOException {
+
+        ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Positive0");
+
+        ClassLoader loader = getClass().getClassLoader();
+
+        Map expected = prepareInitialExpectedMap("positive0.pmf0", 2);
+        String name = (String) expected.get(PROPERTY_PERSISTENCE_UNIT_NAME);
+
+        Map actual = JDOHelper.getPersistenceUnitProperties(name, loader);
+
+        assertNotNull("No properties found", actual);
+        assertEqualProperties(expected, actual);
+    }
+
+    /**
+     * Tests JDOHelper.getPersistenceUnitProperties using file
+     * Positive0-jdoconfig.xml and PU name
+     * "persistence-unit-name.positive0.pmf1"
+     */
+    public void testGetNamedPMFProperties_positive0_pmf1() throws IOException  {
+        ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Positive0");
+
+        ClassLoader loader = getClass().getClassLoader();
+
+        Map expected = prepareInitialExpectedMap("positive0.pmf1", 2);
+        String name = (String) expected.get(PROPERTY_PERSISTENCE_UNIT_NAME);
+
+        Map actual = JDOHelper.getPersistenceUnitProperties(name, loader);
+
+        assertNotNull("No properties found", actual);
+        assertEqualProperties(expected, actual);
+    }
+
+    /**
+     * Tests JDOHelper.getPersistenceUnitProperties using file
+     * Positive0-jdoconfig.xml and PU name
+     * "persistence-unit-name.positive0.pmf2"
+     */
+    public void testGetNamedPMFProperties_positive0_pmf2() throws IOException  {
+        ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Positive0");
+
+        ClassLoader loader = getClass().getClassLoader();
+
+        Map expected = prepareInitialExpectedMap("positive0.pmf2", 2);
+        String name = (String) expected.get(PROPERTY_PERSISTENCE_UNIT_NAME);
+
+        Map actual = JDOHelper.getPersistenceUnitProperties(name, loader);
+
+        assertNotNull("No properties found", actual);
+        assertEqualProperties(expected, actual);
+    }
+
+    /**
+     * Tests JDOHelper.getPersistenceUnitProperties using file
+     * Positive0-jdoconfig.xml and PU name
+     * "persistence-unit-name.positive0.pmf3"
+     */
+    public void testGetNamedPMFProperties_positive0_pmf3() throws IOException  {
+        ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Positive0");
+
+        ClassLoader loader = getClass().getClassLoader();
+
+        Map expected = prepareInitialExpectedMap("positive0.pmf3", 2, 2);
+        String name = (String) expected.get(PROPERTY_PERSISTENCE_UNIT_NAME);
+
+        Map actual = JDOHelper.getPersistenceUnitProperties(name, loader);
+
+        assertNotNull("No properties found", actual);
+        assertEqualProperties(expected, actual);
+    }
+
+    /**
+     * Tests JDOHelper.getPersistenceUnitProperties using file
+     * Positive0-jdoconfig.xml and PU name
+     * "persistence-unit-name.positive0.pmf4"
+     */
+    public void testGetNamedPMFProperties_positive0_pmf4() throws IOException  {
+        ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Positive0");
+
+        ClassLoader loader = getClass().getClassLoader();
+
+        Map expected = prepareInitialExpectedMap("positive0.pmf4", 0, 2);
+        String name = (String) expected.get(PROPERTY_PERSISTENCE_UNIT_NAME);
+
+        Map actual = JDOHelper.getPersistenceUnitProperties(name, loader);
+
+        assertNotNull("No properties found", actual);
+        assertEqualProperties(expected, actual);
+    }
+
+    public Map prepareInitialExpectedMap(String testVariant) {
+        return prepareInitialExpectedMap(testVariant, 0, 0);
+    }
+    public Map prepareInitialExpectedMap(String testVariant, int numListeners) {
+        return prepareInitialExpectedMap(testVariant, numListeners, 0);
+    }
+    public Map prepareInitialExpectedMap(
+        String testVariant,
+        int numListeners,
+        int numProperties
+    ) {
+        Map expected = new HashMap();
+
+        expected.put(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS,
+            PMF_ATTRIBUTE_CLASS + "." + testVariant);
+        expected.put(
+            PROPERTY_CONNECTION_DRIVER_NAME,
+            PMF_ATTRIBUTE_CONNECTION_DRIVER_NAME + "." + testVariant);
+        expected.put(
+            PROPERTY_CONNECTION_FACTORY_NAME,
+            PMF_ATTRIBUTE_CONNECTION_FACTORY_NAME + "." + testVariant);
+        expected.put(
+            PROPERTY_CONNECTION_FACTORY2_NAME,
+            PMF_ATTRIBUTE_CONNECTION_FACTORY2_NAME + "." + testVariant);
+        expected.put(
+            PROPERTY_CONNECTION_PASSWORD,
+            PMF_ATTRIBUTE_CONNECTION_PASSWORD + "." + testVariant);
+        expected.put(
+            PROPERTY_CONNECTION_URL,
+            PMF_ATTRIBUTE_CONNECTION_URL + "." + testVariant);
+        expected.put(
+            PROPERTY_CONNECTION_USER_NAME,
+            PMF_ATTRIBUTE_CONNECTION_USER_NAME + "." + testVariant);
+        expected.put(
+            PROPERTY_IGNORE_CACHE,
+            PMF_ATTRIBUTE_IGNORE_CACHE + "." + testVariant);
+        expected.put(
+            PROPERTY_MAPPING,
+            PMF_ATTRIBUTE_MAPPING + "." + testVariant);
+        expected.put(
+            PROPERTY_MULTITHREADED,
+            PMF_ATTRIBUTE_MULTITHREADED + "." + testVariant);
+        expected.put(
+            PROPERTY_NONTRANSACTIONAL_READ,
+            PMF_ATTRIBUTE_NONTRANSACTIONAL_READ + "." + testVariant);
+        expected.put(
+            PROPERTY_NONTRANSACTIONAL_WRITE,
+            PMF_ATTRIBUTE_NONTRANSACTIONAL_WRITE + "." + testVariant);
+        expected.put(
+            PROPERTY_OPTIMISTIC,
+            PMF_ATTRIBUTE_OPTIMISTIC + "." + testVariant);
+        expected.put(
+            PROPERTY_PERSISTENCE_UNIT_NAME,
+            PMF_ATTRIBUTE_PERSISTENCE_UNIT_NAME + "." + testVariant);
+        expected.put(
+            PROPERTY_RESTORE_VALUES,
+            PMF_ATTRIBUTE_RESTORE_VALUES + "." + testVariant);
+        expected.put(
+            PROPERTY_RETAIN_VALUES,
+            PMF_ATTRIBUTE_RETAIN_VALUES + "." + testVariant);
+        expected.put(
+            PROPERTY_DETACH_ALL_ON_COMMIT,
+            PMF_ATTRIBUTE_DETACH_ALL_ON_COMMIT + "." + testVariant);
+        expected.put(
+            PROPERTY_SERVER_TIMEZONE_ID,
+            PMF_ATTRIBUTE_ServerTimeZoneID + "." + testVariant);
+
+        // listeners
+        for (int i = 0; i < numListeners; i++) {
+            expected.put(
+                PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTENER +
+                    "listener." + testVariant + ".listener" + i,
+                "classes." + testVariant + ".classes" + i
+            );
+        }
+
+        // properties
+        for (int i = 0; i < numProperties; i++) {
+            expected.put(
+                "property." +  testVariant + ".name" + i,
+                "property." +  testVariant + ".value" + i
+            );
+        }
+
+        return expected;
+    }
+
+    static void assertEqualProperties(Map expected, Map actual) {
+        Iterator i = expected.entrySet().iterator();
+        while (i.hasNext()) {
+            Map.Entry entry = (Map.Entry) i.next();
+            String key = (String) entry.getKey();
+            String expectedValue = (String) entry.getValue();
+            String actualValue = (String) actual.get(key);
+
+            assertEquals(
+                "Actual property at key [" + key + "] with value [" +
+                    actualValue + "] not equal to expected value [" +
+                    expectedValue + "]",
+                expectedValue,
+                actualValue);
+        }
+    }
+
+    /**
+     * Tests JDOHelper.getPersistenceUnitProperties using file
+     * Positive0-jdoconfig.xml and PU name
+     * "persistence-unit-name.positive0.pmf0"
+     */
+    public void testDuplicatePUsInDifferentConfigFilesButNotRequested_positive1() throws
IOException {
+
+        ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Positive1/1a");
+        ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Positive1/1b");
+
+        ClassLoader loader = getClass().getClassLoader();
+
+        Map props = JDOHelper.getPersistenceUnitProperties(null);
+        assertNotNull(props);
+    }
+
+    public void testNegative_NoResourcesFound() {
+        String resource = "" + RANDOM.nextLong();
+
+        InputStream in =
+            getClass().getClassLoader().getResourceAsStream(resource);
+        assertNull(in);
+
+        // resource pretty much guaranteed not to exist
+        try {
+            JDOHelper.getPersistenceManagerFactory(resource);
+            fail("JDOHelper failed to throw JDOFatalUserException");
+        }
+        catch (JDOFatalUserException x) {
+            // happy path
+        }
+    }
+
+    public void testNegative0_EmptyJDOConfigXML() throws IOException  {
+        try {
+            ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Negative0");
+
+            JDOHelper.getPersistenceManagerFactory();
+            fail("JDOHelper failed to throw JDOFatalUserException");
+        }
+        catch (JDOFatalUserException x) {
+            // happy path
+        }
+    }
+    
+    public void testNegative1_NoPersistenceUnitsDefined() throws IOException  {
+        try {
+            ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Negative1");
+
+            JDOHelper.getPersistenceManagerFactory();
+            fail("JDOHelper failed to throw JDOFatalUserException");
+        }
+        catch (JDOFatalUserException x) {
+            // happy path
+        }
+    }
+
+    public void testNegative2_DuplicateAnonymousPersistenceUnitsInSameConfig()
+        throws IOException
+    {
+        try {
+            ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Negative2");
+
+            JDOHelper.getPersistenceManagerFactory();
+            fail("JDOHelper failed to throw JDOFatalUserException");
+        }
+        catch (JDOFatalUserException x) {
+            // happy path
+        }
+    }
+
+    public void testNegative3_DuplicateNamedPersistenceUnitsInSameConfig()
+        throws IOException
+    {
+        try {
+            ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Negative3");
+
+            JDOHelper.getPersistenceManagerFactory(
+                "persistence-unit-name.negative3");
+
+            fail("JDOHelper failed to throw JDOFatalUserException");
+        }
+        catch (JDOFatalUserException x) {
+            // happy path
+        }
+    }
+
+    public void testNegative4_DuplicatePUNamePropertyInAttributeAndElement()
+        throws IOException
+    {
+        try {
+            ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Negative4");
+
+            JDOHelper.getPersistenceManagerFactory(
+                "persistence-unit-name.negative4.value0");
+
+            fail("JDOHelper failed to throw JDOFatalUserException");
+        }
+        catch (JDOFatalUserException x) {
+            // happy path
+        }
+    }
+
+    public void testNegative5_DuplicatePropertyInAttributeAndElement()
+        throws IOException
+    {
+        try {
+            ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Negative5");
+
+            JDOHelper.getPersistenceManagerFactory();
+
+            fail("JDOHelper failed to throw JDOFatalUserException");
+        }
+        catch (JDOFatalUserException x) {
+            // happy path
+        }
+    }
+
+    public void testNegative6_DuplicatePUInDifferentConfigFiles()
+        throws IOException
+    {
+        try {
+            ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Negative6/6a");
+            ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + "/Negative6/6b");
+
+            JDOHelper.getPersistenceManagerFactory("persistence-unit-name.negative6");
+
+            fail("JDOHelper failed to throw JDOFatalUserException");
+        }
+        catch (JDOFatalUserException x) {
+            // happy path
+        }
+    }
+}

Added: db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative0/META-INF/jdoconfig.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative0/META-INF/jdoconfig.xml?view=auto&rev=524803
==============================================================================
    (empty)

Added: db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative1/META-INF/jdoconfig.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative1/META-INF/jdoconfig.xml?view=auto&rev=524803
==============================================================================
--- db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative1/META-INF/jdoconfig.xml (added)
+++ db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative1/META-INF/jdoconfig.xml Mon Apr
 2 08:42:42 2007
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jdoconfig
+        xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+    <!-- No PUs defined -->
+</jdoconfig>

Added: db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative2/META-INF/jdoconfig.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative2/META-INF/jdoconfig.xml?view=auto&rev=524803
==============================================================================
--- db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative2/META-INF/jdoconfig.xml (added)
+++ db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative2/META-INF/jdoconfig.xml Mon Apr
 2 08:42:42 2007
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jdoconfig
+        xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+    <!-- Duplicate anonymous PU present -->
+    <persistence-manager-factory/>
+    <persistence-manager-factory/>
+</jdoconfig>

Added: db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative3/META-INF/jdoconfig.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative3/META-INF/jdoconfig.xml?view=auto&rev=524803
==============================================================================
--- db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative3/META-INF/jdoconfig.xml (added)
+++ db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative3/META-INF/jdoconfig.xml Mon Apr
 2 08:42:42 2007
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Do not change any values in this file without also making changes to
+    JDOHelperConfigTest.java, as that file depends on the values in this one!
+-->
+<jdoconfig
+    xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
+
+    <!-- Duplicate named PU -->
+    <persistence-manager-factory
+        persistence-unit-name="persistence-unit-name.negative3"/>
+
+    <persistence-manager-factory
+        persistence-unit-name="persistence-unit-name.negative3"/>
+
+</jdoconfig>

Added: db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative4/META-INF/jdoconfig.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative4/META-INF/jdoconfig.xml?view=auto&rev=524803
==============================================================================
--- db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative4/META-INF/jdoconfig.xml (added)
+++ db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative4/META-INF/jdoconfig.xml Mon Apr
 2 08:42:42 2007
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Do not change any values in this file without also making changes to
+    JDOHelperConfigTest.java, as that file depends on the values in this one!
+-->
+<jdoconfig
+    xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
+
+    <!-- Duplicate PU name property in attribute & element -->
+    <persistence-manager-factory
+        persistence-unit-name="persistence-unit-name.negative4.value0">
+        <property
+            name="persistence-unit-name"
+            value="persistence-unit-name.negative4.value1"/>
+
+    </persistence-manager-factory>
+</jdoconfig>

Added: db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative5/META-INF/jdoconfig.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative5/META-INF/jdoconfig.xml?view=auto&rev=524803
==============================================================================
--- db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative5/META-INF/jdoconfig.xml (added)
+++ db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative5/META-INF/jdoconfig.xml Mon Apr
 2 08:42:42 2007
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Do not change any values in this file without also making changes to
+    JDOHelperConfigTest.java, as that file depends on the values in this one!
+-->
+<jdoconfig
+    xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
+
+    <!-- Duplicate property in attribute & element -->
+    <persistence-manager-factory
+        class="class.negative5.value0">
+        <property
+            name="class"
+            value="class.negative5.value1"/>
+
+    </persistence-manager-factory>
+</jdoconfig>

Added: db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative6/6a/META-INF/jdoconfig.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative6/6a/META-INF/jdoconfig.xml?view=auto&rev=524803
==============================================================================
--- db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative6/6a/META-INF/jdoconfig.xml (added)
+++ db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative6/6a/META-INF/jdoconfig.xml Mon Apr
 2 08:42:42 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Do not change any values in this file without also making changes to
+    JDOHelperConfigTest.java, as that file depends on the values in this one!
+-->
+<jdoconfig
+    xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
+
+    <!-- Duplicate PU in this file and another -->
+    <persistence-manager-factory
+        persistence-unit-name="persistence-unit-name.negative6"/>
+</jdoconfig>

Added: db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative6/6b/META-INF/jdoconfig.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative6/6b/META-INF/jdoconfig.xml?view=auto&rev=524803
==============================================================================
--- db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative6/6b/META-INF/jdoconfig.xml (added)
+++ db/jdo/trunk/api20/test/schema/jdoconfig.xml/Negative6/6b/META-INF/jdoconfig.xml Mon Apr
 2 08:42:42 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Do not change any values in this file without also making changes to
+    JDOHelperConfigTest.java, as that file depends on the values in this one!
+-->
+<jdoconfig
+    xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
+
+    <!-- Duplicate PU in this file and another -->
+    <persistence-manager-factory
+        persistence-unit-name="persistence-unit-name.negative6"/>
+</jdoconfig>

Added: db/jdo/trunk/api20/test/schema/jdoconfig.xml/Positive0/META-INF/jdoconfig.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/schema/jdoconfig.xml/Positive0/META-INF/jdoconfig.xml?view=auto&rev=524803
==============================================================================
--- db/jdo/trunk/api20/test/schema/jdoconfig.xml/Positive0/META-INF/jdoconfig.xml (added)
+++ db/jdo/trunk/api20/test/schema/jdoconfig.xml/Positive0/META-INF/jdoconfig.xml Mon Apr
 2 08:42:42 2007
@@ -0,0 +1,250 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Do not change any values in this file without also making changes to
+    JDOHelperConfigTest.java, as that file depends on the values in this one!
+-->
+<jdoconfig
+    xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
+
+    <!--
+        Basic PMF config using attributes & listeners with no nonstandard
+        properties.
+    -->
+    <persistence-manager-factory
+        class="class.positive0.pmf0"
+        connection-driver-name="connection-driver-name.positive0.pmf0"
+        connection-factory-name="connection-factory-name.positive0.pmf0"
+        connection-factory2-name="connection-factory2-name.positive0.pmf0"
+        connection-password="connection-password.positive0.pmf0"
+        connection-url="connection-url.positive0.pmf0"
+        connection-user-name="connection-user-name.positive0.pmf0"
+        ignore-cache="ignore-cache.positive0.pmf0"
+        mapping="mapping.positive0.pmf0"
+        multithreaded="multithreaded.positive0.pmf0"
+        nontransactional-read="nontransactional-read.positive0.pmf0"
+        nontransactional-write="nontransactional-write.positive0.pmf0"
+        optimistic="optimistic.positive0.pmf0"
+        persistence-unit-name="persistence-unit-name.positive0.pmf0"
+        restore-values="restore-values.positive0.pmf0"
+        retain-values="retain-values.positive0.pmf0"
+        detach-all-on-commit="detach-all-on-commit.positive0.pmf0"
+        server-time-zone-id="server-time-zone-id.positive0.pmf0">
+
+        <instance-lifecycle-listener
+            listener="listener.positive0.pmf0.listener0"
+            classes="classes.positive0.pmf0.classes0"
+            />
+        <instance-lifecycle-listener
+            listener="listener.positive0.pmf0.listener1"
+            classes="classes.positive0.pmf0.classes1"
+            />
+    </persistence-manager-factory>
+
+    <!--
+        Basic PMF config using only <property> elements with javax.jdo
+        properties and no nonstandard properties.
+    -->
+    <persistence-manager-factory>
+        <property
+            name="javax.jdo.PersistenceManagerFactoryClass"
+            value="class.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.ConnectionDriverName"
+            value="connection-driver-name.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.ConnectionFactoryName"
+            value="connection-factory-name.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.ConnectionFactory2Name"
+            value="connection-factory2-name.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.ConnectionPassword"
+            value="connection-password.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.ConnectionURL"
+            value="connection-url.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.ConnectionUserName"
+            value="connection-user-name.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.IgnoreCache"
+            value="ignore-cache.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.Mapping"
+            value="mapping.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.Multithreaded"
+            value="multithreaded.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.NontransactionalRead"
+            value="nontransactional-read.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.NontransactionalWrite"
+            value="nontransactional-write.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.Optimistic"
+            value="optimistic.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.PersistenceUnitName"
+            value="persistence-unit-name.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.DetachAllOnCommit"
+            value="detach-all-on-commit.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.RestoreValues"
+            value="restore-values.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.RetainValues"
+            value="retain-values.positive0.pmf1"/>
+        <property
+            name="javax.jdo.option.ServerTimeZoneID"
+            value="server-time-zone-id.positive0.pmf1"/>
+
+        <instance-lifecycle-listener
+            listener="listener.positive0.pmf1.listener0"
+            classes="classes.positive0.pmf1.classes0"
+            />
+        <instance-lifecycle-listener
+            listener="listener.positive0.pmf1.listener1"
+            classes="classes.positive0.pmf1.classes1"
+            />
+    </persistence-manager-factory>
+
+    <!--
+        PMF config that uses nested <property> elements with standard
+        attribute names instead of javax.jdo property names and no nonstandard
+        properties.
+    -->
+    <persistence-manager-factory>
+        <property
+            name="class"
+            value="class.positive0.pmf2"/>
+        <property
+            name="connection-driver-name"
+            value="connection-driver-name.positive0.pmf2"/>
+        <property
+            name="connection-factory-name"
+            value="connection-factory-name.positive0.pmf2"/>
+        <property
+            name="connection-factory2-name"
+            value="connection-factory2-name.positive0.pmf2"/>
+        <property
+            name="connection-password"
+            value="connection-password.positive0.pmf2"/>
+        <property
+            name="connection-url"
+            value="connection-url.positive0.pmf2"/>
+        <property
+            name="connection-user-name"
+            value="connection-user-name.positive0.pmf2"/>
+        <property
+            name="ignore-cache"
+            value="ignore-cache.positive0.pmf2"/>
+        <property
+            name="mapping"
+            value="mapping.positive0.pmf2"/>
+        <property
+            name="multithreaded"
+            value="multithreaded.positive0.pmf2"/>
+        <property
+            name="nontransactional-read"
+            value="nontransactional-read.positive0.pmf2"/>
+        <property
+            name="nontransactional-write"
+            value="nontransactional-write.positive0.pmf2"/>
+        <property
+            name="optimistic"
+            value="optimistic.positive0.pmf2"/>
+        <property
+            name="persistence-unit-name"
+            value="persistence-unit-name.positive0.pmf2"/>
+        <property
+            name="detach-all-on-commit"
+            value="detach-all-on-commit.positive0.pmf2"/>
+        <property
+            name="restore-values"
+            value="restore-values.positive0.pmf2"/>
+        <property
+            name="retain-values"
+            value="retain-values.positive0.pmf2"/>
+        <property
+            name="javax.jdo.option.ServerTimeZoneID"
+            value="server-time-zone-id.positive0.pmf2"/>
+
+        <instance-lifecycle-listener
+            listener="listener.positive0.pmf2.listener0"
+            classes="classes.positive0.pmf2.classes0"
+            />
+        <instance-lifecycle-listener
+            listener="listener.positive0.pmf2.listener1"
+            classes="classes.positive0.pmf2.classes1"
+            />
+    </persistence-manager-factory>
+
+    <!--
+        PMF config using standard attributes plus nonstandard properties in
+        <property> elements.
+    -->
+    <persistence-manager-factory
+        class="class.positive0.pmf3"
+        connection-driver-name="connection-driver-name.positive0.pmf3"
+        connection-factory-name="connection-factory-name.positive0.pmf3"
+        connection-factory2-name="connection-factory2-name.positive0.pmf3"
+        connection-password="connection-password.positive0.pmf3"
+        connection-url="connection-url.positive0.pmf3"
+        connection-user-name="connection-user-name.positive0.pmf3"
+        ignore-cache="ignore-cache.positive0.pmf3"
+        mapping="mapping.positive0.pmf3"
+        multithreaded="multithreaded.positive0.pmf3"
+        nontransactional-read="nontransactional-read.positive0.pmf3"
+        nontransactional-write="nontransactional-write.positive0.pmf3"
+        optimistic="optimistic.positive0.pmf3"
+        persistence-unit-name="persistence-unit-name.positive0.pmf3"
+        restore-values="restore-values.positive0.pmf3"
+        retain-values="retain-values.positive0.pmf3"
+        detach-all-on-commit="detach-all-on-commit.positive0.pmf3"
+        server-time-zone-id="server-time-zone-id.positive0.pmf3">
+
+        <property name="property.positive0.pmf3.name0"
+                  value="property.positive0.pmf3.value0"/>
+        <property name="property.positive0.pmf3.name1"
+                  value="property.positive0.pmf3.value1"/>
+
+        <instance-lifecycle-listener
+            listener="listener.positive0.pmf3.listener0"
+            classes="classes.positive0.pmf3.classes0"
+            />
+        <instance-lifecycle-listener
+            listener="listener.positive0.pmf3.listener1"
+            classes="classes.positive0.pmf3.classes1"
+            />
+    </persistence-manager-factory>
+
+    <!--
+        PMF config using standard attributes plus nonstandard attributes.
+    -->
+    <persistence-manager-factory
+        class="class.positive0.pmf4"
+        connection-driver-name="connection-driver-name.positive0.pmf4"
+        connection-factory-name="connection-factory-name.positive0.pmf4"
+        connection-factory2-name="connection-factory2-name.positive0.pmf4"
+        connection-password="connection-password.positive0.pmf4"
+        connection-url="connection-url.positive0.pmf4"
+        connection-user-name="connection-user-name.positive0.pmf4"
+        ignore-cache="ignore-cache.positive0.pmf4"
+        mapping="mapping.positive0.pmf4"
+        multithreaded="multithreaded.positive0.pmf4"
+        nontransactional-read="nontransactional-read.positive0.pmf4"
+        nontransactional-write="nontransactional-write.positive0.pmf4"
+        optimistic="optimistic.positive0.pmf4"
+        persistence-unit-name="persistence-unit-name.positive0.pmf4"
+        restore-values="restore-values.positive0.pmf4"
+        retain-values="retain-values.positive0.pmf4"
+        detach-all-on-commit="detach-all-on-commit.positive0.pmf4"
+        server-time-zone-id="server-time-zone-id.positive0.pmf4"
+
+        property.positive0.pmf4.name0="property.positive0.pmf4.value0"
+        property.positive0.pmf4.name1="property.positive0.pmf4.value1"/>
+</jdoconfig>

Added: db/jdo/trunk/api20/test/schema/jdoconfig.xml/Positive1/1a/META-INF/jdoconfig.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/schema/jdoconfig.xml/Positive1/1a/META-INF/jdoconfig.xml?view=auto&rev=524803
==============================================================================
--- db/jdo/trunk/api20/test/schema/jdoconfig.xml/Positive1/1a/META-INF/jdoconfig.xml (added)
+++ db/jdo/trunk/api20/test/schema/jdoconfig.xml/Positive1/1a/META-INF/jdoconfig.xml Mon Apr
 2 08:42:42 2007
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Do not change any values in this file without also making changes to
+    JDOHelperConfigTest.java, as that file depends on the values in this one!
+-->
+<jdoconfig
+    xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
+
+    <!-- Duplicate PUs in this file and another, but not requested -->
+    <persistence-manager-factory/>
+
+    <persistence-manager-factory
+        persistence-unit-name="persistence-unit-name.positive1"/>
+</jdoconfig>

Added: db/jdo/trunk/api20/test/schema/jdoconfig.xml/Positive1/1b/META-INF/jdoconfig.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/schema/jdoconfig.xml/Positive1/1b/META-INF/jdoconfig.xml?view=auto&rev=524803
==============================================================================
--- db/jdo/trunk/api20/test/schema/jdoconfig.xml/Positive1/1b/META-INF/jdoconfig.xml (added)
+++ db/jdo/trunk/api20/test/schema/jdoconfig.xml/Positive1/1b/META-INF/jdoconfig.xml Mon Apr
 2 08:42:42 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Do not change any values in this file without also making changes to
+    JDOHelperConfigTest.java, as that file depends on the values in this one!
+-->
+<jdoconfig
+    xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
+
+    <!-- Duplicate PUs in this file and another, but not requested -->
+    <persistence-manager-factory
+        persistence-unit-name="persistence-unit-name.positive1"/>
+</jdoconfig>



Mime
View raw message