| Matthew T. Adams 2007-08-09, 7:11 pm |
| FYI, this patch (JDO-496) includes changes to the public API, and also =
therefore TCK signature files. I wanted to alert implementers to make =
sure they know about it.
-matthew
-----Original Message-----
From: madams@apache.org [mailto:madams@apache.org]=20
Sent: Thursday, August 09, 2007 2:21 PM
To: jdo-commits@db.apache.org
Subject: svn commit: r564384 [1/3] - in /db/jdo/trunk: =
api2-legacy/src/java/javax/jdo/ api2-legacy/src/schema/javax/jdo/ =
api2-legacy/test/java/javax/jdo/ =
api2-legacy/test/schema/jdoconfig/Negative0/ =
api2-legacy/test/schema/jdoconfig/Negative00/ api2-legacy/test...
Author: madams
Date: Thu Aug 9 14:20:35 2007
New Revision: 564384
URL: http://svn.apache.org/viewvc?view=3Drev&rev=3D564384
Log:
JDO-496
Added:
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative00/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative00/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative00/META-INF/jdocon=
fig.xml
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative01/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative01/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative01/META-INF/jdocon=
fig.xml
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative02/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative02/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative02/META-INF/jdocon=
fig.xml
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative03/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative03/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative03/META-INF/jdocon=
fig.xml
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative04/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative04/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative04/META-INF/jdocon=
fig.xml
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative05/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative05/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative05/META-INF/jdocon=
fig.xml
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/6a/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/6a/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/6a/META-INF/jdo=
config.xml
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/6b/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/6b/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/6b/META-INF/jdo=
config.xml
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative07/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative07/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative07/META-INF/servic=
es/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative07/META-INF/servic=
es/javax.jdo.PersistenceManagerFactory
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative08/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative08/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative08/META-INF/servic=
es/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative08/META-INF/servic=
es/javax.jdo.PersistenceManagerFactory
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive00/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive00/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive00/META-INF/jdocon=
fig.xml
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive01/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive01/1a/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive01/1a/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive01/1a/META-INF/jdo=
config.xml
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive01/1b/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive01/1b/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive01/1b/META-INF/jdo=
config.xml
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive03/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive03/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive03/META-INF/jdocon=
fig.xml
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive03/META-INF/servic=
es/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive03/META-INF/servic=
es/javax.jdo.PersistenceManagerFactory
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive04/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive04/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive04/META-INF/jdocon=
fig.xml
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive04/META-INF/servic=
es/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive04/META-INF/servic=
es/javax.jdo.PersistenceManagerFactory
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive05/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive05/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive05/META-INF/jdocon=
fig.xml
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive05/META-INF/servic=
es/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive05/META-INF/servic=
es/javax.jdo.PersistenceManagerFactory
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive06/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive06/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive06/META-INF/jdocon=
fig.xml
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive07/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive07/META-INF/
=
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive07/META-INF/jdocon=
fig.xml
db/jdo/trunk/api2/test/schema/jdoconfig/Negative00/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative00/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative00/META-INF/jdoconfig.xml=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative01/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative01/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative01/META-INF/jdoconfig.xml=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative02/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative02/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative02/META-INF/jdoconfig.xml=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative03/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative03/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative03/META-INF/jdoconfig.xml=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative04/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative04/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative04/META-INF/jdoconfig.xml=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative05/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative05/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative05/META-INF/jdoconfig.xml=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative06/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative06/6a/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative06/6a/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative06/6a/META-INF/jdoconfig.=
xml
db/jdo/trunk/api2/test/schema/jdoconfig/Negative06/6b/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative06/6b/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative06/6b/META-INF/jdoconfig.=
xml
db/jdo/trunk/api2/test/schema/jdoconfig/Negative07/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative07/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative07/META-INF/services/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative07/META-INF/services/java=
x.jdo.PersistenceManagerFactory
db/jdo/trunk/api2/test/schema/jdoconfig/Negative08/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative08/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative08/META-INF/services/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Negative08/META-INF/services/java=
x.jdo.PersistenceManagerFactory
db/jdo/trunk/api2/test/schema/jdoconfig/Positive00/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive00/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive00/META-INF/jdoconfig.xml=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive01/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive01/1a/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive01/1a/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive01/1a/META-INF/jdoconfig.=
xml
db/jdo/trunk/api2/test/schema/jdoconfig/Positive01/1b/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive01/1b/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive01/1b/META-INF/jdoconfig.=
xml
db/jdo/trunk/api2/test/schema/jdoconfig/Positive03/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive03/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive03/META-INF/jdoconfig.xml=
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive03/META-INF/services/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive03/META-INF/services/java=
x.jdo.PersistenceManagerFactory
db/jdo/trunk/api2/test/schema/jdoconfig/Positive04/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive04/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive04/META-INF/jdoconfig.xml=
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive04/META-INF/services/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive04/META-INF/services/java=
x.jdo.PersistenceManagerFactory
db/jdo/trunk/api2/test/schema/jdoconfig/Positive05/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive05/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive05/META-INF/jdoconfig.xml=
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive05/META-INF/services/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive05/META-INF/services/java=
x.jdo.PersistenceManagerFactory
db/jdo/trunk/api2/test/schema/jdoconfig/Positive06/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive06/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive06/META-INF/jdoconfig.xml=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive07/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive07/META-INF/
=
db/jdo/trunk/api2/test/schema/jdoconfig/Positive07/META-INF/jdoconfig.xml=
Removed:
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative0/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative1/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative2/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative3/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative4/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative5/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative6/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative7/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative8/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive0/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive1/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive3/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive4/
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Positive5/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative0/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative1/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative2/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative3/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative4/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative5/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative6/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative7/
db/jdo/trunk/api2/test/schema/jdoconfig/Negative8/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive0/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive1/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive3/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive4/
db/jdo/trunk/api2/test/schema/jdoconfig/Positive5/
Modified:
db/jdo/trunk/api2-legacy/src/java/javax/jdo/Bundle.properties
db/jdo/trunk/api2-legacy/src/java/javax/jdo/Constants.java
db/jdo/trunk/api2-legacy/src/java/javax/jdo/JDOHelper.java
=
db/jdo/trunk/api2-legacy/src/java/javax/jdo/PersistenceManagerFactory.jav=
a
db/jdo/trunk/api2-legacy/src/schema/javax/jdo/jdoconfig_2_1.xsd
=
db/jdo/trunk/api2-legacy/test/java/javax/jdo/JDOHelperConfigTest.java
db/jdo/trunk/api2/src/java/javax/jdo/Bundle.properties
db/jdo/trunk/api2/src/java/javax/jdo/Constants.java
db/jdo/trunk/api2/src/java/javax/jdo/JDOHelper.java
db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManagerFactory.java
db/jdo/trunk/api2/src/schema/javax/jdo/jdoconfig_2_1.xsd
db/jdo/trunk/api2/test/java/javax/jdo/JDOHelperConfigTest.java
db/jdo/trunk/tck2-legacy/src/conf/jdo-2_1-signatures.txt
db/jdo/trunk/tck2/src/conf/jdo-2_1-signatures.txt
Modified: db/jdo/trunk/api2-legacy/src/java/javax/jdo/Bundle.properties
URL: =
http://svn.apache.org/viewvc/db/jdo...ava/javax/jdo/=
Bundle.properties?view=3Ddiff&rev=3D564384&r1=3D564383&r2=3D564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- db/jdo/trunk/api2-legacy/src/java/javax/jdo/Bundle.properties =
(original)
+++ db/jdo/trunk/api2-legacy/src/java/javax/jdo/Bundle.properties Thu =
Aug 9 14:20:35 2007
@@ -25,8 +25,9 @@
EXC_GetPMFUnexpectedException=3DUnexpect
ed exception caught.
EXC_GetPMFClassNotFound=3DClass {0} was not found.
EXC_GetPMFIllegalAccess=3DIllegal Access for class {0}.
-EXC_GetPMFNoClassNameProperty=3DA property named =
javax.jdo.PersistenceManagerFactoryClass must be specified, \=20
-or the jar file with the default =
META-INF/services/javax.jdo.PersistenceManagerFactory entry must be in =
the classpath.
+EXC_GetPMFNoPMFClassNamePropertyOrPUNam
eProperty=3DA property named =
javax.jdo.PersistenceManagerFactoryClass must be specified, \
+or a jar file with a =
META-INF/services/javax.jdo.PersistenceManagerFactory entry must be in =
the classpath, \
+or a property named javax.jdo.option.PersistenceUnitName must be =
specified.
EXC_IOExceptionDuringServiceLookup=3DIO error while attempting to =
lookup PMF name \
via META-INF/services/javax.jdo.PersistenceManagerFactory
MSG_FailedObject=3DFailedObject:
@@ -80,10 +81,10 @@
EXC_DateStringConstructor: Error parsing Date string "{0}" at position =
{1} \
using date format "{2}".
MSG_unknown: unknown
- EXC_DuplicateRequestedPersistenceUnitFou
ndInDifferentConfigs: Duplicate =
\
-persistence unit name "{0}" found in {1} and {2}.
- EXC_DuplicateRequestedPersistenceUnitFou
ndInSameConfig: Duplicate =
persistence \
-unit name "{0}" found in {1}.
+EXC_DuplicateRequestedNamedPMFFoundInDi
fferentConfigs: Duplicate \
+PMF name "{0}" found in {1} and {2}.
+EXC_DuplicateRequestedNamedPMFFoundInSa
meConfig: Duplicate PMF \
+name "{0}" found in {1}.
EXC_UnableToInvokeCreateEMFMethod: Unable to invoke \
javax.persistence.Persistence.createEntityManagerFactory(String)
EXC_UnableToCastEMFToPMF: Unable to cast EntityManagerFactory class =
{0} \
@@ -95,10 +96,10 @@
EXC_SAXParseException: Exception parsing configuration {0}\
at line {1}, column {2}
EXC_SAXException: Exception parsing configuration {0}
-EXC_DuplicatePropertyFound: Duplicate property name "{0}" found in =
persistence \
-unit name "{1}" found in {2}.
- EXC_DuplicatePersistenceUnitNameProperty
FoundWithinUnitConfig: =
Duplicate \
-persistence unit name found in {2}: attribute is "{0}", element is =
"{1}"
+EXC_DuplicatePropertyFound: Duplicate property name "{0}" found in PMF =
\
+configuration with name "{1}" found in {2}.
+EXC_DuplicatePMFNamePropertyFoundWithin
Config: Duplicate \
+PMF name found in {2}: attribute is "{0}", element is "{1}"
EXC_PropertyElementHasNoNameAttribute: Found <property> element with =
no \
"name" attribute in {0}
EXC_PropertyElementNameAttributeHasNoVal
ue: Found <property> element =
name \
@@ -111,5 +112,5 @@
"listener" missing value in {0}
EXC_InvalidJDOConfigNoRoot: No root <jdoconfig> element found in {0}
EXC_NoPMFConfigurableViaPropertiesOrXML:
No PersistenceManagerFactory \
-configurable via properties resource "{0}" or no persistence unit named =
"{0}" \
-found using resource loader {1}
+configurable via properties resource "{0}" or no named PMF or =
persistence unit\
+named "{0}" found using resource loader {1}
Modified: db/jdo/trunk/api2-legacy/src/java/javax/jdo/Constants.java
URL: =
http://svn.apache.org/viewvc/db/jdo...ava/javax/jdo/=
Constants.java?view=3Ddiff&rev=3D564384&r1=3D564383&r2=3D564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- db/jdo/trunk/api2-legacy/src/java/javax/jdo/Constants.java =
(original)
+++ db/jdo/trunk/api2-legacy/src/java/javax/jdo/Constants.java Thu Aug =
9 14:20:35 2007
@@ -98,6 +98,14 @@
=3D "class";
/**
* The name of the persistence manager factory element's
+ * "name" attribute.
+ *
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_NAME
+ =3D "name";
+ /**
+ * The name of the persistence manager factory element's
* "persistence-unit-name" attribute.
*
* @since 2.1
@@ -649,6 +657,14 @@
*/
static String PROPERTY_PERSISTENCE_UNIT_NAME
=3D "javax.jdo.option.PersistenceUnitName";
+ /**
+ * "javax.jdo.option.Name"
+ *
+ * @see PersistenceManagerFactory#getName()
+ * @since 2.1
+ */
+ static String PROPERTY_NAME
+ =3D "javax.jdo.option.Name";
=20
/**
* "javax.jdo.option.InstanceLifecycleListener"
@@ -703,7 +719,7 @@
*
* @since 2.1
*/
- static String PROPERTY_SERVER_TIME_ZONE_ID
+ static String PROPERTY_SERVER_TIME_ZONE_ID
=3D "javax.jdo.option.ServerTimeZoneID";
=20
/**
Modified: db/jdo/trunk/api2-legacy/src/java/javax/jdo/JDOHelper.java
URL: =
http://svn.apache.org/viewvc/db/jdo...ava/javax/jdo/=
JDOHelper.java?view=3Ddiff&rev=3D564384&r1=3D564383&r2=3D564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- db/jdo/trunk/api2-legacy/src/java/javax/jdo/JDOHelper.java =
(original)
+++ db/jdo/trunk/api2-legacy/src/java/javax/jdo/JDOHelper.java Thu Aug =
9 14:20:35 2007
@@ -22,10 +22,14 @@
=20
package javax.jdo;
=20
-import org.w3c.dom.*;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.ErrorHandler;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
+import org.w3c.dom.NamedNodeMap;
=20
import javax.jdo.spi.I18NHelper;
import javax.jdo.spi.JDOImplHelper;
@@ -41,13 +45,26 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
-import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
-import java.util.*;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.ArrayList;
+import java.util.Properties;
+import java.util.Enumeration;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
=20
=20
/**
@@ -64,7 +81,7 @@
*=20
* @version 2.1
*/
-public class JDOHelper extends Object implements Constants {
+public class JDOHelper implements Constants {
=20
/**
* A mapping from jdoconfig.xsd element attributes to PMF =
properties.
@@ -146,6 +163,9 @@
PMF_ATTRIBUTE_PERSISTENCE_UNIT_NAME,
PROPERTY_PERSISTENCE_UNIT_NAME);
xref.put(
+ PMF_ATTRIBUTE_NAME,
+ PROPERTY_NAME);
+ xref.put(
PMF_ATTRIBUTE_RESTORE_VALUES,
PROPERTY_RESTORE_VALUES);
xref.put(
@@ -628,11 +648,18 @@
* @see #getPersistenceManagerFactory(java.util.Map,ClassLoader)
*/
public static PersistenceManagerFactory =
getPersistenceManagerFactory
- (Map props) {
+ (Map props)
+ {
ClassLoader cl =3D getContextClassLoader();
return getPersistenceManagerFactory (props, cl);
}
=20
+ public static PersistenceManagerFactory =
getPersistenceManagerFactory
+ (Map props, ClassLoader cl)
+ {
+ return getPersistenceManagerFactory(props, cl, cl);
+ }
+
/**
* Get a <code>PersistenceManagerFactory</code> based on a=20
* <code>Map</code> instance and a class loader.
@@ -654,6 +681,7 @@
* <BR>"javax.jdo.mapping.Catalog",
* <BR>"javax.jdo.mapping.Schema",
* <BR>"javax.jdo.option.PersistenceUnitName".
+ * <BR>"javax.jdo.option.Name".
* </code>
* and properties of the form
* =
<BR><code>javax.jdo.option.InstanceLifecycleListener.{listenerClass}=3D{p=
cClasses}</code>
@@ -682,58 +710,74 @@
* @return the <code>PersistenceManagerFactory</code>.
* @param props a <code>Properties</code> instance with properties =
of the=20
* <code>PersistenceManagerFactory</code>.
- * @param cl the class loader to use to load the=20
+ * @param resourceLoader the class loader to use to load resources =
(if
+ * resource loading is necessary)
+ * @param pmfClassLoader the class loader to use to load the
* <code>PersistenceManagerFactory</code> class
*/
public static PersistenceManagerFactory =
getPersistenceManagerFactory
- (Map props, ClassLoader cl) {
+ (Map props, ClassLoader resourceLoader, ClassLoader =
pmfClassLoader)
+ {
String pmfClassName =3D (String) props.get (
- PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLA
SS); //NOI18N
+ PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLA
SS);
+
if (pmfClassName =3D=3D null) {
+ // no PMF class name property -- try to find via services =
lookup
try {
- pmfClassName =3D getPMFClassNameViaServiceLookup(cl);
+ pmfClassName =3D =
getPMFClassNameViaServiceLookup(resource
Loader);
}
catch (IOException e) {
throw new JDOFatalInternalException(msg.msg(
"EXC_IOExceptionDuringServiceLookup"), e); // =
NOI18N
}
- if (pmfClassName =3D=3D null) {
- throw new JDOFatalUserException(msg.msg(
- "EXC_GetPMFNoClassNameProperty")); // NOI18N
+ }
+
+ if (pmfClassName !=3D null) {
+ try {
+ Class pmfClass =3D pmfClassLoader.loadClass =
(pmfClassName);
+ Method pmfMethod =3D pmfClass.getMethod(
+ "getPersistenceManagerFactory", //NOI18N
+ new Class[] {Map.class});
+ return (PersistenceManagerFactory) pmfMethod.invoke (
+ null, new Object[] {props});
+ } catch (ClassNotFoundException cnfe) {
+ throw new JDOFatalUserException (msg.msg(
+ "EXC_GetPMFClassNotFound", pmfClassName), cnfe); =
//NOI18N
+ } catch (IllegalAccessException iae) {
+ throw new JDOFatalUserException (msg.msg(
+ "EXC_GetPMFIllegalAccess", pmfClassName), iae); =
//NOI18N
+ } catch (NoSuchMethodException nsme) {
+ throw new JDOFatalInternalException (msg.msg(
+ "EXC_GetPMFNoSuchMethod"), nsme); //NOI18N
+ } catch (InvocationTargetException ite) {
+ Throwable nested =3D ite.getTargetException();
+ if (nested instanceof JDOException) {
+ throw (JDOException)nested;
+ } else throw new JDOFatalInternalException (msg.msg(
+ "EXC_GetPMFUnexpectedException"), ite); //NOI18N
+ } catch (NullPointerException e) {
+ throw new JDOFatalInternalException (msg.msg(
+ "EXC_GetPMFNullPointerException", pmfClassName), =
e); //NOI18N
+ } catch (ClassCastException e) {
+ throw new JDOFatalInternalException (msg.msg(
+ "EXC_GetPMFClassCastException", pmfClassName), e); =
//NOI18N
+ } catch (Exception e) {
+ throw new JDOFatalInternalException (msg.msg(
+ "EXC_GetPMFUnexpectedException"), e); //NOI18N
}
}
- try {
- Class pmfClass =3D cl.loadClass (pmfClassName);
- Method pmfMethod =3D pmfClass.getMethod(
- "getPersistenceManagerFactory", //NOI18N
- new Class[] {Map.class});
- return (PersistenceManagerFactory) pmfMethod.invoke (
- null, new Object[] {props});
- } catch (ClassNotFoundException cnfe) {
- throw new JDOFatalUserException (msg.msg(
- "EXC_GetPMFClassNotFound", pmfClassName), cnfe); =
//NOI18N
- } catch (IllegalAccessException iae) {
- throw new JDOFatalUserException (msg.msg(
- "EXC_GetPMFIllegalAccess", pmfClassName), iae); =
//NOI18N
- } catch (NoSuchMethodException nsme) {
- throw new JDOFatalInternalException (msg.msg(
- "EXC_GetPMFNoSuchMethod"), nsme); //NOI18N
- } catch (InvocationTargetException ite) {
- Throwable nested =3D ite.getTargetException();
- if (nested instanceof JDOException) {
- throw (JDOException)nested;
- } else throw new JDOFatalInternalException (msg.msg(
- "EXC_GetPMFUnexpectedException"), ite); //NOI18N
- } catch (NullPointerException e) {
- throw new JDOFatalInternalException (msg.msg(
- "EXC_GetPMFNullPointerException", pmfClassName), e); =
//NOI18N
- } catch (ClassCastException e) {
- throw new JDOFatalInternalException (msg.msg(
- "EXC_GetPMFClassCastException", pmfClassName), e); =
//NOI18N
- } catch (Exception e) {
- throw new JDOFatalInternalException (msg.msg(
- "EXC_GetPMFUnexpectedException"), e); //NOI18N
+ =20
+ // else no PMF class name given; check PU name
+ String puName =3D (String) props.get(
+ PROPERTY_PERSISTENCE_UNIT_NAME);
+
+ if (puName !=3D null && !"".equals(puName.trim())) {
+ return getPMFFromEMF(puName, props, pmfClassLoader);
}
+
+ // else no PMF class name or PU name
+ throw new JDOFatalUserException(msg.msg(
+ " EXC_GetPMFNoPMFClassNamePropertyOrPUName
Property"));
}
=20
/**
@@ -837,23 +881,30 @@
}
=20
/**
- * Returns a named {@link PersistenceManagerFactory} with the given
- * persistence unit name or,
- * if not found, a {@link PersistenceManagerFactory} configured =
based
+ * Returns a {@link PersistenceManagerFactory} configured based
* on the properties stored in the resource at
- * <code>name</code>. Loads the Properties via
+ * <code>name</code>, or, if not found, returns a
+ * {@link PersistenceManagerFactory} with the given
+ * name or, if not found, returns a
+ * <code>javax.persistence.EntityManagerFactory</code> cast to a
+ * {@link PersistenceManagerFactory}. Loads the properties via
* <code>resourceLoader</code>, and creates a {@link
* PersistenceManagerFactory} with <code>pmfLoader</code>. Any
* exceptions thrown during resource loading will
* be wrapped in a {@link JDOFatalUserException}.
- * If multiple persistence units with the requested name are found, =
a
+ * If multiple PMFs with the requested name are found, a
* {@link JDOFatalUserException} is thrown.
* @since 2.0
- * @param name the persistence unit name or resource containing the =
Properties
- * @param resourceLoader the class loader to use to load the name
+ * @param name interpreted as the name of the resource containing =
the PMF
+ * properties, the name of the PMF, or the persistence unit name, =
in that
+ * order.
+ * @param resourceLoader the class loader to use to load properties =
or
+ * configuration file resources
* @param pmfLoader the class loader to use to load the=20
- * <code>PersistenceManagerFactory</code> class
- * @return the PersistenceManagerFactory
+ * <code>PersistenceManagerFactory</code> or
+ * <code>javax.persistence.EntityManagerFactory</code> classes
+ * @return the PersistenceManagerFactory with properties in the =
given
+ * resource, with the given name, or with the given persitence unit =
name=20
*/
public static PersistenceManagerFactory =
getPersistenceManagerFactory
(String name, ClassLoader resourceLoader, ClassLoader =
pmfLoader) {
@@ -865,16 +916,16 @@
throw new JDOFatalUserException (msg.msg (
"EXC_GetPMFNullPMFLoader")); //NOI18N
=20
+ Properties props =3D null;
InputStream in =3D null;
if (name !=3D null) { // then try to load resources from =
properties file
- Properties props =3D new Properties ();
try {
- in =3D resourceLoader.getResourceAsStream (name);
+ in =3D resourceLoader.getResourceAsStream(name);
if (in !=3D null) {
// then some kind of resource was found by the =
given name;
// assume that it's a properties file and proceed =
as usual
- props.load (in);
- return getPersistenceManagerFactory (props, =
pmfLoader);
+ props =3D new Properties();
+ props.load(in);
}
}
catch (IOException ioe) {
@@ -889,93 +940,58 @@
}
}
// JDO 2.1: else name was null or no resource found by given =
name;
- // assume name represents name of PU
+ // first assume that name represents name of named PMF
=20
- PersistenceManagerFactory pmf =3D getPersistenceUnit(
- name =3D=3D null ? "" : name.trim(),
- resourceLoader,
- pmfLoader
- );
- if (pmf !=3D null) {
- return pmf;
+ Map properties =3D props;
+ if (properties =3D=3D null) {
+ properties =3D getNamedPMFProperties(name, resourceLoader);
+ }
+
+ if (properties !=3D null) {
+ String nameInProperties =3D (String) =
properties.get(PROPERTY_NAME);
+ nameInProperties =3D nameInProperties =3D=3D null ? "" : =
nameInProperties;
+ if (nameInProperties =3D=3D null) {
+ properties.put(PROPERTY_NAME, name);
+ }
+ return getPersistenceManagerFactory(
+ properties, resourceLoader, pmfLoader);
}
=20
- // else no PU found
+ // else no properties found; next, assume name is a PU name
+ if (name !=3D null && !"".equals(name.trim())) {
+ PersistenceManagerFactory pmf =3D
+ getPMFFromEMF(name, null, pmfLoader);
+ if (pmf !=3D null) {
+ return pmf;
+ }
+ }
+ =20
+ // else no PMF found
throw new JDOFatalUserException (msg.msg (
"EXC_NoPMFConfigurableViaPropertiesOrXML",
name,
resourceLoader)); //NOI18N
}
=20
- /** Find and return<BR><ul>
- * <li>a {@link PersistenceManagerFactory} with the given =
name,</li>
- * <li>a JPA <code>EntityManagerFactory</code> cast to a
- * {@link PersistenceManagerFactory}, or <li>
- * <li>null if not found.</li>
- * If name is null
- * or blank, this method attempts to return the anonymous
- * {@link PersistenceManagerFactory}. If multiple persistence =
units with
- * the given name are found (including the anonymous persistence =
unit),
- * this method will throw {@link JDOFatalUserException}.
- *
- * @param name The persistence unit name, or null, the empty string =
or a
- * string only containing whitespace characters for the anonymous
- * persistence unit.
- * @param resourceLoader The ClassLoader used to load the standard =
JDO
- * configuration file(s) given in the constant
- * {@link Constants#JDOCONFIG_RESOURCE_NAME}.
- * @param pmfLoader The loader used to load the
- * {@link PersistenceManagerFactory} implementation class.
- * @return A {@link PersistenceManagerFactory} corresponding to the
- * persistence unit name if found, or null if not found.
- * @throws JDOFatalUserException if multiple persistence units are =
found
- * with the given name, or any other is encountered.
- * @since 2.1
- */
- private static PersistenceManagerFactory getPersistenceUnit(
- String name,
- ClassLoader resourceLoader,
- ClassLoader pmfLoader) {
- Map properties =3D getPersistenceUnitProperties(
- name, resourceLoader, JDOCONFIG_RESOURCE_NAME);
-
- if (properties !=3D null) { // found requested JDO persistence =
unit props
- return getPersistenceManagerFactory(properties,
pmfLoader);
- }
-
- // else try to return PMF from JPA EMF
- if ("".equals(name)) { // no such thing as an anonymous JPA EMF
- return null;
- }
-
- // else try to return PMF from named JPA EMF
- return getPMFFromEMF(name, pmfLoader);
- }
-
- protected static Map getPersistenceUnitProperties(
- String name
- ) {
- return getPersistenceUnitProperties(
- name, getContextClassLoader(), JDOCONFIG_RESOURCE_NAME);
- }
-
- protected static Map getPersistenceUnitProperties(
+ protected static Map getNamedPMFProperties(
String name,
ClassLoader resourceLoader
) {
- return getPersistenceUnitProperties(
+ return getNamedPMFProperties(
name, resourceLoader, JDOCONFIG_RESOURCE_NAME);
}
=20
/**
- * Find and return the named {@link PersistenceManagerFactory}, or =
null if
+ * Find and return the named {@link PersistenceManagerFactory}'s =
properties,
+ * or null if
* not found. If name is null, return the anonymous
- * {@link PersistenceManagerFactory}. If multiple persistence =
units with
- * the given name are found (including anonymous), throw
+ * {@link PersistenceManagerFactory}'s properties.
+ * If multiple named PMF property sets with
+ * the given name are found (including anonymous ones), throw
* {@link JDOFatalUserException}.
* This method is here only to facilitate testing; the parameter
* "jdoconfigResourceName" in public usage should always have the =
value
- * given in the constant <code>JDOCONFIG_RESOURCE_NAME</code>.
+ * given in the constant {@link Constants#JDOCONFIG_RESOURCE_NAME}.
*
* @param name The persistence unit name, or null or blank for the
* anonymous persistence unit.
@@ -987,17 +1003,17 @@
* @return The named PersistenceManagerFactory properties if found, =
null if
* not.
* @since 2.1
- * @throws JDOFatalUserException if multiple persistence units are =
found
- * with the given name, or any other exception is encountered.
+ * @throws JDOFatalUserException if multiple named PMF property =
sets are
+ * found with the given name, or any other exception is =
encountered.
*/
- protected static Map getPersistenceUnitProperties(
+ protected static Map getNamedPMFProperties(
String name,
ClassLoader resourceLoader,
String jdoconfigResourceName
) {
/* JDO 2.1:
- Attempt to find & return named persistence unit here.
- If name =3D=3D null or name =3D=3D "", then we're looking for =
the default PMF.
+ Attempt to find & return named PMF properties here.
+ If name =3D=3D null or name =3D=3D "", then we're looking for =
the anonymous PMF.
=20
If we can't find it, this method returns null.
*/
@@ -1017,12 +1033,7 @@
ArrayList processedResources =3D new ArrayList();
=20
// get ready to parse XML
- DocumentBuilderFactory factory =3D
- =
implHelper.getRegisteredDocumentBuilderFactory();
- if (factory =3D=3D null) {
- factory =3D getDefaultDocumentBuilderFactory();
- }
-
+ DocumentBuilderFactory factory =3D =
getDocumentBuilderFactory();
do {
URL currentConfigURL =3D (URL) =
resources.nextElement();
if (processedResources.contains(currentConfigURL)) =
{
@@ -1033,8 +1044,10 @@
}
=20
Map/*<String,Map>*/ propertiesByNameInCurrentConfig =
=3D
- readPersistenceUnitProperties(
- currentConfigURL, name, factory);
+ readNamedPMFProperties(
+ currentConfigURL,
+ name,
+ factory);
=20
// try to detect duplicate requested PU
if =
(propertiesByNameInCurrentConfig.containsKey(name)) {
@@ -1045,7 +1058,7 @@
=20
if =
(propertiesByNameInAllConfigs.containsKey(name))
throw new JDOFatalUserException (msg.msg(
- =
" EXC_DuplicateRequestedPersistenceUnitFou
ndInDifferentConfigs",
+ =
" EXC_DuplicateRequestedNamedPMFFoundInDif
ferentConfigs",
"".equals(name)
? "(anonymous)"
: name,
@@ -1073,6 +1086,15 @@
}
=20
=20
+ protected static DocumentBuilderFactory getDocumentBuilderFactory() =
{
+ DocumentBuilderFactory factory =3D
+ implHelper.getRegisteredDocumentBuilderFactory();
+ if (factory =3D=3D null) {
+ factory =3D getDefaultDocumentBuilderFactory();
+ }
+ return factory;
+ }
+ =20
protected static DocumentBuilderFactory =
getDefaultDocumentBuilderFactory() {
DocumentBuilderFactory factory =3D =
DocumentBuilderFactory.newInstance();
factory.setIgnoringComments(true);
@@ -1084,6 +1106,14 @@
return factory;
}
=20
+ protected static ErrorHandler getErrorHandler() {
+ ErrorHandler handler =3D =
implHelper.getRegisteredErrorHandler();
+ if (handler =3D=3D null) {
+ handler =3D getDefaultErrorHandler();
+ }
+ return handler;
+ }
+ =20
protected static ErrorHandler getDefaultErrorHandler() {
return new ErrorHandler() {
public void error(SAXParseException exception)
@@ -1104,26 +1134,16 @@
}
=20
/**
- * Convenience method for retrieving the JPA persistence unit by =
the given
- * name. This method is equivalent to
- * calling {@link #getPMFFromEMF(String,ClassLoader)} with the =
context ClassLoader.
- * @param name The persistence unit name.
- * @see #getPMFFromEMF(String,ClassLoader)
- * @return The named EMF cast as a PMF.
- */
- protected static PersistenceManagerFactory getPMFFromEMF(String =
name) {
- return getPMFFromEMF(name, getContextClassLoader());
- }
-
- /**
* Attempts to locate a =
<code>javax.persistence.EntityManagerFactory</code>
* via the <code>javax.persistence.Persistence</code> method
* <code>createEntityManagerFactory(String)</code>
* and casts it to a {@link PersistenceManagerFactory}. It is a =
user error
- * if his chosen JPA vendor's <code>EntityManagerFactory</code>
+ * if his chosen JPA vendor's
+ * <code>javax.persistence.EntityManagerFactory</code>
* implementation class does not also implement
* {@link PersistenceManagerFactory}.
* @param name The persistence unit name.
+ * @param properties The properties of the persistence unit.
* @param loader The classloader used to attempt loading of the =
class
* <code>javax.persistence.Persistence</code>
* and <code>javax.persistence.PersistenceException</code>.
@@ -1151,8 +1171,8 @@
* </ul>
*/
protected static PersistenceManagerFactory getPMFFromEMF(
- String name, ClassLoader loader
- ) {
+ String name, Map properties, ClassLoader loader)
+ {
/*
This implementation uses reflection to try to get an EMF so =
that
javax.jdo, a Java SE API, does not introduce an unnecessary
@@ -1173,7 +1193,7 @@
=20
createEntityManagerFactoryMethod =3D =
persistenceClass.getMethod(
"createEntityManagerFactory",
- new Class[] { String.class });
+ new Class[] { String.class, Map.class });
=20
persistenceExceptionClass =3D
Class.forName(
@@ -1193,7 +1213,7 @@
try {
entityManagerFactory =3D
createEntityManagerFactoryMethod.invoke(
- persistenceClass, new Object[] { name });
+ persistenceClass, new Object[] { name, properties =
});
}
catch (RuntimeException x) {
if =
(persistenceExceptionClass.isAssignableFrom(x.getClass())) {
@@ -1228,7 +1248,7 @@
* persistence-manager-factory, then returns the map.
* @param url URL of a JDO configuration file compliant with
* javax/jdo/jdoconfig.xsd.
- * @param requestedPersistenceUnitName The name of the requested
+ * @param requestedPMFName The name of the requested
* persistence unit (allows for fail-fast).
* @param factory The <code>DocumentBuilderFactory</code> to use =
for XML
* parsing.
@@ -1236,36 +1256,20 @@
* the anonymous persistence unit, the
* value of the String key is the empty string, "".
*/
- protected static Map/*<String,Map>*/ readPersistenceUnitProperties(
+ protected static Map/*<String,Map>*/ readNamedPMFProperties(
URL url,
- String requestedPersistenceUnitName,
+ String requestedPMFName,
DocumentBuilderFactory factory
) {
- requestedPersistenceUnitName =3D requestedPersistenceUnitName =
=3D=3D null
+ requestedPMFName =3D requestedPMFName =3D=3D null
? ""
- : requestedPersistenceUnitName.trim();
+ : requestedPMFName.trim();
=20
Map propertiesByName =3D new HashMap();
InputStream in =3D null;
try {
DocumentBuilder builder =3D factory.newDocumentBuilder();
- =20
- builder.setErrorHandler(new ErrorHandler() {
- public void error(SAXParseException exception)
- throws SAXException {
- throw exception;
- }
-
- public void fatalError(SAXParseException exception)
- throws SAXException {
- throw exception;
- }
-
- public void warning(SAXParseException exception)
- throws SAXException {
- // gulp
- }
- });
+ builder.setErrorHandler(getErrorHandler());
=20
in =3D url.openStream();
Document doc =3D builder.parse(in);
@@ -1277,7 +1281,6 @@
);
}
=20
- // TODO: prefer using namespace-aware APIs
NodeList pmfs =3D root.getElementsByTagName(
ELEMENT_PERSISTENCE_MANAGER_FACTORY);
=20
@@ -1290,43 +1293,41 @@
Properties pmfPropertiesFromElements
=3D readPropertiesFromPMFSubelements(pmfElem
ent, =
url);
=20
- // for informative error handling, get PU name (or =
names) now
- String puNameFromAtts =3D
- pmfPropertiesFromAttributes.getProperty(
- PROPERTY_PERSISTENCE_UNIT_NAME);
- String puNameFromElem =3D
- pmfPropertiesFromElements.getProperty(
- PROPERTY_PERSISTENCE_UNIT_NAME);
-
- String puName =3D null;
- if (nullOrBlank(puNameFromAtts)) {
- // no PU name attribute given
- if (!nullOrBlank(puNameFromElem)) {
- // PU name element was given
- puName =3D puNameFromElem;
+ // for informative error handling, get name (or names) =
now
+ String pmfNameFromAtts =3D
+ =
pmfPropertiesFromAttributes.getProperty(PROPERTY_NAME);
+ String pmfNameFromElem =3D
+ =
pmfPropertiesFromElements.getProperty(PROPERTY_NAME);
+
+ String pmfName =3D null;
+ if (nullOrBlank(pmfNameFromAtts)) {
+ // no PMF name attribute given
+ if (!nullOrBlank(pmfNameFromElem)) {
+ // PMF name element was given
+ pmfName =3D pmfNameFromElem;
}
else {
- // PU name not given at all, means the =
"anonymous" PU
- puName =3D "";
+ // PMF name not given at all, means the =
"anonymous" PMF
+ pmfName =3D "";
}
}
else {
- // PU name given in an attribute
- if (!nullOrBlank(puNameFromElem)) {
- // exception -- PU name given as both att & =
elem
+ // PMF name given in an attribute
+ if (!nullOrBlank(pmfNameFromElem)) {
+ // exception -- PMF name given as both att & =
elem
throw new JDOFatalUserException(
msg.msg(
- =
" EXC_DuplicatePersistenceUnitNameProperty
FoundWithinUnitConfig",
- puNameFromAtts,
- puNameFromElem,
+ =
" EXC_DuplicatePMFNamePropertyFoundWithinC
onfig",
+ pmfNameFromAtts,
+ pmfNameFromElem,
url.toExternalForm()));
}
- puName =3D puNameFromAtts;
+ pmfName =3D pmfNameFromAtts;
}
- puName =3D puName =3D=3D null ? "" : puName.trim();
+ pmfName =3D pmfName =3D=3D null ? "" : pmfName.trim();
=20
// check for duplicate properties among atts & elems
- if (requestedPersistenceUnitName.equals(puName)) {
+ if (requestedPMFName.equals(pmfName)) {
Iterator it =3D
=
pmfPropertiesFromAttributes.keySet().iterator();
while (it.hasNext()) {
@@ -1336,7 +1337,7 @@
msg.msg(
"EXC_DuplicatePropertyFound",
property,
- puName,
+ pmfName,
url.toExternalForm()));
}
}
@@ -1348,16 +1349,16 @@
pmfProps.putAll(pmfPropertiesFromAttributes);
pmfProps.putAll(pmfPropertiesFromElements);
=20
- // check for duplicate requested PU name
- if (puName.equals(requestedPersistenceUnitName)
- && propertiesByName.containsKey(puName)) {
+ // check for duplicate requested PMF name
+ if (pmfName.equals(requestedPMFName)
+ && propertiesByName.containsKey(pmfName)) {
=20
throw new JDOFatalUserException(msg.msg(
- =
" EXC_DuplicateRequestedPersistenceUnitFou
ndInSameConfig",
- puName,
+ =
" EXC_DuplicateRequestedNamedPMFFoundInSam
eConfig",
+ pmfName,
url.toExternalForm()));
}
- propertiesByName.put(puName, pmfProps);
+ propertiesByName.put(pmfName, pmfProps);
}
return propertiesByName;
}
@@ -1576,7 +1577,7 @@
Properties props =3D new Properties ();
InputStream in =3D null;
try {
- in =3D new FileInputStream (propsFile);
+ in =3D new FileInputStream(propsFile);
props.load (in);
} catch (FileNotFoundException fnfe) {
throw new JDOFatalUserException (msg.msg (
Modified: =
db/jdo/trunk/api2-legacy/src/java/javax/jdo/PersistenceManagerFactory.jav=
a
URL: =
http://svn.apache.org/viewvc/db/jdo...ava/javax/jdo/=
PersistenceManagerFactory.java?view=3Ddiff&rev=3D564384&r1=3D564383&r2=3D=
564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- =
db/jdo/trunk/api2-legacy/src/java/javax/jdo/PersistenceManagerFactory.jav=
a (original)
+++ =
db/jdo/trunk/api2-legacy/src/java/javax/jdo/PersistenceManagerFactory.jav=
a Thu Aug 9 14:20:35 2007
@@ -22,14 +22,11 @@
=20
package javax.jdo;
=20
-import java.util.Properties;
-import java.util.Collection;
-
-import java.io.Serializable;
-
import javax.jdo.datastore.DataStoreCache;
-
import javax.jdo.listener.InstanceLifecycleListener;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Properties;
=20
/** The <code>PersistenceManagerFactory</code> is the interface to use =
to obtain
* <code>PersistenceManager</code> instances. =20
@@ -359,6 +356,19 @@
*/
void setDetachAllOnCommit(boolean flag);
=20
+ /**
+ * Sets the name of this PersistenceManagerFactory.
+ * @since 2.1
+ * @param name the name of this PMF
+ */
+ void setName(String name);
+
+ /**
+ * Gets the name of this PersistenceManagerFactory.
+ * @since 2.1
+ * @return the name of this PMF
+ */
+ String getName();
=20
/**
* Sets the PersistenceUnitName for this PersistenceManagerFactory.
Modified: =
db/jdo/trunk/api2-legacy/src/schema/javax/jdo/jdoconfig_2_1.xsd
URL: =
http://svn.apache.org/viewvc/db/jdo...chema/javax/jd=
o/jdoconfig_2_1.xsd?view=3Ddiff&rev=3D564384&r1=3D564383&r2=3D564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- db/jdo/trunk/api2-legacy/src/schema/javax/jdo/jdoconfig_2_1.xsd =
(original)
+++ db/jdo/trunk/api2-legacy/src/schema/javax/jdo/jdoconfig_2_1.xsd Thu =
Aug 9 14:20:35 2007
@@ -119,7 +119,9 @@
=20
<!-- Corresponds to standard JDO property =
javax.jdo.PersistenceManagerFactoryClass. -->
<xs:attribute name=3D"class" use=3D"optional"/>
- <!-- Corresponds to standard JDO property =
javax.jdo.option.PersistenceUnitName. The absence of this attributes =
implies the anonymous persistence unit. -->
+ <!-- Corresponds to standard JDO property =
javax.jdo.option.Name. The absence of this attribute implies the =
anonymous PMF. -->
+ <xs:attribute name=3D"name" use=3D"optional"/>
+ <!-- Corresponds to standard JDO property =
javax.jdo.option.PersistenceUnitName. -->
<xs:attribute name=3D"persistence-unit-name" use=3D"optional"/>
<!-- Corresponds to standard JDO property =
javax.jdo.option.Optimistic. -->
<xs:attribute name=3D"optimistic" use=3D"optional"/>
Modified: =
db/jdo/trunk/api2-legacy/test/java/javax/jdo/JDOHelperConfigTest.java
URL: =
http://svn.apache.org/viewvc/db/jdo...java/javax/jdo=
/JDOHelperConfigTest.java?view=3Ddiff&rev=3D564384&r1=3D564383&r2=3D56438=
4
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- =
db/jdo/trunk/api2-legacy/test/java/javax/jdo/JDOHelperConfigTest.java =
(original)
+++ =
db/jdo/trunk/api2-legacy/test/java/javax/jdo/JDOHelperConfigTest.java =
Thu Aug 9 14:20:35 2007
@@ -23,11 +23,11 @@
import javax.jdo.util.BatchTestRunner;
import java.io.IOException;
import java.io.InputStream;
+import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
-import java.net.URLClassLoader;
=20
/**
* Tests class javax.jdo.JDOHelper for META-INF/jdoconfig.xml =
compliance.
@@ -42,197 +42,108 @@
return new TestSuite(JDOHelperConfigTest.class);
}
=20
- protected static String JDOCONFIG_CLASSPATH_PREFIX =3D=20
- System.getProperty("basedir") + "/test/schema/jdoconfig";
-
- protected static Random RANDOM =3D new =
Random(System.currentTimeMillis());
-
- /**
- * Tests JDOHelper.getPersistenceUnitProperties using file
- * Positive0-jdoconfig.xml and PU name
- * "persistence-unit-name.positive0.pmf0"
- */
- public void testPositive00_PMF0_GetNamedPMFPropertie
s() throws =
IOException {
+ protected static String JDOCONFIG_CLASSPATH_PREFIX
+ =3D initJDOConfigClasspathPrefix();
=20
- try {
- URLClassLoader loader =3D new JDOConfigTestClassLoader(
- JDOCONFIG_CLASSPATH_PREFIX,
- getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive0", loader);
-
- Map expected =3D =
prepareInitialExpectedMap("positive0.pmf0", 2);
- String name =3D (String) =
expected.get(PROPERTY_PERSISTENCE_UNIT_NAME);
-
- Map actual =3D JDOHelper.getPersistenceUnitProperties(name, =
loader);
-
- assertNotNull("No properties found", actual);
- assertEqualProperties(expected, actual);
- } catch (Exception e) {
- e.printStackTrace();
+ protected static String initJDOConfigClasspathPrefix() {
+ String basedir =3D System.getProperty("basedir");
+ if (basedir !=3D null) {
+ if (!basedir.endsWith("/")) {
+ basedir +=3D "/";
+ }
+ } else {
+ basedir =3D "";
}
+ return basedir + "test/schema/jdoconfig";
}
=20
- /**
- * Tests JDOHelper.getPersistenceUnitProperties using file
- * Positive0-jdoconfig.xml and PU name
- * "persistence-unit-name.positive0.pmf1"
- */
- public void testPositive00_PMF1_GetNamedPMFPropertie
s() throws =
IOException {
- URLClassLoader loader =3D new JDOConfigTestClassLoader(
- JDOCONFIG_CLASSPATH_PREFIX,
- getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive0", loader);
-
- Map expected =3D prepareInitialExpectedMap("positive0.pmf1", =
2);
- String name =3D (String) =
expected.get(PROPERTY_PERSISTENCE_UNIT_NAME);
-
- Map actual =3D 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 testPositive00_PMF2_GetNamedPMFPropertie
s() throws =
IOException {
- URLClassLoader loader =3D new JDOConfigTestClassLoader(
- JDOCONFIG_CLASSPATH_PREFIX,
- getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive0", loader);
-
- Map expected =3D prepareInitialExpectedMap("positive0.pmf2", =
2);
- String name =3D (String) =
expected.get(PROPERTY_PERSISTENCE_UNIT_NAME);
-
- Map actual =3D 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 testPositive00_PMF3_GetNamedPMFPropertie
s() throws =
IOException {
- URLClassLoader loader =3D new JDOConfigTestClassLoader(
- JDOCONFIG_CLASSPATH_PREFIX,
- getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive0", loader);
-
- Map expected =3D prepareInitialExpectedMap("positive0.pmf3", 2, =
2);
- String name =3D (String) =
expected.get(PROPERTY_PERSISTENCE_UNIT_NAME);
-
- Map actual =3D 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 testPositive00_PMF4_GetNamedPMFPropertie
s() throws =
IOException {
- URLClassLoader loader =3D new JDOConfigTestClassLoader(
- JDOCONFIG_CLASSPATH_PREFIX,
- getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive0", loader);
-
- Map expected =3D prepareInitialExpectedMap("positive0.pmf4", 0, =
2);
- String name =3D (String) =
expected.get(PROPERTY_PERSISTENCE_UNIT_NAME);
-
- Map actual =3D JDOHelper.getPersistenceUnitProperties(name, =
loader);
-
- assertNotNull("No properties found", actual);
- assertEqualProperties(expected, actual);
- }
+ protected static Random RANDOM =3D new =
Random(System.currentTimeMillis());
=20
- 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
+ protected Map prepareInitialExpectedMap(
+ String testVariant,
+ int listenerCount,
+ int vendorSpecificPropertyCount,
+ boolean excludeName,
+ boolean excludePUName
) {
Map expected =3D new HashMap();
=20
+ if (!excludeName) {
+ expected.put(
+ PROPERTY_NAME,
+ PMF_ATTRIBUTE_NAME + "." + testVariant);
+ }
+ if (!excludePUName) {
+ expected.put(
+ PROPERTY_PERSISTENCE_UNIT_NAME,
+ PMF_ATTRIBUTE_PERSISTENCE_UNIT_NAME + "." + =
testVariant);
+ }
+
expected. put(PROPERTY_PERSISTENCE_MANAGER_FACTORY
_CLASS,
- PMF_ATTRIBUTE_CLASS + "." + testVariant);
+ PMF_ATTRIBUTE_CLASS + "." + testVariant);
expected.put(
- PROPERTY_CONNECTION_DRIVER_NAME,
- PMF_ATTRIBUTE_CONNECTION_DRIVER_NAME + "." + testVariant);
+ PROPERTY_CONNECTION_DRIVER_NAME,
+ PMF_ATTRIBUTE_CONNECTION_DRIVER_NAME + "." + =
testVariant);
expected.put(
- PROPERTY_CONNECTION_FACTORY_NAME,
- PMF_ATTRIBUTE_CONNECTION_FACTORY_NAME + "." + testVariant);
+ PROPERTY_CONNECTION_FACTORY_NAME,
+ PMF_ATTRIBUTE_CONNECTION_FACTORY_NAME + "." + =
testVariant);
expected.put(
- PROPERTY_CONNECTION_FACTORY2_NAME,
- PMF_ATTRIBUTE_CONNECTION_FACTORY2_NAME + "." + =
testVariant);
+ PROPERTY_CONNECTION_FACTORY2_NAME,
+ PMF_ATTRIBUTE_CONNECTION_FACTORY2_NAME + "." + =
testVariant);
expected.put(
- PROPERTY_CONNECTION_PASSWORD,
- PMF_ATTRIBUTE_CONNECTION_PASSWORD + "." + testVariant);
+ PROPERTY_CONNECTION_PASSWORD,
+ PMF_ATTRIBUTE_CONNECTION_PASSWORD + "." + testVariant);
expected.put(
- PROPERTY_CONNECTION_URL,
- PMF_ATTRIBUTE_CONNECTION_URL + "." + testVariant);
+ PROPERTY_CONNECTION_URL,
+ PMF_ATTRIBUTE_CONNECTION_URL + "." + testVariant);
expected.put(
- PROPERTY_CONNECTION_USER_NAME,
- PMF_ATTRIBUTE_CONNECTION_USER_NAME + "." + testVariant);
+ PROPERTY_CONNECTION_USER_NAME,
+ PMF_ATTRIBUTE_CONNECTION_USER_NAME + "." + =
testVariant);
expected.put(
- PROPERTY_IGNORE_CACHE,
- PMF_ATTRIBUTE_IGNORE_CACHE + "." + testVariant);
+ PROPERTY_IGNORE_CACHE,
+ PMF_ATTRIBUTE_IGNORE_CACHE + "." + testVariant);
expected.put(
- PROPERTY_MAPPING,
- PMF_ATTRIBUTE_MAPPING + "." + testVariant);
+ PROPERTY_MAPPING,
+ PMF_ATTRIBUTE_MAPPING + "." + testVariant);
expected.put(
- PROPERTY_MULTITHREADED,
- PMF_ATTRIBUTE_MULTITHREADED + "." + testVariant);
+ PROPERTY_MULTITHREADED,
+ PMF_ATTRIBUTE_MULTITHREADED + "." + testVariant);
expected.put(
- PROPERTY_NONTRANSACTIONAL_READ,
- PMF_ATTRIBUTE_NONTRANSACTIONAL_READ + "." + testVariant);
+ PROPERTY_NONTRANSACTIONAL_READ,
+ PMF_ATTRIBUTE_NONTRANSACTIONAL_READ + "." + =
testVariant);
expected.put(
- PROPERTY_NONTRANSACTIONAL_WRITE,
- PMF_ATTRIBUTE_NONTRANSACTIONAL_WRITE + "." + testVariant);
+ PROPERTY_NONTRANSACTIONAL_WRITE,
+ PMF_ATTRIBUTE_NONTRANSACTIONAL_WRITE + "." + =
testVariant);
expected.put(
- PROPERTY_OPTIMISTIC,
- PMF_ATTRIBUTE_OPTIMISTIC + "." + testVariant);
+ PROPERTY_OPTIMISTIC,
+ PMF_ATTRIBUTE_OPTIMISTIC + "." + testVariant);
expected.put(
- PROPERTY_PERSISTENCE_UNIT_NAME,
- PMF_ATTRIBUTE_PERSISTENCE_UNIT_NAME + "." + testVariant);
+ PROPERTY_RESTORE_VALUES,
+ PMF_ATTRIBUTE_RESTORE_VALUES + "." + testVariant);
expected.put(
- PROPERTY_RESTORE_VALUES,
- PMF_ATTRIBUTE_RESTORE_VALUES + "." + testVariant);
+ PROPERTY_RETAIN_VALUES,
+ PMF_ATTRIBUTE_RETAIN_VALUES + "." + testVariant);
expected.put(
- PROPERTY_RETAIN_VALUES,
- PMF_ATTRIBUTE_RETAIN_VALUES + "." + testVariant);
+ PROPERTY_DETACH_ALL_ON_COMMIT,
+ PMF_ATTRIBUTE_DETACH_ALL_ON_COMMIT + "." + =
testVariant);
expected.put(
- PROPERTY_DETACH_ALL_ON_COMMIT,
- PMF_ATTRIBUTE_DETACH_ALL_ON_COMMIT + "." + testVariant);
- expected.put(
- PROPERTY_SERVER_TIME_ZONE_ID,
- PMF_ATTRIBUTE_SERVER_TIME_ZONE_ID + "." + testVariant);
+ PROPERTY_SERVER_TIME_ZONE_ID,
+ PMF_ATTRIBUTE_SERVER_TIME_ZONE_ID + "." + testVariant);
=20
// listeners
- for (int i =3D 0; i < numListeners; i++) {
+ for (int i =3D 0; i < listenerCount; i++) {
expected.put(
- PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTE
NER +
- "listener." + testVariant + ".listener" + i,
- "classes." + testVariant + ".classes" + i
+ PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTE
NER +
+ "listener." + testVariant + ".listener" + =
i,
+ "classes." + testVariant + ".classes" + i
);
}
=20
- // properties
- for (int i =3D 0; i < numProperties; i++) {
+ // vendor-specific properties
+ for (int i =3D 0; i < vendorSpecificPropertyCount; i++) {
expected.put(
- "property." + testVariant + ".name" + i,
- "property." + testVariant + ".value" + i
+ "property." + testVariant + ".name" + i,
+ "property." + testVariant + ".value" + i
);
}
=20
@@ -248,240 +159,364 @@
String actualValue =3D (String) actual.get(key);
=20
assertEquals(
- "Actual property at key [" + key + "] with value [" +
- actualValue + "] not equal to expected value [" +
- expectedValue + "]",
- expectedValue,
- actualValue);
+ "Actual property at key [" + key + "] with value [" =
+
+ actualValue + "] not equal to expected =
value [" +
+ expectedValue + "]",
+ expectedValue,
+ actualValue);
}
}
=20
- /**
- * Tests JDOHelper.getPersistenceUnitProperties using file
- * Positive0-jdoconfig.xml and PU name
- * "persistence-unit-name.positive0.pmf0"
- */
- public void =
testPositive01_DuplicatePUsInDifferentCo
nfigFilesButNotRequested() =
throws IOException {
-
+ protected void doPositiveTest(
+ String[] classpaths,
+ String testVariantName,
+ int listenerCount,
+ int vendorSpecificPropertyCount,
+ boolean checkEqualProperties)
+ throws IOException {
+ =20
URLClassLoader loader =3D new JDOConfigTestClassLoader(
JDOCONFIG_CLASSPATH_PREFIX,
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive1/1a", loader);
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive1/1b", loader);
=20
- Map props =3D JDOHelper.getPersistenceUnitProperties(null, =
loader);
- assertNotNull(props);
+ for (int i =3D 0; i < classpaths.length; i++) {
+ ClasspathHelper.addFile(classpaths[i], loader);
+ }
+
+ Map expected =3D prepareInitialExpectedMap(
+ testVariantName,
+ listenerCount,
+ vendorSpecificPropertyCount,
+ false,
+ false);
+ =20
+ String name =3D testVariantName =3D=3D null
+ ? null
+ : (String) expected.get(PROPERTY_NAME);
+
+ Map actual =3D JDOHelper.getNamedPMFProperties(name, loader);
+
+ assertNotNull("No properties found", actual);
+ if (checkEqualProperties) {
+ assertEqualProperties(expected, actual);
+ }
+ }
+
+ public void =
testPositive00_PMF0_BasicPMFConfigUsingO
nlyStandardAttributesAndListeners=
()
+ throws IOException {
+ doPositiveTest(
+ new String[]{JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive00"},
+ "positive00.pmf0",
+ 2,
+ 0,
+ true);
+ }
+
+ public void =
testPositive00_PMF1_BasicPMFConfigUsingO
nlyPropertyElementsWithStandardJa=
vaxDotJDOProperties()
+ throws IOException {
+ doPositiveTest(
+ new String[]{JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive00"},
+ "positive00.pmf1",
+ 2,
+ 0,
+ true);
+ }
+
+ public void =
testPositive00_PMF2_NestedPropertyElemen
tsWithOnlyStandardAttributeNames(=
)
+ throws IOException {
+ doPositiveTest(
+ new String[]{JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive00"},
+ "positive00.pmf2",
+ 2,
+ 0,
+ true);
+ }
+
+ public void =
testPositive00_PMF3_StandardAttributesPl
usNonstandardPropertiesInProperty=
Elements()
+ throws IOException {
+ doPositiveTest(
+ new String[]{JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive00"},
+ "positive00.pmf3",
+ 2,
+ 2,
+ true);
+ }
+
+ public void =
testPositive00_PMF4_StandardAttributesPl
usNonstandardAttributes()
+ throws IOException {
+ doPositiveTest(
+ new String[]{JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive00"},
+ "positive00.pmf4",
+ 0,
+ 2,
+ true);
+ }
+
+ public void =
testPositive01_DuplicatePUsInDifferentCo
nfigFilesButNotRequested()
+ throws IOException {
+
+ doPositiveTest(
+ new String[]{
+ JDOCONFIG_CLASSPATH_PREFIX + "/Positive01/1a",
+ JDOCONFIG_CLASSPATH_PREFIX + "/Positive01/1b"
+ },
+ null,
+ 0,
+ 2,
+ false);
}
=20
- /**
- * Tests JDOHelper.getPMFClassNameViaServiceLookup
- */
- public void testPositive03_PMF0_PMFClassNameViaServi
cesLookup() =
throws IOException {
+ public void testPositive03_PMF0_PMFClassNameViaServi
cesLookup()
+ throws IOException {
=20
URLClassLoader loader =3D new JDOConfigTestClassLoader(
JDOCONFIG_CLASSPATH_PREFIX,
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive3", loader);
+ ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive03", loader);
=20
- String expected =3D "class.positive3.pmf0";
+ String expected =3D "class.positive03.pmf0";
String actual =3D =
JDOHelper. getPMFClassNameViaServiceLookup(loader);
=20
assertNotNull("No PMF name found via services lookup", actual);
assertEquals(expected, actual);
}
=20
- /**
- * Tests JDOHelper.getPMFClassNameViaServiceLookup
- */
- public void testPositive04_PMF0_PMFClassNameViaServi
cesLookup() =
throws IOException {
+ public void testPositive04_PMF0_PMFClassNameViaServi
cesLookup()
+ throws IOException {
=20
URLClassLoader loader =3D new JDOConfigTestClassLoader(
JDOCONFIG_CLASSPATH_PREFIX,
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive4", loader);
+ ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive04", loader);
=20
- String expected =3D "class.positive4.pmf0";
+ String expected =3D "class.positive04.pmf0";
String actual =3D =
JDOHelper. getPMFClassNameViaServiceLookup(loader);
=20
assertNotNull("No PMF name found via services lookup", actual);
assertEquals(expected, actual);
}
=20
- /**
- * Tests JDOHelper.getPMFClassNameViaServiceLookup
- */
- public void testPositive05_PMF0_PMFClassNameViaServi
cesLookup() =
throws IOException {
+ public void testPositive05_PMF0_PMFClassNameViaServi
cesLookup()
+ throws IOException {
=20
URLClassLoader loader =3D new JDOConfigTestClassLoader(
JDOCONFIG_CLASSPATH_PREFIX,
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Positive5", loader);
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Positive05", loader);
=20
- String expected =3D "class.positive5.pmf0";
+ String expected =3D "class.positive05.pmf0";
String actual =3D =
JDOHelper. getPMFClassNameViaServiceLookup(loader);
=20
assertNotNull("No PMF name found via services lookup", actual);
assertEquals(expected, actual);
}
=20
- public void testNegative08_NoResourcesFound() {
- String resource =3D "" + RANDOM.nextLong();
+ public void testPositive06_PMF0_GetAnonymousPMFPrope
rties()
+ throws IOException {
=20
- InputStream in =3D
- getClass().getClassLoader().getResourceAsStream(resource);
- assertNull(in);
+ URLClassLoader loader =3D new JDOConfigTestClassLoader(
+ JDOCONFIG_CLASSPATH_PREFIX,
+ getClass().getClassLoader());
=20
- // resource pretty much guaranteed not to exist
- try {
- JDOHelper.getPersistenceManagerFactory(resource);
- fail("JDOHelper failed to throw JDOFatalUserException");
- }
- catch (JDOFatalUserException x) {
- // happy path
- }
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Positive06", loader);
+
+ Map expected =3D prepareInitialExpectedMap(
+ "positive06.pmf0", 2, 0, true, true);
+
+ Map actual =3D JDOHelper.getNamedPMFProperties(null, loader);
+
+ assertNotNull("No properties found", actual);
+ assertEqualProperties(expected, actual);
}
=20
- public void testNegative00_EmptyJDOConfigXML() throws IOException =
{
+ public void =
testPositive07_PMF0_GetAnonymousPMFPrope
rtiesWithPUName()
+ throws IOException {
+
+ URLClassLoader loader =3D new JDOConfigTestClassLoader(
+ JDOCONFIG_CLASSPATH_PREFIX,
+ getClass().getClassLoader());
+
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Positive07", loader);
+
+ Map expected =3D prepareInitialExpectedMap(
+ "positive07.pmf0", 2, 0, true, false);
+
+ Map actual =3D JDOHelper.getNamedPMFProperties(null, loader);
+
+ assertNotNull("No properties found", actual);
+ assertEqualProperties(expected, actual);
+ }
+
+ public void testNegative00_EmptyJDOConfigXML() throws IOException {
try {
URLClassLoader loader =3D new JDOConfigTestClassLoader(
JDOCONFIG_CLASSPATH_PREFIX,
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Negative0", loader);
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Negative0", loader);
=20
JDOHelper.getPersistenceManagerFactory(loader);
fail("JDOHelper failed to throw JDOFatalUserException");
}
catch (JDOFatalUserException x) {
- // happy path
+ // sunny day
}
}
- =20
- public void testNegative01_NoPersistenceUnitsDefined
() throws =
IOException {
+
+ public void testNegative01_NoPersistenceUnitsDefined
() throws =
IOException {
try {
URLClassLoader loader =3D new JDOConfigTestClassLoader(
JDOCONFIG_CLASSPATH_PREFIX,
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Negative1", loader);
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Negative01", =
loader);
=20
JDOHelper.getPersistenceManagerFactory(loader);
fail("JDOHelper failed to throw JDOFatalUserException");
}
catch (JDOFatalUserException x) {
- // happy path
+ // joy, sweet joy
}
}
=20
public void =
testNegative02_DuplicateAnonymousPersist
enceUnitsInSameConfig()
- throws IOException
- {
+ throws IOException {
try {
URLClassLoader loader =3D new JDOConfigTestClassLoader(
JDOCONFIG_CLASSPATH_PREFIX,
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Negative2", loader);
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Negative02", =
loader);
=20
JDOHelper.getPersistenceManagerFactory(loader);
fail("JDOHelper failed to throw JDOFatalUserException");
}
catch (JDOFatalUserException x) {
- // happy path
+ // the cockles of my heart warmeth
}
}
=20
public void =
testNegative03_DuplicateNamedPersistence
UnitsInSameConfig()
- throws IOException
- {
+ throws IOException {
try {
URLClassLoader loader =3D new JDOConfigTestClassLoader(
JDOCONFIG_CLASSPATH_PREFIX,
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Negative3", loader);
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Negative03", =
loader);
=20
JDOHelper.getPersistenceManagerFactory(
- "persistence-unit-name.negative3",
- loader);
+ "name.negative03",
+ loader);
=20
fail("JDOHelper failed to throw JDOFatalUserException");
}
catch (JDOFatalUserException x) {
- // happy path
+ // warm fuzzies
}
}
=20
public void =
testNegative04_DuplicatePUNamePropertyIn
AttributeAndElement()
- throws IOException
- {
+ throws IOException {
try {
URLClassLoader loader =3D new JDOConfigTestClassLoader(
JDOCONFIG_CLASSPATH_PREFIX,
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Negative4", loader);
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Negative04", =
loader);
=20
JDOHelper.getPersistenceManagerFactory(
- "persistence-unit-name.negative4.value0",
- loader);
+ "name.negative04.value0",
+ loader);
=20
fail("JDOHelper failed to throw JDOFatalUserException");
}
catch (JDOFatalUserException x) {
- // happy path
+ // no cold pricklies
}
}
=20
public void testNegative05_DuplicatePropertyInAttrib
uteAndElement()
- throws IOException
- {
+ throws IOException {
try {
URLClassLoader loader =3D new JDOConfigTestClassLoader(
JDOCONFIG_CLASSPATH_PREFIX,
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Negative5", loader);
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Negative05", =
loader);
=20
JDOHelper.getPersistenceManagerFactory(loader);
=20
fail("JDOHelper failed to throw JDOFatalUserException");
}
catch (JDOFatalUserException x) {
- // happy path
+ // party!
}
}
=20
public void testNegative06_DuplicatePUInDifferentCon
figFiles()
- throws IOException
- {
+ throws IOException {
try {
URLClassLoader loader =3D new JDOConfigTestClassLoader(
JDOCONFIG_CLASSPATH_PREFIX,
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Negative6/6a", loader);
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Negative6/6b", loader);
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Negative06/6a", =
loader);
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Negative06/6b", =
loader);
=20
JDOHelper.getPersistenceManagerFactory(
- "persistence-unit-name.negative6",
+ "name.negative06",
loader);
=20
fail("JDOHelper failed to throw JDOFatalUserException");
}
catch (JDOFatalUserException x) {
- // happy path
+ // clear blue sky
}
}
=20
public void testNegative07_EmptyServicesFile()
- throws IOException
- {
- JDOConfigTestClassLoader testLoader =3D new =
JDOConfigTestClassLoader(new String[] {JDOCONFIG_CLASSPATH_PREFIX}, =
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Negative7", testLoader);
- String shouldBeNull =3D =
JDOHelper. getPMFClassNameViaServiceLookup(testLoad
er);
+ throws IOException {
+ JDOConfigTestClassLoader testLoader =3D new =
JDOConfigTestClassLoader(
+ new String[]{JDOCONFIG_CLASSPATH_PREFIX},
+ getClass().getClassLoader());
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Negative07", =
testLoader);
+ String shouldBeNull =3D
+ JDOHelper. getPMFClassNameViaServiceLookup(testLoad
er);
assertNull(shouldBeNull);
}
=20
+ public void testNegative08_NoResourcesFound() {
+ String resource =3D "" + RANDOM.nextLong();
+
+ InputStream in =3D
+ =
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 testNegative08_ServicesFileWithOnlyComme
nts()
- throws IOException
- {
- JDOConfigTestClassLoader testLoader =3D new =
JDOConfigTestClassLoader(new String[] {JDOCONFIG_CLASSPATH_PREFIX}, =
getClass().getClassLoader());
- ClasspathHelper.addFile(JDOCONFIG_CLASSPATH_PREFIX + =
"/Negative8", testLoader);
- String shouldBeNull =3D =
JDOHelper. getPMFClassNameViaServiceLookup(testLoad
er);
+ throws IOException {
+ JDOConfigTestClassLoader testLoader =3D new =
JDOConfigTestClassLoader(
+ new String[]{JDOCONFIG_CLASSPATH_PREFIX},
+ getClass().getClassLoader());
+ ClasspathHelper.addFile(
+ JDOCONFIG_CLASSPATH_PREFIX + "/Negative08", =
testLoader);
+ String shouldBeNull =3D
+ JDOHelper. getPMFClassNameViaServiceLookup(testLoad
er);
assertNull(shouldBeNull);
}
}
Added: =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative00/META-INF/jdocon=
fig.xml
URL: =
http://svn.apache.org/viewvc/db/jdo...schema/jdoconf=
ig/Negative00/META-INF/jdoconfig.xml?view=3Dauto&rev=3D564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative00/META-INF/jdocon=
fig.xml (added)
+++ =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative00/META-INF/jdocon=
fig.xml Thu Aug 9 14:20:35 2007
@@ -0,0 +1 @@
+
Added: =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative01/META-INF/jdocon=
fig.xml
URL: =
http://svn.apache.org/viewvc/db/jdo...schema/jdoconf=
ig/Negative01/META-INF/jdoconfig.xml?view=3Dauto&rev=3D564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative01/META-INF/jdocon=
fig.xml (added)
+++ =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative01/META-INF/jdocon=
fig.xml Thu Aug 9 14:20:35 2007
@@ -0,0 +1,8 @@
+<?xml version=3D"1.0" encoding=3D"utf-8"?>
+<jdoconfig
+ xmlns=3D"http://java.sun.com/xml/ns/jdo/jdoconfig"
+ xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance">
+
+ <!-- No PMFs defined -->
+</jdoconfig>
+
Added: =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative02/META-INF/jdocon=
fig.xml
URL: =
http://svn.apache.org/viewvc/db/jdo...schema/jdoconf=
ig/Negative02/META-INF/jdoconfig.xml?view=3Dauto&rev=3D564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative02/META-INF/jdocon=
fig.xml (added)
+++ =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative02/META-INF/jdocon=
fig.xml Thu Aug 9 14:20:35 2007
@@ -0,0 +1,11 @@
+<?xml version=3D"1.0" encoding=3D"utf-8"?>
+<jdoconfig
+ xmlns=3D"http://java.sun.com/xml/ns/jdo/jdoconfig"
+ xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance">
+
+ <!-- Duplicate anonymous PMFs present -->
+ <persistence-manager-factory/>
+ <persistence-manager-factory/>
+</jdoconfig>
+
+ =20
\ No newline at end of file
Added: =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative03/META-INF/jdocon=
fig.xml
URL: =
http://svn.apache.org/viewvc/db/jdo...schema/jdoconf=
ig/Negative03/META-INF/jdoconfig.xml?view=3Dauto&rev=3D564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative03/META-INF/jdocon=
fig.xml (added)
+++ =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative03/META-INF/jdocon=
fig.xml Thu Aug 9 14:20:35 2007
@@ -0,0 +1,20 @@
+<?xml version=3D"1.0" encoding=3D"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=3D"http://java.sun.com/xml/ns/jdo/jdoconfig"
+ xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
+ =
xsi:noNamespaceSchemaLocation=3D"http://java.sun.com/xml/ns/jdo/jdoconfig=
">
+
+ <!-- Duplicate named PMF -->
+ <persistence-manager-factory
+ name=3D"name.negative3"/>
+
+ <persistence-manager-factory
+ name=3D"name.negative3"/>
+
+</jdoconfig>
+
+ =20
\ No newline at end of file
Added: =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative04/META-INF/jdocon=
fig.xml
URL: =
http://svn.apache.org/viewvc/db/jdo...schema/jdoconf=
ig/Negative04/META-INF/jdoconfig.xml?view=3Dauto&rev=3D564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative04/META-INF/jdocon=
fig.xml (added)
+++ =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative04/META-INF/jdocon=
fig.xml Thu Aug 9 14:20:35 2007
@@ -0,0 +1,21 @@
+<?xml version=3D"1.0" encoding=3D"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=3D"http://java.sun.com/xml/ns/jdo/jdoconfig"
+ xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
+ =
xsi:noNamespaceSchemaLocation=3D"http://java.sun.com/xml/ns/jdo/jdoconfig=
">
+
+ <!-- Duplicate PMF name property in attribute & element -->
+ <persistence-manager-factory
+ name=3D"persistence-unit-name.negative4.value0">
+ <property
+ name=3D"name"
+ value=3D"name.negative4.value1"/>
+
+ </persistence-manager-factory>
+</jdoconfig>
+
+ =20
\ No newline at end of file
Added: =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative05/META-INF/jdocon=
fig.xml
URL: =
http://svn.apache.org/viewvc/db/jdo...schema/jdoconf=
ig/Negative05/META-INF/jdoconfig.xml?view=3Dauto&rev=3D564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative05/META-INF/jdocon=
fig.xml (added)
+++ =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative05/META-INF/jdocon=
fig.xml Thu Aug 9 14:20:35 2007
@@ -0,0 +1,21 @@
+<?xml version=3D"1.0" encoding=3D"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=3D"http://java.sun.com/xml/ns/jdo/jdoconfig"
+ xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
+ =
xsi:noNamespaceSchemaLocation=3D"http://java.sun.com/xml/ns/jdo/jdoconfig=
">
+
+ <!-- Duplicate property in attribute & element -->
+ <persistence-manager-factory
+ class=3D"class.negative5.value0">
+ <property
+ name=3D"class"
+ value=3D"class.negative5.value1"/>
+
+ </persistence-manager-factory>
+</jdoconfig>
+
+ =20
\ No newline at end of file
Added: =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/6a/META-INF/jdo=
config.xml
URL: =
http://svn.apache.org/viewvc/db/jdo...schema/jdoconf=
ig/Negative06/6a/META-INF/jdoconfig.xml?view=3Dauto&rev=3D564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/6a/META-INF/jdo=
config.xml (added)
+++ =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/6a/META-INF/jdo=
config.xml Thu Aug 9 14:20:35 2007
@@ -0,0 +1,16 @@
+<?xml version=3D"1.0" encoding=3D"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=3D"http://java.sun.com/xml/ns/jdo/jdoconfig"
+ xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
+ =
xsi:noNamespaceSchemaLocation=3D"http://java.sun.com/xml/ns/jdo/jdoconfig=
">
+
+ <!-- Duplicate PMF in this file and another -->
+ <persistence-manager-factory
+ name=3D"name.negative6"/>
+</jdoconfig>
+
+ =20
\ No newline at end of file
Added: =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/6b/META-INF/jdo=
config.xml
URL: =
http://svn.apache.org/viewvc/db/jdo...schema/jdoconf=
ig/Negative06/6b/META-INF/jdoconfig.xml?view=3Dauto&rev=3D564384
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/6b/META-INF/jdo=
config.xml (added)
+++ =
db/jdo/trunk/api2-legacy/test/schema/jdoconfig/Negative06/6b/META-INF/jdo=
config.xml Thu Aug 9 14:20:35 2007
@@ -0,0 +1,16 @@
+<?xml version=3D"1.0" encoding=3D"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=3D"http://java.sun.com/xml/ns/jdo/jdoconfig"
+ xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
+ =
xsi:noNamespaceSchemaLocation=3D"http://java.sun.com/xml/ns/jdo/jdoconfig=
">
+
+ <!-- Duplicate PMF in this file and another -->
+ <persistence-manager-factory
+ name=3D"name.negative6"/>
+</jdoconfig>
+
+ =20
\ No newline at end of file
|