db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject svn commit: r1195022 [2/2] - in /db/jdo/branches/3.0.1: ./ api/ api/test/java/javax/jdo/ api/test/java/javax/jdo/stub/ api/test/java/javax/jdo/util/ api/test/schema/jdoconfig/Negative09/9b/META-INF/services/ api/test/schema/jdoconfig/Pmfmapmap01/META-I...
Date Sat, 29 Oct 2011 20:32:57 GMT
Modified: db/jdo/branches/3.0.1/api/test/java/javax/jdo/PMFMapMapTest.java
URL: http://svn.apache.org/viewvc/db/jdo/branches/3.0.1/api/test/java/javax/jdo/PMFMapMapTest.java?rev=1195022&r1=1195021&r2=1195022&view=diff
==============================================================================
--- db/jdo/branches/3.0.1/api/test/java/javax/jdo/PMFMapMapTest.java (original)
+++ db/jdo/branches/3.0.1/api/test/java/javax/jdo/PMFMapMapTest.java Sat Oct 29 20:32:56 2011
@@ -18,6 +18,7 @@ package javax.jdo;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.File;
 import java.net.MalformedURLException;
 
 import javax.jdo.util.AbstractTest;
@@ -33,18 +34,18 @@ import javax.jdo.util.BatchTestRunner;
 /**
  * 
  * Tests class javax.jdo.JDOHelper for calls to the impl's static method
- *  getPersistenceManagerFactory(Map overrides, Map props).
+ * getPersistenceManagerFactory(Map overrides, Map props).
  * 
  */
-public class PMFMapMapTest extends AbstractTest implements Constants {
+public class PMFMapMapTest extends AbstractJDOConfigTest {
 
     static String expectedDriverName = "Jane Doe";
     static String expectedDriverName4NamedPMF = "Larry";
     static String expectedDriverNameWithOverrides = "Gerard Manley Hopkins";
     static String PMFName = "BookSearch";
-    static String resourceDir = "Pmfmapmap01";
-    static String propsDir = "Pmfmapmap02";
-    static String pmfServiceClass = "javax.jdo.PMFService";
+    static String resourceDir = "/Pmfmapmap01/";
+    static String propsDir = "/Pmfmapmap02/";
+    static String pmfServiceClass = "javax.jdo.stub.StubPMF";
     static String propertiesFile = "propsfile.props";
     PersistenceManagerFactory pmf;
     Properties props;
@@ -53,455 +54,427 @@ public class PMFMapMapTest extends Abstr
     ClassLoader saveContextClassLoader;
 
     public static void main(String args[]) {
-        BatchTestRunner.run(PMFMapMapTest.class);
+	BatchTestRunner.run(PMFMapMapTest.class);
     }
 
     /**
      * {@inheritDoc}
+     * 
      * @return {@inheritDoc}
      */
     public static TestSuite suite() {
-        return new TestSuite(PMFMapMapTest.class);
+	return new TestSuite(PMFMapMapTest.class);
     }
 
-    public void setup() {
-    }
+    void setupResourceClassLoader(String dir) throws IOException {
 
-    public void teardown() {
-    }
+	switch (dir.charAt(dir.length() - 1)) {
+	case '\\':
+	    dir = dir.substring(0, dir.length() - 1) + '/';
+	    break;
+	case '/':
+	    break;
+	default:
+	    if (new File(dir).isDirectory()) {
+		dir += '/';
+	    }
+	}
 
-    void setupResourceClassLoader(String dir) {
-        try {
-            URL url = new URL(
-                    "file://" + JDOCONFIG_CLASSPATH_PREFIX + "/" + dir + "/");
-            resourceClassLoader = new URLClassLoader(new URL[]{url},
-                    getClass().getClassLoader());
-        } catch (MalformedURLException ex) {
-            ex.printStackTrace();
-        }
+	resourceClassLoader = new JDOConfigTestClassLoader(getClass()
+		.getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + dir);
     }
 
-    /**
-     * A class path prefix used in the various tests where the class path
-     * needs to be set.
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory() Get the
+     * anonymous PersistenceManagerFactory configured via the standard
+     * configuration file resource "META-INF/jdoconfig.xml", using the current
+     * thread's context class loader to locate the configuration file
+     * resource(s).
      */
-    protected static String JDOCONFIG_CLASSPATH_PREFIX = initJDOConfigClasspathPrefix();
+    public void testJDOConfigXML() throws IOException {
 
-    /**
-     * Returns the JDO configuration class path prefix's default value, which is
-     * the project base directory suffixed by the path to the configuration
-     * directory (<tt>test/schema/jdoconfig</tt>).
-     *
-     * @return the default class path prefix used by this test suite.
-     *
-     */
-    protected static String initJDOConfigClasspathPrefix() {
-        return initBasedir() + "test/schema/jdoconfig";
-    }
+	setupResourceClassLoader(resourceDir);
+	Thread.currentThread().setContextClassLoader(resourceClassLoader);
 
-    /**
-     * Returns the base directory for this project.  This base directory
-     * is used to build up the other class paths defined in this test suite.
-     * The value returned is the value returned by
-     * <code>System.getProperty("basedir")</code>.
-     * A trailing slash is appended to the path if it doesn't exist.
-     *
-     * @return the default base directory of the project.
-     */
-    protected static String initBasedir() {
-        String basedir = System.getProperty("basedir");
-        if (basedir != null) {
-            if (!basedir.endsWith("/")) {
-                basedir += "/";
-            }
-        } else {
-            basedir = "";
-        }
-        return basedir;
-    }
-
-    /* static PersistenceManagerFactory getPersistenceManagerFactory()
-    Get the anonymous PersistenceManagerFactory configured via the
-    standard configuration file resource "META-INF/jdoconfig.xml",
-    using the current thread's context class loader to locate the
-    configuration file resource(s).
-     */
-    public void testJDOConfigXML() {
-
-        setupResourceClassLoader(resourceDir);
-        Thread.currentThread().setContextClassLoader(resourceClassLoader);
-
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory();
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverName.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverName + "\"");
-        }
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory();
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass."
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverName.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverName + "\"");
+	}
     }
 
     /*
-    static PersistenceManagerFactory getPersistenceManagerFactory
-    (java.lang.ClassLoader pmfClassLoader)
-    Get the anonymous PersistenceManagerFactory configured via the
-    standard configuration file resource "META-INF/jdoconfig.xml",
-    using the given class loader.
+     * static PersistenceManagerFactory getPersistenceManagerFactory
+     * (java.lang.ClassLoader pmfClassLoader) Get the anonymous
+     * PersistenceManagerFactory configured via the standard configuration file
+     * resource "META-INF/jdoconfig.xml", using the given class loader.
      */
     public void testJDOConfigXMLWithLoader() throws IOException {
 
-        setupResourceClassLoader(resourceDir);
+	setupResourceClassLoader(resourceDir);
 
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(resourceClassLoader);
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverName.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverName + "\"");
-        }
-    }
-
-    /*
-    static PersistenceManagerFactory getPersistenceManagerFactory(
-    java.io.File propsFile)
-    Returns a PersistenceManagerFactory configured based on the properties
-    stored in the file at propsFile.
-     */
-    public void testPropsFile() {
-
-        setupResourceClassLoader(propsDir);
-        Thread.currentThread().setContextClassLoader(resourceClassLoader);
-
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(propertiesFile);
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverName.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverName + "\"");
-        }
-    }
-
-
-    /*
-    static PersistenceManagerFactory getPersistenceManagerFactory(
-    java.io.File propsFile, java.lang.ClassLoader loader)
-    Returns a PersistenceManagerFactory configured based on the properties
-    stored in the file at propsFile.
-     */
-    public void testPropsFileAndLoader() {
-
-        setupResourceClassLoader(propsDir);
-
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(propertiesFile,
-                    resourceClassLoader);
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverName.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverName + "\"");
-        }
-    }
-
-    /*
-    static PersistenceManagerFactory getPersistenceManagerFactory(
-    java.io.InputStream stream)
-    Returns a PersistenceManagerFactory configured based on the Properties
-    stored in the input stream at stream.
-     */
-    public void testInputStream() {
-        props = new Properties();
-        props.setProperty(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS,
-                pmfServiceClass);
-        props.setProperty(PROPERTY_CONNECTION_DRIVER_NAME,
-                expectedDriverName);
-
-        ByteArrayOutputStream outstream = new ByteArrayOutputStream();
-        try {
-            props.store(outstream, "");
-        } catch (IOException ex) {
-            fail(ex.getMessage());
-        }
-        InputStream byteArrayInputStream =
-                new ByteArrayInputStream(outstream.toByteArray());
-
-        setupResourceClassLoader(resourceDir);
-        Thread.currentThread().setContextClassLoader(resourceClassLoader);
-
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(byteArrayInputStream);
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverName.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverName + "\"");
-        }
-    }
-
-    /*
-    static PersistenceManagerFactory getPersistenceManagerFactory(
-    java.io.InputStream stream, java.lang.ClassLoader loader)
-    Returns a PersistenceManagerFactory configured based on the Properties
-    stored in the input stream at stream.
-     */
-    public void testInputStreamWithLoader() {
-        props = new Properties();
-        props.setProperty(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS,
-                pmfServiceClass);
-        props.setProperty(PROPERTY_CONNECTION_DRIVER_NAME,
-                expectedDriverName);
-
-        ByteArrayOutputStream outstream = new ByteArrayOutputStream();
-        try {
-            props.store(outstream, "");
-        } catch (IOException ex) {
-            fail(ex.getMessage());
-        }
-        InputStream byteArrayInputStream =
-                new ByteArrayInputStream(outstream.toByteArray());
-
-        setupResourceClassLoader(resourceDir);
-
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(byteArrayInputStream,
-                    resourceClassLoader);
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverName.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverName + "\"");
-        }
-    }
-
-    /*
-    static PersistenceManagerFactory getPersistenceManagerFactory(
-    java.util.Map<?,?> props)
-    Get a PersistenceManagerFactory based on a Properties instance,
-    using the current thread's context class loader to locate
-    the PersistenceManagerFactory class.
-     */
-    public void testProperties() {
-        props = new Properties();
-        props.setProperty(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS,
-                pmfServiceClass);
-        props.setProperty(PROPERTY_CONNECTION_DRIVER_NAME,
-                expectedDriverName);
-
-        setupResourceClassLoader(resourceDir);
-        Thread.currentThread().setContextClassLoader(resourceClassLoader);
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(props);
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverName.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverName + "\"");
-        }
-    }
-
-    /*
-    static PersistenceManagerFactory getPersistenceManagerFactory(
-    java.util.Map<?,?> props, java.lang.ClassLoader pmfClassLoader)
-    Get a PersistenceManagerFactory based on a Map and a class loader.
-     */
-    public void testPropertiesAndLoader() {
-        props = new Properties();
-        props.setProperty(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS,
-                pmfServiceClass);
-        props.setProperty(PROPERTY_CONNECTION_DRIVER_NAME,
-                expectedDriverName);
-
-        setupResourceClassLoader(resourceDir);
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(props,
-                    resourceClassLoader);
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverName.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverName + "\"");
-        }
-    }
-
-    /*
-    static PersistenceManagerFactory getPersistenceManagerFactory
-    (java.util.Map<?,?> overrides, java.lang.String name)
-    Returns a named PersistenceManagerFactory or persistence unit.
-     */
-    public void testNamedPMFWithOverrides() {
-        overrides = new Properties();
-        overrides.setProperty(PROPERTY_CONNECTION_DRIVER_NAME,
-                expectedDriverNameWithOverrides);
-
-        setupResourceClassLoader(resourceDir);
-        Thread.currentThread().setContextClassLoader(resourceClassLoader);
-
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(overrides, PMFName);
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverNameWithOverrides.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverNameWithOverrides + "\"");
-        }
-    }
-
-    /*
-    static PersistenceManagerFactory getPersistenceManagerFactory(
-    java.util.Map<?,?> overrides, java.lang.String name,
-    java.lang.ClassLoader resourceLoader)
-    Returns a named PersistenceManagerFactory or persistence unit.
-     */
-    public void testNamedPMFWithOverridesAndLoader() {
-        overrides = new Properties();
-        overrides.setProperty(PROPERTY_CONNECTION_DRIVER_NAME,
-                expectedDriverNameWithOverrides);
-
-        setupResourceClassLoader(resourceDir);
-
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(overrides, PMFName,
-                    resourceClassLoader);
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverNameWithOverrides.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverNameWithOverrides + "\"");
-        }
-    }
-
-    /*
-    static PersistenceManagerFactory getPersistenceManagerFactory(
-    java.util.Map<?,?> overrides, java.lang.String name,
-    java.lang.ClassLoader resourceLoader, java.lang.ClassLoader pmfLoader)
-    Returns a PersistenceManagerFactory configured based on the properties
-    stored in the resource at name, or, if not found,
-    returns a PersistenceManagerFactory with the given name or,
-    if not found, returns a javax.persistence.EntityManagerFactory
-    cast to a PersistenceManagerFactory.
-     */
-    public void testNamedPMFWithOverridesAndTwoLoaders() {
-        overrides = new Properties();
-        overrides.setProperty(PROPERTY_CONNECTION_DRIVER_NAME,
-                expectedDriverNameWithOverrides);
-
-        setupResourceClassLoader(resourceDir);
-
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(overrides, PMFName,
-                    resourceClassLoader,
-                    Thread.currentThread().getContextClassLoader());
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass. " + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverNameWithOverrides.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverNameWithOverrides + "\"");
-        }
-    }
-
-    /*
-    static PersistenceManagerFactory getPersistenceManagerFactory(
-    java.lang.String name)
-    Returns a named PersistenceManagerFactory or persistence unit.
-     */
-    public void testNamedPMF() {
-
-        setupResourceClassLoader(resourceDir);
-        Thread.currentThread().setContextClassLoader(resourceClassLoader);
-
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(PMFName);
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass. " + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverName4NamedPMF.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverName4NamedPMF + "\"");
-        }
-    }
-
-    /*
-    static PersistenceManagerFactory getPersistenceManagerFactory
-    (java.lang.String name, java.lang.ClassLoader loader)
-    Returns a named PersistenceManagerFactory or persistence unit.
-     */
-    public void testNamedPMFWithLoader() {
-
-        setupResourceClassLoader(resourceDir);
-
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(PMFName,
-                    resourceClassLoader);
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass. " + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverName4NamedPMF.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverName4NamedPMF + "\"");
-        }
-    }
-
-    /*
-    static PersistenceManagerFactory getPersistenceManagerFactory(
-    java.lang.String name, java.lang.ClassLoader resourceLoader,
-    java.lang.ClassLoader pmfLoader)
-    Returns a named PersistenceManagerFactory or persistence unit.
-     */
-    public void testNamedPMFWithTwoLoaders() {
-
-        setupResourceClassLoader(resourceDir);
-
-        try {
-            pmf = JDOHelper.getPersistenceManagerFactory(PMFName,
-                    resourceClassLoader,
-                    Thread.currentThread().getContextClassLoader());
-        } catch (JDOFatalUserException ex) {
-            fail("Failed to find PersistenceManagerFactoryClass. " + ex.getMessage());
-        }
-
-        String driverName = pmf.getConnectionDriverName();
-        if (!expectedDriverName4NamedPMF.equals(driverName)) {
-            fail("Bad ConnectionDriverName(): " + driverName + ".  Expected: \""
-                    + expectedDriverName4NamedPMF + "\"");
-        }
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(resourceClassLoader);
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass."
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverName.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverName + "\"");
+	}
+    }
+
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory(
+     * java.io.File propsFile) Returns a PersistenceManagerFactory configured
+     * based on the properties stored in the file at propsFile.
+     */
+    public void testPropsFile() throws IOException {
+
+	setupResourceClassLoader(propsDir);
+	Thread.currentThread().setContextClassLoader(resourceClassLoader);
+
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(propertiesFile);
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass."
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverName.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverName + "\"");
+	}
+    }
+
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory(
+     * java.io.File propsFile, java.lang.ClassLoader loader) Returns a
+     * PersistenceManagerFactory configured based on the properties stored in
+     * the file at propsFile.
+     */
+    public void testPropsFileAndLoader() throws IOException {
+
+	setupResourceClassLoader(propsDir);
+
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(propertiesFile,
+		    resourceClassLoader);
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass."
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverName.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverName + "\"");
+	}
+    }
+
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory(
+     * java.io.InputStream stream) Returns a PersistenceManagerFactory
+     * configured based on the Properties stored in the input stream at stream.
+     */
+    public void testInputStream() throws IOException {
+	props = new Properties();
+	props.setProperty(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS,
+		pmfServiceClass);
+	props.setProperty(PROPERTY_CONNECTION_DRIVER_NAME, expectedDriverName);
+
+	ByteArrayOutputStream outstream = new ByteArrayOutputStream();
+	try {
+	    props.store(outstream, "");
+	} catch (IOException ex) {
+	    fail(ex.getMessage());
+	}
+	InputStream byteArrayInputStream = new ByteArrayInputStream(
+		outstream.toByteArray());
+
+	setupResourceClassLoader(resourceDir);
+	Thread.currentThread().setContextClassLoader(resourceClassLoader);
+
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(byteArrayInputStream);
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass."
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverName.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverName + "\"");
+	}
+    }
+
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory(
+     * java.io.InputStream stream, java.lang.ClassLoader loader) Returns a
+     * PersistenceManagerFactory configured based on the Properties stored in
+     * the input stream at stream.
+     */
+    public void testInputStreamWithLoader() throws IOException {
+	props = new Properties();
+	props.setProperty(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS,
+		pmfServiceClass);
+	props.setProperty(PROPERTY_CONNECTION_DRIVER_NAME, expectedDriverName);
+
+	ByteArrayOutputStream outstream = new ByteArrayOutputStream();
+	try {
+	    props.store(outstream, "");
+	} catch (IOException ex) {
+	    fail(ex.getMessage());
+	}
+	InputStream byteArrayInputStream = new ByteArrayInputStream(
+		outstream.toByteArray());
+
+	setupResourceClassLoader(resourceDir);
+
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(byteArrayInputStream,
+		    resourceClassLoader);
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass."
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverName.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverName + "\"");
+	}
+    }
+
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory(
+     * java.util.Map<?,?> props) Get a PersistenceManagerFactory based on a
+     * Properties instance, using the current thread's context class loader to
+     * locate the PersistenceManagerFactory class.
+     */
+    public void testProperties() throws IOException {
+	props = new Properties();
+	props.setProperty(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS,
+		pmfServiceClass);
+	props.setProperty(PROPERTY_CONNECTION_DRIVER_NAME, expectedDriverName);
+
+	setupResourceClassLoader(resourceDir);
+	Thread.currentThread().setContextClassLoader(resourceClassLoader);
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(props);
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass."
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverName.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverName + "\"");
+	}
+    }
+
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory(
+     * java.util.Map<?,?> props, java.lang.ClassLoader pmfClassLoader) Get a
+     * PersistenceManagerFactory based on a Map and a class loader.
+     */
+    public void testPropertiesAndLoader() throws IOException {
+	props = new Properties();
+	props.setProperty(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS,
+		pmfServiceClass);
+	props.setProperty(PROPERTY_CONNECTION_DRIVER_NAME, expectedDriverName);
+
+	setupResourceClassLoader(resourceDir);
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(props,
+		    resourceClassLoader);
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass."
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverName.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverName + "\"");
+	}
+    }
+
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory
+     * (java.util.Map<?,?> overrides, java.lang.String name) Returns a named
+     * PersistenceManagerFactory or persistence unit.
+     */
+    public void testNamedPMFWithOverrides() throws IOException {
+	overrides = new Properties();
+	overrides.setProperty(PROPERTY_CONNECTION_DRIVER_NAME,
+		expectedDriverNameWithOverrides);
+
+	setupResourceClassLoader(resourceDir);
+	Thread.currentThread().setContextClassLoader(resourceClassLoader);
+
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(overrides, PMFName);
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass."
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverNameWithOverrides.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverNameWithOverrides
+		    + "\"");
+	}
+    }
+
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory(
+     * java.util.Map<?,?> overrides, java.lang.String name,
+     * java.lang.ClassLoader resourceLoader) Returns a named
+     * PersistenceManagerFactory or persistence unit.
+     */
+    public void testNamedPMFWithOverridesAndLoader() throws IOException {
+	overrides = new Properties();
+	overrides.setProperty(PROPERTY_CONNECTION_DRIVER_NAME,
+		expectedDriverNameWithOverrides);
+
+	setupResourceClassLoader(resourceDir);
+
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(overrides, PMFName,
+		    resourceClassLoader);
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass."
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverNameWithOverrides.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverNameWithOverrides
+		    + "\"");
+	}
+    }
+
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory(
+     * java.util.Map<?,?> overrides, java.lang.String name,
+     * java.lang.ClassLoader resourceLoader, java.lang.ClassLoader pmfLoader)
+     * Returns a PersistenceManagerFactory configured based on the properties
+     * stored in the resource at name, or, if not found, returns a
+     * PersistenceManagerFactory with the given name or, if not found, returns a
+     * javax.persistence.EntityManagerFactory cast to a
+     * PersistenceManagerFactory.
+     */
+    public void testNamedPMFWithOverridesAndTwoLoaders() throws IOException {
+	overrides = new Properties();
+	overrides.setProperty(PROPERTY_CONNECTION_DRIVER_NAME,
+		expectedDriverNameWithOverrides);
+
+	setupResourceClassLoader(resourceDir);
+
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(overrides, PMFName,
+		    resourceClassLoader, Thread.currentThread()
+			    .getContextClassLoader());
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass. "
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverNameWithOverrides.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverNameWithOverrides
+		    + "\"");
+	}
+    }
+
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory(
+     * java.lang.String name) Returns a named PersistenceManagerFactory or
+     * persistence unit.
+     */
+    public void testNamedPMF() throws IOException {
+
+	setupResourceClassLoader(resourceDir);
+	Thread.currentThread().setContextClassLoader(resourceClassLoader);
+
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(PMFName);
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass. "
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverName4NamedPMF.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverName4NamedPMF + "\"");
+	}
+    }
+
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory
+     * (java.lang.String name, java.lang.ClassLoader loader) Returns a named
+     * PersistenceManagerFactory or persistence unit.
+     */
+    public void testNamedPMFWithLoader() throws IOException {
+
+	setupResourceClassLoader(resourceDir);
+
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(PMFName,
+		    resourceClassLoader);
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass. "
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverName4NamedPMF.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverName4NamedPMF + "\"");
+	}
+    }
+
+    /*
+     * static PersistenceManagerFactory getPersistenceManagerFactory(
+     * java.lang.String name, java.lang.ClassLoader resourceLoader,
+     * java.lang.ClassLoader pmfLoader) Returns a named
+     * PersistenceManagerFactory or persistence unit.
+     */
+    public void testNamedPMFWithTwoLoaders() throws IOException {
+
+	setupResourceClassLoader(resourceDir);
+
+	try {
+	    pmf = JDOHelper.getPersistenceManagerFactory(PMFName,
+		    resourceClassLoader, Thread.currentThread()
+			    .getContextClassLoader());
+	} catch (JDOFatalUserException ex) {
+	    fail("Failed to find PersistenceManagerFactoryClass. "
+		    + ex.getMessage());
+	}
+
+	String driverName = pmf.getConnectionDriverName();
+	if (!expectedDriverName4NamedPMF.equals(driverName)) {
+	    fail("Bad ConnectionDriverName(): " + driverName
+		    + ".  Expected: \"" + expectedDriverName4NamedPMF + "\"");
+	}
     }
 }

Added: db/jdo/branches/3.0.1/api/test/java/javax/jdo/stub/StubPMF.java
URL: http://svn.apache.org/viewvc/db/jdo/branches/3.0.1/api/test/java/javax/jdo/stub/StubPMF.java?rev=1195022&view=auto
==============================================================================
--- db/jdo/branches/3.0.1/api/test/java/javax/jdo/stub/StubPMF.java (added)
+++ db/jdo/branches/3.0.1/api/test/java/javax/jdo/stub/StubPMF.java Sat Oct 29 20:32:56 2011
@@ -0,0 +1,555 @@
+package javax.jdo.stub;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.jdo.Constants;
+import javax.jdo.FetchGroup;
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+import javax.jdo.datastore.DataStoreCache;
+import javax.jdo.listener.InstanceLifecycleListener;
+import javax.jdo.metadata.JDOMetadata;
+import javax.jdo.metadata.TypeMetadata;
+
+public class StubPMF implements PersistenceManagerFactory, Constants {
+
+    public static final String PROPERTY_TRANSACTION_TYPE = "javax.jdo.option.TransactionType";
+
+    public static PersistenceManagerFactory getPersistenceManagerFactory(
+	    Map props) {
+
+	StubPMF pmf = new StubPMF();
+
+	pmf.setProperties(props);
+
+	for (Object key : props.keySet()) {
+	    if (!(key instanceof String)) {
+		continue;
+	    }
+	    String prop = (String) key;
+	    if (!prop.startsWith("javax.jdo.")) {
+		continue;
+	    }
+	    pmf.setProperty(prop, props.get(prop));
+	}
+
+	return pmf;
+    }
+
+    public static PersistenceManagerFactory getPersistenceManagerFactory(
+	    Map overrides, Map props) {
+
+	StubPMF pmf = new StubPMF();
+
+	pmf.setProperties(props);
+	pmf.setProperties(overrides);
+
+	return pmf;
+    }
+
+    String name;
+    String persistenceManagerFactoryClassName;
+    String spiResourceName;
+    String optionConnectionUserName;
+    String optionConnectionPassword;
+    String optionConnectionURL;
+    String optionConnectionDriverName;
+    String optionConnectionFactoryName;
+    Object optionConnectionFactory;
+    String optionConnectionFactory2Name;
+    Object optionConnectionFactory2;
+    boolean optionMultithreaded;
+    String optionMapping;
+    boolean optionOptimistic;
+    boolean optionRetainValues;
+    boolean optionRestoreValues;
+    boolean optionNontransactionalRead;
+    boolean optionNontransactionalWrite;
+    boolean optionIgnoreCache;
+    boolean optionDetachAllOnCommit;
+    boolean optionCopyOnAttach;
+    String optionName;
+    String optionPersistenceUnitName;
+    String optionServerTimeZoneID;
+    String optionTransactionType;
+    boolean optionReadOnly;
+    String optionTransactionIsolationLevel;
+    Integer optionDatastoreReadTimeoutMillis;
+    Integer optionDatastoreWriteTimeoutMillis;
+
+    Properties properties = new Properties();
+
+    public String getConnectionUserName() {
+	return optionConnectionUserName;
+    }
+
+    public void setConnectionUserName(String connectionUserName) {
+	this.optionConnectionUserName = connectionUserName;
+    }
+
+    public void setConnectionPassword(String connectionPassword) {
+	this.optionConnectionPassword = connectionPassword;
+    }
+
+    public String getConnectionURL() {
+	return optionConnectionURL;
+    }
+
+    public void setConnectionURL(String connectionURL) {
+	this.optionConnectionURL = connectionURL;
+    }
+
+    public String getConnectionDriverName() {
+	return optionConnectionDriverName;
+    }
+
+    public void setConnectionDriverName(String connectionDriverName) {
+	this.optionConnectionDriverName = connectionDriverName;
+    }
+
+    public String getConnectionFactoryName() {
+	return optionConnectionFactoryName;
+    }
+
+    public void setConnectionFactoryName(String connectionFactoryName) {
+	this.optionConnectionFactoryName = connectionFactoryName;
+    }
+
+    public Object getConnectionFactory() {
+	return optionConnectionFactory;
+    }
+
+    public void setConnectionFactory(Object connectionFactory) {
+	this.optionConnectionFactory = connectionFactory;
+    }
+
+    public String getConnectionFactory2Name() {
+	return optionConnectionFactory2Name;
+    }
+
+    public void setConnectionFactory2Name(String connectionFactory2Name) {
+	this.optionConnectionFactory2Name = connectionFactory2Name;
+    }
+
+    public Object getConnectionFactory2() {
+	return optionConnectionFactory2;
+    }
+
+    public void setConnectionFactory2(Object connectionFactory2) {
+	this.optionConnectionFactory2 = connectionFactory2;
+    }
+
+    public boolean getMultithreaded() {
+	return optionMultithreaded;
+    }
+
+    public void setMultithreaded(boolean multithreaded) {
+	this.optionMultithreaded = multithreaded;
+    }
+
+    public String getMapping() {
+	return optionMapping;
+    }
+
+    public void setMapping(String mapping) {
+	this.optionMapping = mapping;
+    }
+
+    public boolean getOptimistic() {
+	return optionOptimistic;
+    }
+
+    public void setOptimistic(boolean optimistic) {
+	this.optionOptimistic = optimistic;
+    }
+
+    public boolean getRetainValues() {
+	return optionRetainValues;
+    }
+
+    public void setRetainValues(boolean retainValues) {
+	this.optionRetainValues = retainValues;
+    }
+
+    public boolean getRestoreValues() {
+	return optionRestoreValues;
+    }
+
+    public void setRestoreValues(boolean restoreValues) {
+	this.optionRestoreValues = restoreValues;
+    }
+
+    public boolean getNontransactionalRead() {
+	return optionNontransactionalRead;
+    }
+
+    public void setNontransactionalRead(boolean nontransactionalRead) {
+	this.optionNontransactionalRead = nontransactionalRead;
+    }
+
+    public boolean getNontransactionalWrite() {
+	return optionNontransactionalWrite;
+    }
+
+    public void setNontransactionalWrite(boolean nontransactionalWrite) {
+	this.optionNontransactionalWrite = nontransactionalWrite;
+    }
+
+    public boolean getIgnoreCache() {
+	return optionIgnoreCache;
+    }
+
+    public void setIgnoreCache(boolean ignoreCache) {
+	this.optionIgnoreCache = ignoreCache;
+    }
+
+    public boolean getDetachAllOnCommit() {
+	return optionDetachAllOnCommit;
+    }
+
+    public void setDetachAllOnCommit(boolean detachAllOnCommit) {
+	this.optionDetachAllOnCommit = detachAllOnCommit;
+    }
+
+    public boolean getCopyOnAttach() {
+	return optionCopyOnAttach;
+    }
+
+    public void setCopyOnAttach(boolean copyOnAttach) {
+	this.optionCopyOnAttach = copyOnAttach;
+    }
+
+    public String getName() {
+	return optionName;
+    }
+
+    public void setName(String name) {
+	this.optionName = name;
+    }
+
+    public String getPersistenceUnitName() {
+	return optionPersistenceUnitName;
+    }
+
+    public void setPersistenceUnitName(String persistenceUnitName) {
+	this.optionPersistenceUnitName = persistenceUnitName;
+    }
+
+    public String getServerTimeZoneID() {
+	return optionServerTimeZoneID;
+    }
+
+    public void setServerTimeZoneID(String serverTimeZoneID) {
+	this.optionServerTimeZoneID = serverTimeZoneID;
+    }
+
+    public String getTransactionType() {
+	return optionTransactionType;
+    }
+
+    public void setTransactionType(String transactionType) {
+	this.optionTransactionType = transactionType;
+    }
+
+    public boolean getReadOnly() {
+	return optionReadOnly;
+    }
+
+    public void setReadOnly(boolean readOnly) {
+	this.optionReadOnly = readOnly;
+    }
+
+    public String getTransactionIsolationLevel() {
+	return optionTransactionIsolationLevel;
+    }
+
+    public void setTransactionIsolationLevel(String transactionIsolationLevel) {
+	this.optionTransactionIsolationLevel = transactionIsolationLevel;
+    }
+
+    public Integer getDatastoreReadTimeoutMillis() {
+	return optionDatastoreReadTimeoutMillis;
+    }
+
+    public void setDatastoreReadTimeoutMillis(Integer datastoreReadTimeoutMillis) {
+	this.optionDatastoreReadTimeoutMillis = datastoreReadTimeoutMillis;
+    }
+
+    public Integer getDatastoreWriteTimeoutMillis() {
+	return optionDatastoreWriteTimeoutMillis;
+    }
+
+    public void setDatastoreWriteTimeoutMillis(
+	    Integer datastoreWriteTimeoutMillis) {
+	this.optionDatastoreWriteTimeoutMillis = datastoreWriteTimeoutMillis;
+    }
+
+    public void close() {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    public boolean isClosed() {
+	return true;
+    }
+
+    public PersistenceManager getPersistenceManager() {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    public PersistenceManager getPersistenceManagerProxy() {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    public PersistenceManager getPersistenceManager(String userid,
+	    String password) {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    public Properties getProperties() {
+	return properties;
+    }
+
+    public Collection<String> supportedOptions() {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    public DataStoreCache getDataStoreCache() {
+	return new DataStoreCache() {
+
+	    public void evict(Object oid) {
+	    }
+
+	    public void evictAll() {
+	    }
+
+	    public void evictAll(Object... oids) {
+	    }
+
+	    public void evictAll(Collection oids) {
+	    }
+
+	    public void evictAll(Class pcClass, boolean subclasses) {
+	    }
+
+	    public void evictAll(boolean subclasses, Class pcClass) {
+	    }
+
+	    public void pin(Object oid) {
+	    }
+
+	    public void pinAll(Collection oids) {
+	    }
+
+	    public void pinAll(Object... oids) {
+	    }
+
+	    public void pinAll(Class pcClass, boolean subclasses) {
+	    }
+
+	    public void pinAll(boolean subclasses, Class pcClass) {
+	    }
+
+	    public void unpin(Object oid) {
+	    }
+
+	    public void unpinAll(Collection oids) {
+	    }
+
+	    public void unpinAll(Object... oids) {
+	    }
+
+	    public void unpinAll(Class pcClass, boolean subclasses) {
+	    }
+
+	    public void unpinAll(boolean subclasses, Class pcClass) {
+	    }
+	};
+    }
+
+    public void addInstanceLifecycleListener(
+	    InstanceLifecycleListener listener, Class[] classes) {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    public void removeInstanceLifecycleListener(
+	    InstanceLifecycleListener listener) {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    public void addFetchGroups(FetchGroup... groups) {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    public void removeFetchGroups(FetchGroup... groups) {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    public void removeAllFetchGroups() {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    @SuppressWarnings("rawtypes")
+    public FetchGroup getFetchGroup(Class cls, String name) {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    @SuppressWarnings("rawtypes")
+    public Set getFetchGroups() {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    public void registerMetadata(JDOMetadata metadata) {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    public JDOMetadata newMetadata() {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    public TypeMetadata getMetadata(String className) {
+	throw new UnsupportedOperationException("not implemented");
+    }
+
+    void setSpiResourceName(String spiPropertiesResourceName) {
+	this.spiResourceName = spiPropertiesResourceName;
+    }
+
+    public String getSpiPropertiesResourceName() {
+	return spiResourceName;
+    }
+
+    void setPersistenceManagerFactoryClass(String className) {
+	this.persistenceManagerFactoryClassName = className;
+    }
+
+    public String getPersistenceManagerFactoryClass() {
+	return this.persistenceManagerFactoryClassName;
+    }
+
+    void setProperty(String name, Object value) {
+
+	String val = value.toString();
+
+	if (name.equals(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS)) {
+	    setPersistenceManagerFactoryClass(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_CONNECTION_DRIVER_NAME)) {
+	    setConnectionDriverName(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_CONNECTION_FACTORY_NAME)) {
+	    setConnectionFactoryName(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_CONNECTION_FACTORY2_NAME)) {
+	    setConnectionFactory2Name(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_CONNECTION_PASSWORD)) {
+	    setConnectionPassword(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_CONNECTION_URL)) {
+	    setConnectionURL(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_CONNECTION_USER_NAME)) {
+	    setConnectionUserName(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_IGNORE_CACHE)) {
+	    setCopyOnAttach(Boolean.parseBoolean(val));
+	    return;
+	}
+	if (name.equals(PROPERTY_DATASTORE_READ_TIMEOUT_MILLIS)) {
+	    setDatastoreReadTimeoutMillis(Integer.parseInt(val));
+	    return;
+	}
+	if (name.equals(PROPERTY_DATASTORE_WRITE_TIMEOUT_MILLIS)) {
+	    setDatastoreWriteTimeoutMillis(Integer.parseInt(val));
+	    return;
+	}
+	if (name.equals(PROPERTY_DETACH_ALL_ON_COMMIT)) {
+	    setDetachAllOnCommit(Boolean.parseBoolean(val));
+	    return;
+	}
+	if (name.equals(PROPERTY_IGNORE_CACHE)) {
+	    setIgnoreCache(Boolean.parseBoolean(val));
+	    return;
+	}
+	if (name.equals(PROPERTY_MAPPING)) {
+	    setMapping(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_MULTITHREADED)) {
+	    setMultithreaded(Boolean.parseBoolean(val));
+	    return;
+	}
+	if (name.equals(PROPERTY_NAME)) {
+	    setName(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_NONTRANSACTIONAL_READ)) {
+	    setNontransactionalRead(Boolean.parseBoolean(val));
+	    return;
+	}
+	if (name.equals(PROPERTY_NONTRANSACTIONAL_WRITE)) {
+	    setNontransactionalWrite(Boolean.parseBoolean(val));
+	    return;
+	}
+	if (name.equals(PROPERTY_OPTIMISTIC)) {
+	    setOptimistic(Boolean.parseBoolean(val));
+	    return;
+	}
+	if (name.equals(PROPERTY_PERSISTENCE_UNIT_NAME)) {
+	    setPersistenceUnitName(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_READONLY)) {
+	    setReadOnly(Boolean.parseBoolean(val));
+	    return;
+	}
+	if (name.equals(PROPERTY_RESTORE_VALUES)) {
+	    setRestoreValues(Boolean.parseBoolean(val));
+	    return;
+	}
+	if (name.equals(PROPERTY_RETAIN_VALUES)) {
+	    setRetainValues(Boolean.parseBoolean(val));
+	    return;
+	}
+	if (name.equals(PROPERTY_SERVER_TIME_ZONE_ID)) {
+	    setServerTimeZoneID(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_TRANSACTION_ISOLATION_LEVEL)) {
+	    setTransactionIsolationLevel(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_TRANSACTION_TYPE)) {
+	    setTransactionType(val);
+	    return;
+	}
+	if (name.equals(PROPERTY_SPI_RESOURCE_NAME)) {
+	    setSpiResourceName(val);
+	    return;
+	}
+
+	throw new IllegalArgumentException("unhandled stub PMF property "
+		+ name);
+    }
+
+    void setProperties(Map properties) {
+	for (Object key : properties.keySet()) {
+	    String k = key.toString();
+	    Object v = properties.get(key);
+
+	    this.properties.put(k, v);
+	    setProperty(k, v);
+	}
+
+    }
+}

Propchange: db/jdo/branches/3.0.1/api/test/java/javax/jdo/stub/StubPMF.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: db/jdo/branches/3.0.1/api/test/java/javax/jdo/util/AbstractTest.java
URL: http://svn.apache.org/viewvc/db/jdo/branches/3.0.1/api/test/java/javax/jdo/util/AbstractTest.java?rev=1195022&r1=1195021&r2=1195022&view=diff
==============================================================================
--- db/jdo/branches/3.0.1/api/test/java/javax/jdo/util/AbstractTest.java (original)
+++ db/jdo/branches/3.0.1/api/test/java/javax/jdo/util/AbstractTest.java Sat Oct 29 20:32:56 2011
@@ -19,10 +19,12 @@ package javax.jdo.util;
 
 import java.io.PrintStream;
 
+import javax.jdo.Constants;
+
 import junit.framework.TestCase;
 
 /** */
-public abstract class AbstractTest extends TestCase {
+public abstract class AbstractTest extends TestCase implements Constants {
 
     /** */
     protected static PrintStream out = System.out;

Modified: db/jdo/branches/3.0.1/api/test/schema/jdoconfig/Negative09/9b/META-INF/services/javax.jdo.PersistenceManagerFactory
URL: http://svn.apache.org/viewvc/db/jdo/branches/3.0.1/api/test/schema/jdoconfig/Negative09/9b/META-INF/services/javax.jdo.PersistenceManagerFactory?rev=1195022&r1=1195021&r2=1195022&view=diff
==============================================================================
--- db/jdo/branches/3.0.1/api/test/schema/jdoconfig/Negative09/9b/META-INF/services/javax.jdo.PersistenceManagerFactory (original)
+++ db/jdo/branches/3.0.1/api/test/schema/jdoconfig/Negative09/9b/META-INF/services/javax.jdo.PersistenceManagerFactory Sat Oct 29 20:32:56 2011
@@ -1 +1 @@
-javax.jdo.JDOHelperTest$BadPMFGetPMFMethodThrowsJDOException
+javax.jdo.JDOHelperTest$BadPMFGetPMFMethodThrowsJDOFatalInternalException

Modified: db/jdo/branches/3.0.1/api/test/schema/jdoconfig/Pmfmapmap01/META-INF/jdoconfig.xml
URL: http://svn.apache.org/viewvc/db/jdo/branches/3.0.1/api/test/schema/jdoconfig/Pmfmapmap01/META-INF/jdoconfig.xml?rev=1195022&r1=1195021&r2=1195022&view=diff
==============================================================================
--- db/jdo/branches/3.0.1/api/test/schema/jdoconfig/Pmfmapmap01/META-INF/jdoconfig.xml (original)
+++ db/jdo/branches/3.0.1/api/test/schema/jdoconfig/Pmfmapmap01/META-INF/jdoconfig.xml Sat Oct 29 20:32:56 2011
@@ -10,7 +10,7 @@
 
     <!-- -->
     <persistence-manager-factory
-        class="javax.jdo.PMFService">
+        class="javax.jdo.stub.StubPMF">
         <property
             name="javax.jdo.option.ConnectionDriverName"
             value="Jane Doe"/>
@@ -18,7 +18,7 @@
 
     <persistence-manager-factory
         name="BookSearch"
-        class="javax.jdo.PMFService">
+        class="javax.jdo.stub.StubPMF">
         <property
             name="javax.jdo.option.ConnectionDriverName"
             value="Larry"/>

Modified: db/jdo/branches/3.0.1/api/test/schema/jdoconfig/Pmfmapmap02/propsfile.props
URL: http://svn.apache.org/viewvc/db/jdo/branches/3.0.1/api/test/schema/jdoconfig/Pmfmapmap02/propsfile.props?rev=1195022&r1=1195021&r2=1195022&view=diff
==============================================================================
--- db/jdo/branches/3.0.1/api/test/schema/jdoconfig/Pmfmapmap02/propsfile.props (original)
+++ db/jdo/branches/3.0.1/api/test/schema/jdoconfig/Pmfmapmap02/propsfile.props Sat Oct 29 20:32:56 2011
@@ -1,2 +1,2 @@
-javax.jdo.PersistenceManagerFactoryClass    javax.jdo.PMFService
+javax.jdo.PersistenceManagerFactoryClass    javax.jdo.stub.StubPMF
 javax.jdo.option.ConnectionDriverName       Jane Doe

Modified: db/jdo/branches/3.0.1/maven.xml
URL: http://svn.apache.org/viewvc/db/jdo/branches/3.0.1/maven.xml?rev=1195022&r1=1195021&r2=1195022&view=diff
==============================================================================
--- db/jdo/branches/3.0.1/maven.xml (original)
+++ db/jdo/branches/3.0.1/maven.xml Sat Oct 29 20:32:56 2011
@@ -31,19 +31,6 @@
         <echo>  jdo3.build   - builds all JDO 3 projects</echo>
         <echo>  jdo3.default - calls the default goal for all JDO 3 projects</echo>
         <echo>  jdo3.clean   - cleans all JDO 3 projects</echo>
-        <echo>  jdo2.build   - builds all JDO2 projects</echo>
-        <echo>  jdo2.default - calls the default goal for  all JDO2 projects</echo>
-        <echo>  jdo2.clean   - cleans all JDO2 projects</echo>
-        <echo>  tck2.build   - builds tck2 and dependent JDO2 projects</echo>
-        <echo>  tck2.default - calls the default goal for tck2 and dependent JDO2 projects</echo>
-        <echo>  tck2.clean   - cleans tck2 and dependent JDO2 projects</echo>
-        <echo>  tck2.dist    - creates distributions of tck2 and dependent JDO2 projects</echo>
-        <echo>  fostore20.clean   - cleans fostore20 and dependencies</echo>
-        <echo>  fostore20.build   - builds fostore20 and dependencies</echo>
-        <echo>  fostore20.default - calls the default goal for fostore20 and dependencies</echo>
-        <echo>  jdo11.build   - builds all JDO1 projects</echo>
-        <echo>  jdo11.default - calls the default goal for all JDO1 projects</echo>
-        <echo>  jdo11.clean   - cleans all JDO1 projects</echo>
         <echo>Please check README.txt for more details.</echo>
     </goal>
 
@@ -78,101 +65,6 @@
         <attainGoal name="multiproject:goal"/>
     </goal> 
 
-    <!-- ========== -->
-    <!-- JDO2 Goals -->
-    <!-- ========== -->
-
-    <goal name="jdo2.build"
-          description="Builds all JDO2 projects">
-        <j:set var="maven.multiproject.includes">${jdo2.projects}</j:set>
-        <j:set var="goal">build</j:set>
-        <attainGoal name="multiproject:goal"/>
-    </goal>
-
-    <goal name="jdo2.default"
-          description="Calls the default goal for all JDO2 projects">
-        <j:set var="maven.multiproject.includes">${jdo2.projects}</j:set>
-        <j:set var="goal">default</j:set>
-        <attainGoal name="multiproject:goal"/>
-    </goal>
-
-    <goal name="jdo2.clean"
-          description="Cleans all JDO2 projects">
-        <j:set var="maven.multiproject.includes">${jdo2.projects}</j:set>
-        <attainGoal name="multiproject:clean"/>
-    </goal>
-
-    <goal name="tck2.build"
-          description="Builds tck2 and dependent JDO2 projects">
-        <j:set var="maven.multiproject.includes">${tck2.projects}</j:set>
-        <j:set var="goal">build</j:set>
-        <attainGoal name="multiproject:goal"/>
-    </goal>
-
-    <goal name="tck2.default"
-          description="Calls the default goal for tck2 and dependent JDO2 projects">
-        <j:set var="maven.multiproject.includes">${tck2.projects}</j:set>
-        <j:set var="goal">default</j:set>
-        <attainGoal name="multiproject:goal"/>
-    </goal>
-
-    <goal name="tck2.clean"
-          description="Cleans tck2 and dependent JDO2 projects">
-        <j:set var="maven.multiproject.includes">${tck2.projects}</j:set>
-        <attainGoal name="multiproject:clean"/>
-    </goal>
-
-    <goal name="tck2.dist"
-          description="Creates distributions of tck2 and dependent JDO2 projects">
-        <j:set var="maven.multiproject.includes">${tck2.projects}</j:set>
-        <j:set var="goal">dist</j:set>
-        <attainGoal name="multiproject:goal"/>
-    </goal> 
-
-    <goal name="fostore20.build"
-      description="Builds fostore20 and dependencies">
-        <j:set var="maven.multiproject.includes">${fostore20.projects}</j:set>
-        <j:set var="goal">build</j:set>
-        <attainGoal name="multiproject:goal"/>
-    </goal>
-
-    <goal name="fostore20.default"
-      description="Calls the default goal for fostore20 and dependencies">
-        <j:set var="maven.multiproject.includes">${fostore20.projects}</j:set>
-        <j:set var="goal">default</j:set>
-        <attainGoal name="multiproject:goal"/>
-    </goal>
-
-    <goal name="fostore20.clean"
-    description="Cleans fostore20 and dependencies">
-        <j:set var="maven.multiproject.includes">${fostore20.projects}</j:set>
-        <attainGoal name="multiproject:clean"/>
-    </goal>
-  
-    <!-- ========== -->
-    <!-- JDO1 Goals -->
-    <!-- ========== -->
-
-    <goal name="jdo11.build" 
-          description="Builds all JDO1 projects">
-        <j:set var="maven.multiproject.includes">${jdo11.projects}</j:set>
-        <j:set var="goal">build</j:set>
-        <attainGoal name="multiproject:goal"/>
-    </goal>
-
-    <goal name="jdo11.default" 
-          description="Calls the default goal for all JDO1 projects">
-        <j:set var="maven.multiproject.includes">${jdo11.projects}</j:set>
-        <j:set var="goal">default</j:set>
-        <attainGoal name="multiproject:goal"/>
-    </goal>
-
-    <goal name="jdo11.clean" 
-          description="Cleans all JDO1 projects">
-        <j:set var="maven.multiproject.includes">${jdo11.projects}</j:set>
-        <attainGoal name="multiproject:clean"/>
-    </goal>
-
     <!-- ==== -->
     <!-- Misc -->
     <!-- ==== -->

Modified: db/jdo/branches/3.0.1/project.xml
URL: http://svn.apache.org/viewvc/db/jdo/branches/3.0.1/project.xml?rev=1195022&r1=1195021&r2=1195022&view=diff
==============================================================================
--- db/jdo/branches/3.0.1/project.xml (original)
+++ db/jdo/branches/3.0.1/project.xml Sat Oct 29 20:32:56 2011
@@ -99,7 +99,7 @@ Requests (JSR 12 and 243) under the ausp
             <name>Matthew Adams</name>
             <id>madams</id>
             <email>matthew@matthewadams.me</email>
-            <timezone>-8</timezone>
+            <timezone>-6</timezone>
             <organization>Apache.org</organization>
         </developer>
         <developer>

Modified: db/jdo/branches/3.0.1/tck/RunRules.html
URL: http://svn.apache.org/viewvc/db/jdo/branches/3.0.1/tck/RunRules.html?rev=1195022&r1=1195021&r2=1195022&view=diff
==============================================================================
--- db/jdo/branches/3.0.1/tck/RunRules.html (original)
+++ db/jdo/branches/3.0.1/tck/RunRules.html Sat Oct 29 20:32:56 2011
@@ -1,210 +1,289 @@
-<!--
-  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.
--->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<HTML>
-<HEAD>
-	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
-	<TITLE>JDO 3.0 Technology Compatibility Kit Run Rules</TITLE>
-	<STYLE>
-	<!--
-		@page { size: 8.5in 11in }
-	-->
-	</STYLE>
-</HEAD>
-<BODY LANG="en-US" DIR="LTR">
-<H1 ALIGN=CENTER>Running the JDO 3.0 Technology Compatibility Kit</H1>
-<P ALIGN=CENTER><BR><BR>
-</P>
-<P ALIGN=CENTER>24-May-2010</P>
-<P STYLE="margin-top: 0.17in; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>Overview</FONT></FONT></P>
-<P>In order to demonstrate compliance with the Java Data Objects
-specification, an implementation must successfully run all of the TCK
-tests that are not on the &quot;excluded&quot; list. The
-implementation is hereinafter referred to as the IUT (Implementation
-Under Test).</P>
-<P>The results must be posted on a publicly accessible web site for
-examination by the public. The posting includes the output of the
-test run, which consists of multiple log files containing
-configuration information and test results. For an example of the
-required posting, please see <A HREF="http://db.apache.org/jdo/tck/final">http://db.apache.org/jdo/tck/final</A>.</P>
-<P STYLE="margin-top: 0.17in; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>Prerequisites</FONT></FONT></P>
-<P>In order to run the TCK, you must install maven 1.x.x.
-M<FONT FACE="Times New Roman, serif">aven
-</FONT><A HREF="http://maven.apache.org/maven-1.x/"><FONT FACE="Times New Roman, serif"><FONT COLOR="#000000">http://maven.apache.org/maven-1.x/
-</FONT></FONT></A><FONT FACE="Times New Roman, serif">is the</FONT>
-driver of the test programs. Note that Maven 2 is not supported.</P>
-<P>You must test the IUT on all configurations that the IUT supports.
-This includes different hardware and operating systems, different
-versions of Java, and different datastores. The TCK supports Java
-versions 1.5 to 1.6. </P>
-<P STYLE="margin-top: 0.17in; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>Installation</FONT></FONT></P>
-<P>Download the zip file from the distribution location.  Unpack the zip
-file into a directory of your choice. In this directory you will
-find: 
-</P>
-<UL>
-	<UL>
-		<LI><P>README.html 
-		</P>
-		<LI><P>maven configuration files project.properties and project.xml
-		(common project definition for all Apache JDO projects including
-		the TCK). These files must not be changed.</P>
-		<LI><P ALIGN=LEFT STYLE="margin-bottom: 0.2in">lib - this directory
-		contains a directory ext that should contain jar fi<FONT FACE="Times New Roman, serif">les
-		<FONT COLOR="#000000">fscontext.jar and providerutil.jar </FONT>us</FONT>ed
-		by the JNDI tests. <FONT FACE="Times New Roman, serif"><FONT COLOR="#000000">The
-		jar files can be found at
-		</FONT></FONT><A HREF="http://java.sun.com/products/jndi/downloads/index.html"><FONT FACE="Times New Roman, serif"><FONT COLOR="#000000">http://java.sun.com/products/jndi/downloads/index.html</FONT></FONT></A><FONT FACE="Times New Roman, serif"><FONT COLOR="#000000">.
-		Choose &quot;File System Service Provider, 1.2 Beta 3&quot; from
-		the &quot;Download JNDI 1.2.1 &amp; More&quot; page. Unzip the
-		archive and install them into the lib/ext directory. It is
-		permitted to use a different JNDI implementation; see the
-		README.txt for information on how to configure a different JNDI
-		implementation.</FONT></FONT></P>
-		<LI><P>the TCK directory, which has a release-specific name (e.g.
-		jdo-tck-3.0) and contains:</P>
-		<UL>
-			<LI><P>maven.xml, project.properties, project.xml - the maven
-			definition of the project. These files must not be modified.</P>
-			<LI><P>build.properties - the maven definition for the IUT. This
-			file may be modified to change any of the IUT properties needed.</P>
-			<LI><P>this RunRules.html</P>
-			<LI><P>assertions - contains the assertions file identifying the
-			assertions tested by the tests. This is for reference.</P>
-			<LI><P>target - this directory contains artifacts of compiling and
-			running the tests. It does not exist in the distribution and will
-			be created by the maven build script.</P>
-			<LI><P>iut_jars - this directory is where the JDO implementation
-			jars are installed. It is empty in the distribution. To use the
-			maven target runtck.iut (required for an implementation to prove
-			compliance), copy the JDO implementation jar files into this
-			directory. Alternatively, update the build.properties file in the
-			TCK directory to refer to an existing location of the IUT jar
-			files.</P>
-			<LI><P>src - this directory contains the test configuration files
-			and directories:</P>
-			<UL>
-				<LI><P>testdata - this directory contains data (represented as
-				.xml files) loaded into the datastore for tests. These files must
-				not be modified.</P>
-				<LI><P>sql - this directory contains DDL to define the tables
-				used in the tests. The files distributed must not be modified.
-				Files may be created for databases for which the DDL for the
-				database under test is not provided. 
-				</P>
-				<LI><P>jdo - this directory contains .jdo metadata files for the
-				persistent classes used in the tests. These files must not be
-				modified.</P>
-				<LI><P>orm - this directory contains .orm metadata files to map
-                the persistent classes to the sql tables. These files must not
-                be modified except to add DDL-generation information
-                (which is not used by the TCK).</P>
-				<LI><P>java - this directory contains the source code to the TCK
-				tests. These files must not be modified.</P>
-				<LI><P>conf - this directory contains the configuration
-                information for the test runs. The files iut-pmf.properties,
-                iut-jdoconfig.xml, and iut-persistence.xml in this directory
-                must be changed to provide properties for the IUT persistence
-                manager factory.  The file jndi.properties may be changed
-                to use a different jndi provider. Other files must not be
-				modified, except to put a successfully challenged test case into
-				the trunk/tck20/test/conf/exclude.list. Please see below.</P>
-			</UL>
-		</UL>
-	</UL>
-</UL>
-<P STYLE="margin-top: 0.17in; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>Modifying
-the Configuration</FONT></FONT></P>
-<P>The Implementation Under Test (IUT) can be installed into the
-iut_jars directory in the TCK directory. Any .jar files in this
-directory are added to the class path used to run the tests.</P>
-<P>There are properties in the build.properties file in the TCK
-directory that must be changed to configure the IUT execution and
-enhancement (optional) environment. These properties begin with
-iut.runtck and iut.enhancer. 
-</P>
-<P>There is are three properties files that must be modified to be
-IUT-specific, all located in the TCK src/conf directory. The
-iut-pmf.properties file contains information used to construct the
-PersistenceManagerFactory used in the tests. iut-jdoconfig.xml and
-iut-persistence.xml also contain PersistenceManagerFactory properties
-used only in tests in the
-org.apache.jdo.tck.api.persistencemanagerfactory.config package.
-</P>
-<P>SQL DDL files are provided for the sql table definitions. The
-existing files must not be changed, but files may be added in the
-directory in order to provide DDL for additional databases supported
-by the JDO implementation under test.</P>
-<P STYLE="margin-top: 0.17in; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>Running
-the Tests</FONT></FONT></P>
-<P>From the installation directory, change to the TCK directory. From
-the TCK directory, call &quot;maven build&quot; which will build the
-jar files used in the tests, create the Derby database, install the
-schema into the Derby database, and run the TCK on the Reference
-Implementation. Success indicates that the TCK was installed
-correctly.</P>
-<P>Then call &quot;maven runtck.iut&quot; to run the tests on the
-Implementation Under Test. This will produce console output plus a
-directory in the TCK/target/logs directory whose name contains the
-date/time the tests were started. This directory contains the output
-of the tests. This is the directory to be published.</P>
-<P>Some of the TCK tests require the implementation to support up to
-20 instances of PersistenceManager with open transactions
-simultaneously.</P>
-<P STYLE="margin-top: 0.17in; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>Debugging
-the IUT while Running TCK tests</FONT></FONT></P>
-<P>Execute &quot;maven help&quot; in the TCK directory in order to
-get information on running the TCK tests with a debugger. In
-particular, properties jdo.tck.cleanupaftertest, jdo.tck.cfglist,
-jdo.tck.identitytypes, and jdo.tck.dblist may be useful.</P>
-<P>If you make a change to the IUT enhancer while debugging the TCK
-tests (for implementations that use an enhancer) you must remove the
-target/classes directory before continuing in order to make sure that
-the classes are re-enhanced by the changed code.</P>
-<P STYLE="margin-top: 0.17in; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>Publishing
-the Results of the TCK Tests</FONT></FONT></P>
-<P>With a successful test run, the log directory with the results of
-the tests must be published on a publicly-available web site. The
-unmodified directory is the self-certification of the successful TCK
-test run.</P>
-<P STYLE="margin-top: 0.17in; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>First
-Level TCK Appeals Process</FONT></FONT></P>
-<P ALIGN=LEFT STYLE="margin-top: 0.17in; page-break-after: avoid">If
-any test does not pass on the JDO implementation under test, this may
-be due to an error in the implementation or in the TCK test. If you
-believe that the failure is due to an error in the TCK test, you may
-challenge the test. To do so, send email to: <A HREF="mailto:jdo-dev@db.apache.org">jdo-dev@db.apache.org</A>
-with a subject line containing &quot;CHALLENGE&quot; and the name of
-the test program, e.g.
-org.apache.jdo.tck.api.persistencemanager.ThreadSafe.java; and the
-body of the email containing the details of the challenge.</P>
-<P>The Maintenance Lead will respond within 15 working days with a
-decision on whether there is an error in the test case. If the issue
-is found by the Maintenance Lead to be due to an error in the test
-case, the Maintenance Lead might patch the erroneous test or add the test
-to the exclude list.
-The user can obtain the TCK updates by checking out the latest minor version branch, 2.n.1.
-If a fix is not provided within 15 working days of the receipt of the challenge,
-then the user may put the test into the TCK file src/conf/exclude.list and
-it will not be run as part of the TCK.</P>
-<P>Decisions of the Maintenance Lead may be appealed to the full
-expert group. A vote of the full expert group will be conducted by
-the Maintenance Lead, and a majority of votes cast will decide the
-issue. The Maintenance Lead has one vote, as does each member of the
-expert group at the time of the vote.</P>
-</BODY>
-</HTML>
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="CONTENT-TYPE" content="text/html; charset=UTF-8">
+    <title>JDO 3.0 Technology Compatibility Kit Run Rules</title>
+    <style>
+	<!--
+		@page { size: 8.5in 11in }
+	-->
+	</style>
+  </head>
+  <body dir="LTR" lang="en-US">
+    <h1 align="CENTER">Running the JDO 3.0 Technology Compatibility Kit</h1>
+    <p align="CENTER"><br>
+      <br>
+    </p>
+    <p align="CENTER">29-Oct-2011</p>
+    <p style="margin-top: 0.17in; page-break-after: avoid"><font
+        face="Albany, sans-serif"><font size="4">Overview</font></font></p>
+    <p>In order to demonstrate compliance with the Java Data Objects
+      specification, an implementation must successfully run all of the
+      TCK
+      tests that are not on the "excluded" list. The
+      implementation is hereinafter referred to as the IUT
+      (Implementation
+      Under Test).</p>
+    <p>The results must be posted on a publicly accessible web site for
+      examination by the public. The posting includes the output of the
+      test run, which consists of multiple log files containing
+      configuration information and test results. For an example of the
+      required posting, please see <a
+        href="http://db.apache.org/jdo/tck/final">http://db.apache.org/jdo/tck/final</a>.</p>
+    <p style="margin-top: 0.17in; page-break-after: avoid"><font
+        face="Albany, sans-serif"><font size="4">Prerequisites</font></font></p>
+    <p>In order to run the TCK, you must install maven 1.1.x.
+      M<font face="Times New Roman, serif">aven
+      </font><a href="http://maven.apache.org/maven-1.x/"><font
+          face="Times New Roman, serif"><font color="#000000">http://maven.apache.org/maven-1.x/
+          </font></font></a><font face="Times New Roman, serif">is the</font>
+      driver of the test programs. Note that Maven 2 is not supported.</p>
+    <p>You must test the IUT on all configurations that the IUT
+      supports.
+      This includes different hardware and operating systems, different
+      versions of Java, and different datastores. The TCK supports Java
+      versions 1.5 to 1.6. </p>
+    <p style="margin-top: 0.17in; page-break-after: avoid"><font
+        face="Albany, sans-serif"><font size="4">Installation</font></font></p>
+    <p>Download the zip file from the distribution location. Unpack the
+      zip
+      file into a directory of your choice. In this directory you will
+      find: </p>
+    <ul>
+      <ul>
+        <li>
+          <p>README.html </p>
+        </li>
+        <li>
+          <p>maven configuration files project.properties and
+            project.xml (common project definition for all Apache JDO
+            projects including the TCK). These files must not be
+            changed.</p>
+        </li>
+        <li>
+          <p style="margin-bottom: 0.2in" align="LEFT">lib - this
+            directory contains a directory ext that should contain jar
+            fi<font face="Times New Roman, serif">les <font
+                color="#000000">fscontext.jar and providerutil.jar </font>us</font>ed
+
+            by the JNDI tests. <font face="Times New Roman, serif"><font
+                color="#000000">The jar files can be found at </font></font><a
+href="http://java.sun.com/products/jndi/downloads/index.html"><font
+                face="Times New Roman, serif"><font color="#000000">http://java.sun.com/products/jndi/downloads/index.html</font></font></a><font
+              face="Times New Roman, serif"><font color="#000000">.
+                Choose "File System Service Provider, 1.2 Beta 3" from
+                the "Download JNDI 1.2.1 &amp; More" page. Unzip the
+                archive and install them into the lib/ext directory. It
+                is permitted to use a different JNDI implementation; see
+                the README.txt for information on how to configure a
+                different JNDI implementation.</font></font></p>
+        </li>
+        <li>
+          <p>the TCK directory, which has a release-specific name (e.g.
+            jdo-tck-3.0) and contains:</p>
+          <ul>
+            <li>
+              <p>maven.xml, project.properties, project.xml - the maven
+                definition of the project. These files must not be
+                modified.</p>
+            </li>
+            <li>
+              <p>build.properties - the maven definition for the IUT.
+                This file may be modified to change any of the IUT
+                properties needed.</p>
+            </li>
+            <li>
+              <p>this RunRules.html</p>
+            </li>
+            <li>
+              <p>assertions - contains the assertions file identifying
+                the assertions tested by the tests. This is for
+                reference.</p>
+            </li>
+            <li>
+              <p>target - this directory contains artifacts of compiling
+                and running the tests. It does not exist in the
+                distribution and will be created by the maven build
+                script.</p>
+            </li>
+            <li>
+              <p>iut_jars - this directory is where the JDO
+                implementation jars are installed. It is empty in the
+                distribution. To use the maven target runtck.iut
+                (required for an implementation to prove compliance),
+                copy the JDO implementation jar files into this
+                directory. Alternatively, update the build.properties
+                file in the TCK directory to refer to an existing
+                location of the IUT jar files.</p>
+            </li>
+            <li>
+              <p>src - this directory contains the test configuration
+                files and directories:</p>
+              <ul>
+                <li>
+                  <p>testdata - this directory contains data
+                    (represented as .xml files) loaded into the
+                    datastore for tests. These files must not be
+                    modified.</p>
+                </li>
+                <li>
+                  <p>sql - this directory contains DDL to define the
+                    tables used in the tests. The files distributed must
+                    not be modified. Files may be created for databases
+                    for which the DDL for the database under test is not
+                    provided. </p>
+                </li>
+                <li>
+                  <p>jdo - this directory contains .jdo metadata files
+                    for the persistent classes used in the tests. These
+                    files must not be modified.</p>
+                </li>
+                <li>
+                  <p>orm - this directory contains .orm metadata files
+                    to map the persistent classes to the sql tables.
+                    These files must not be modified except to add
+                    DDL-generation information (which is not used by the
+                    TCK).</p>
+                </li>
+                <li>
+                  <p>java - this directory contains the source code to
+                    the TCK tests. These files must not be modified.</p>
+                </li>
+                <li>
+                  <p>conf - this directory contains the configuration
+                    information for the test runs. The files
+                    iut-pmf.properties, iut-jdoconfig.xml, and
+                    iut-persistence.xml in this directory must be
+                    changed to provide properties for the IUT
+                    persistence manager factory. The file
+                    jndi.properties may be changed to use a different
+                    jndi provider. Other files must not be modified,
+                    except to put a successfully challenged test case
+                    into the trunk/tck20/test/conf/exclude.list. Please
+                    see below.</p>
+                </li>
+              </ul>
+            </li>
+          </ul>
+        </li>
+      </ul>
+    </ul>
+    <p style="margin-top: 0.17in; page-break-after: avoid"><font
+        face="Albany, sans-serif"><font size="4">Modifying
+          the Configuration</font></font></p>
+    <p>The Implementation Under Test (IUT) can be installed into the
+      iut_jars directory in the TCK directory. Any .jar files in this
+      directory are added to the class path used to run the tests.</p>
+    <p>There are properties in the build.properties file in the TCK
+      directory that must be changed to configure the IUT execution and
+      enhancement (optional) environment. These properties begin with
+      iut.runtck and iut.enhancer. </p>
+    <p>There is are three properties files that must be modified to be
+      IUT-specific, all located in the TCK src/conf directory. The
+      iut-pmf.properties file contains information used to construct the
+      PersistenceManagerFactory used in the tests. iut-jdoconfig.xml and
+      iut-persistence.xml also contain PersistenceManagerFactory
+      properties
+      used only in tests in the
+      org.apache.jdo.tck.api.persistencemanagerfactory.config package.
+    </p>
+    <p>SQL DDL files are provided for the sql table definitions. The
+      existing files must not be changed, but files may be added in the
+      directory in order to provide DDL for additional databases
+      supported
+      by the JDO implementation under test.</p>
+    <p style="margin-top: 0.17in; page-break-after: avoid"><font
+        face="Albany, sans-serif"><font size="4">Running
+          the Tests</font></font></p>
+    <p>From the installation directory, change to the TCK directory.
+      From
+      the TCK directory, call "maven build" which will build the
+      jar files used in the tests, create the Derby database, install
+      the
+      schema into the Derby database, and run the TCK on the Reference
+      Implementation. Success indicates that the TCK was installed
+      correctly.</p>
+    <p>Then call "maven runtck.iut" to run the tests on the
+      Implementation Under Test. This will produce console output plus a
+      directory in the TCK/target/logs directory whose name contains the
+      date/time the tests were started. This directory contains the
+      output
+      of the tests. This is the directory to be published.</p>
+    <p>Some of the TCK tests require the implementation to support up to
+      20 instances of PersistenceManager with open transactions
+      simultaneously.</p>
+    <p style="margin-top: 0.17in; page-break-after: avoid"><font
+        face="Albany, sans-serif"><font size="4">Debugging
+          the IUT while Running TCK tests</font></font></p>
+    <p>Execute "maven help" in the TCK directory in order to
+      get information on running the TCK tests with a debugger. In
+      particular, properties jdo.tck.cleanupaftertest, jdo.tck.cfglist,
+      jdo.tck.identitytypes, and jdo.tck.dblist may be useful.</p>
+    <p>If you make a change to the IUT enhancer while debugging the TCK
+      tests (for implementations that use an enhancer) you must remove
+      the
+      target/classes directory before continuing in order to make sure
+      that
+      the classes are re-enhanced by the changed code.</p>
+    <p style="margin-top: 0.17in; page-break-after: avoid"><font
+        face="Albany, sans-serif"><font size="4">Publishing
+          the Results of the TCK Tests</font></font></p>
+    <p>With a successful test run, the log directory with the results of
+      the tests must be published on a publicly-available web site. The
+      unmodified directory is the self-certification of the successful
+      TCK
+      test run.</p>
+    <p style="margin-top: 0.17in; page-break-after: avoid"><font
+        face="Albany, sans-serif"><font size="4">First
+          Level TCK Appeals Process</font></font></p>
+    <p style="margin-top: 0.17in; page-break-after: avoid" align="LEFT">If
+any
+      test does not pass on the JDO implementation under test, this may
+      be due to an error in the implementation or in the TCK test. If
+      you
+      believe that the failure is due to an error in the TCK test, you
+      may
+      challenge the test. To do so, send email to: <a
+        href="mailto:jdo-dev@db.apache.org">jdo-dev@db.apache.org</a>
+      with a subject line containing "CHALLENGE" and the name of
+      the test program, e.g.
+      org.apache.jdo.tck.api.persistencemanager.ThreadSafe.java; and the
+      body of the email containing the details of the challenge.</p>
+    <p>The Maintenance Lead will respond within 15 working days with a
+      decision on whether there is an error in the test case. If the
+      issue
+      is found by the Maintenance Lead to be due to an error in the test
+      case, the Maintenance Lead might patch the erroneous test or add
+      the test
+      to the exclude list.
+      The user can obtain the TCK updates by checking out the latest
+      minor version branch.
+      If a fix is not provided within 15 working days of the receipt of
+      the challenge,
+      then the user may put the test into the TCK file
+      src/conf/exclude.list and
+      it will not be run as part of the TCK.</p>
+    <p>Decisions of the Maintenance Lead may be appealed to the full
+      expert group. A vote of the full expert group will be conducted by
+      the Maintenance Lead, and a majority of votes cast will decide the
+      issue. The Maintenance Lead has one vote, as does each member of
+      the
+      expert group at the time of the vote.</p>
+  </body>
+</html>



Mime
View raw message