Author: mbo
Date: Sat Nov 18 15:23:24 2017
New Revision: 1815682
URL: http://svn.apache.org/viewvc?rev=1815682&view=rev
Log:
untabify sources
Modified:
db/jdo/trunk/api/test/java/javax/jdo/JDOConfigTestClassLoader.java
db/jdo/trunk/api/test/java/javax/jdo/JDOHelperConfigTest.java
db/jdo/trunk/api/test/java/javax/jdo/JDOHelperTest.java
db/jdo/trunk/api/test/java/javax/jdo/ObjectStateTest.java
db/jdo/trunk/api/test/java/javax/jdo/PMFMapMapTest.java
Modified: db/jdo/trunk/api/test/java/javax/jdo/JDOConfigTestClassLoader.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api/test/java/javax/jdo/JDOConfigTestClassLoader.java?rev=1815682&r1=1815681&r2=1815682&view=diff
==============================================================================
--- db/jdo/trunk/api/test/java/javax/jdo/JDOConfigTestClassLoader.java (original)
+++ db/jdo/trunk/api/test/java/javax/jdo/JDOConfigTestClassLoader.java Sat Nov 18 15:23:24
2017
@@ -31,30 +31,30 @@ public class JDOConfigTestClassLoader ex
* Uses the CTCCL as the parent and adds the given path to this loader's classpath.
*/
public JDOConfigTestClassLoader(String... additionalPath) throws IOException {
- this(Thread.currentThread().getContextClassLoader(), additionalPath);
+ this(Thread.currentThread().getContextClassLoader(), additionalPath);
}
/**
* Uses the given ClassLoader as the parent & adds the given paths to this loader's
classpath.
*/
public JDOConfigTestClassLoader(ClassLoader parent, String... additionalPaths) throws
IOException {
- super(new URL[] {}, parent);
+ super(new URL[] {}, parent);
- for (String path : additionalPaths) {
- addFile(path);
- }
+ for (String path : additionalPaths) {
+ addFile(path);
+ }
}
public void addFile(String s) throws IOException {
- addFile(new File(s));
+ addFile(new File(s));
}
public void addFile(File f) throws IOException {
- addURL(f.toURI().toURL());
+ addURL(f.toURI().toURL());
}
@Override
public void addURL(URL url) {
- super.addURL(url);
+ super.addURL(url);
}
}
Modified: db/jdo/trunk/api/test/java/javax/jdo/JDOHelperConfigTest.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api/test/java/javax/jdo/JDOHelperConfigTest.java?rev=1815682&r1=1815681&r2=1815682&view=diff
==============================================================================
--- db/jdo/trunk/api/test/java/javax/jdo/JDOHelperConfigTest.java (original)
+++ db/jdo/trunk/api/test/java/javax/jdo/JDOHelperConfigTest.java Sat Nov 18 15:23:24 2017
@@ -273,7 +273,7 @@ public class JDOHelperConfigTest extends
public void testPositive03_PMF0_PMFClassNameViaServicesLookup()
throws IOException {
URLClassLoader loader = new JDOConfigTestClassLoader(
- getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive03/");
+ getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive03/");
String expected = "class.positive03.pmf0";
String actual = getPMFClassNameViaServiceLookup(loader);
@@ -286,7 +286,7 @@ public class JDOHelperConfigTest extends
throws IOException {
URLClassLoader loader = new JDOConfigTestClassLoader(
- getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive04/");
+ getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive04/");
String expected = "class.positive04.pmf0";
String actual = getPMFClassNameViaServiceLookup(loader);
@@ -312,7 +312,7 @@ public class JDOHelperConfigTest extends
throws IOException {
URLClassLoader loader = new JDOConfigTestClassLoader(
- getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive06/");
+ getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive06/");
Map expected = prepareInitialExpectedMap("positive06.pmf0", 2, 0, true, true);
Map actual = JDOHelper.getPropertiesFromJdoconfig(
@@ -326,7 +326,7 @@ public class JDOHelperConfigTest extends
throws IOException {
URLClassLoader loader = new JDOConfigTestClassLoader(
- getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive07/");
+ getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive07/");
Map expected = prepareInitialExpectedMap("positive07.pmf0", 2, 0, true, false);
Map actual = JDOHelper.getPropertiesFromJdoconfig(
@@ -339,7 +339,7 @@ public class JDOHelperConfigTest extends
public void testNegative00_EmptyJDOConfigXML() throws IOException {
try {
URLClassLoader loader = new JDOConfigTestClassLoader(
- getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative0/");
+ getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative0/");
JDOHelper.getPersistenceManagerFactory(loader);
fail("JDOHelper failed to throw JDOFatalUserException");
} catch (JDOFatalUserException x) {
@@ -350,7 +350,7 @@ public class JDOHelperConfigTest extends
public void testNegative01_NoPersistenceUnitsDefined() throws IOException {
try {
URLClassLoader loader = new JDOConfigTestClassLoader(
- getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative01/");
+ getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative01/");
JDOHelper.getPersistenceManagerFactory(loader);
fail("JDOHelper failed to throw JDOFatalUserException");
} catch (JDOFatalUserException x) {
@@ -362,7 +362,7 @@ public class JDOHelperConfigTest extends
throws IOException {
try {
URLClassLoader loader = new JDOConfigTestClassLoader(
- getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative02/");
+ getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative02/");
JDOHelper.getPersistenceManagerFactory(loader);
fail("JDOHelper failed to throw JDOFatalUserException");
} catch (JDOFatalUserException x) {
Modified: db/jdo/trunk/api/test/java/javax/jdo/JDOHelperTest.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api/test/java/javax/jdo/JDOHelperTest.java?rev=1815682&r1=1815681&r2=1815682&view=diff
==============================================================================
--- db/jdo/trunk/api/test/java/javax/jdo/JDOHelperTest.java (original)
+++ db/jdo/trunk/api/test/java/javax/jdo/JDOHelperTest.java Sat Nov 18 15:23:24 2017
@@ -55,23 +55,23 @@ public class JDOHelperTest extends Abstr
assertNull("getObjectId(null) returned non-null",
JDOHelper.getObjectId(null));
assertNull("getPersistenceManager(null) returned non-null",
- JDOHelper.getPersistenceManager(null));
+ JDOHelper.getPersistenceManager(null));
assertNull("getTransactionalObjectId(null) returned non-null",
- JDOHelper.getTransactionalObjectId(null));
+ JDOHelper.getTransactionalObjectId(null));
assertNull("getVersion(null) returned non-null",
- JDOHelper.getVersion(null));
+ JDOHelper.getVersion(null));
assertFalse("isDeleted(null) returned non-null",
- JDOHelper.isDeleted(null));
+ JDOHelper.isDeleted(null));
assertFalse("isDetached(null) returned non-null",
- JDOHelper.isDetached(null));
+ JDOHelper.isDetached(null));
assertFalse("isDirty(null) returned non-null",
- JDOHelper.isDirty(null));
+ JDOHelper.isDirty(null));
assertFalse("isNew(null) returned non-null",
- JDOHelper.isNew(null));
+ JDOHelper.isNew(null));
assertFalse("isPersistent(null) returned non-null",
- JDOHelper.isPersistent(null));
+ JDOHelper.isPersistent(null));
assertFalse("isTransactional(null) returned non-null",
- JDOHelper.isTransactional(null));
+ JDOHelper.isTransactional(null));
}
/** The purpose of this test is simply to call some of the
@@ -81,25 +81,25 @@ public class JDOHelperTest extends Abstr
*/
public void testGetInstance() {
assertNull("getObjectId(null) returned non-null",
- JDOHelper.getObjectId(null));
+ JDOHelper.getObjectId(null));
assertNull("getPersistenceManager(null) returned non-null",
- JDOHelper.getPersistenceManager(null));
+ JDOHelper.getPersistenceManager(null));
assertNull("getTransactionalObjectId(null) returned non-null",
- JDOHelper.getTransactionalObjectId(null));
+ JDOHelper.getTransactionalObjectId(null));
assertNull("getVersion(null) returned non-null",
- JDOHelper.getVersion(null));
+ JDOHelper.getVersion(null));
assertFalse("isDeleted(null) returned non-null",
- JDOHelper.isDeleted(null));
+ JDOHelper.isDeleted(null));
assertFalse("isDetached(null) returned non-null",
- JDOHelper.isDetached(null));
+ JDOHelper.isDetached(null));
assertFalse("isDirty(null) returned non-null",
- JDOHelper.isDirty(null));
+ JDOHelper.isDirty(null));
assertFalse("isNew(null) returned non-null",
- JDOHelper.isNew(null));
+ JDOHelper.isNew(null));
assertFalse("isPersistent(null) returned non-null",
- JDOHelper.isPersistent(null));
+ JDOHelper.isPersistent(null));
assertFalse("isTransactional(null) returned non-null",
- JDOHelper.isTransactional(null));
+ JDOHelper.isTransactional(null));
}
/** */
Modified: db/jdo/trunk/api/test/java/javax/jdo/ObjectStateTest.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api/test/java/javax/jdo/ObjectStateTest.java?rev=1815682&r1=1815681&r2=1815682&view=diff
==============================================================================
--- db/jdo/trunk/api/test/java/javax/jdo/ObjectStateTest.java (original)
+++ db/jdo/trunk/api/test/java/javax/jdo/ObjectStateTest.java Sat Nov 18 15:23:24 2017
@@ -218,7 +218,7 @@ public class ObjectStateTest extends Abs
(Class clazz, String methodName, Class[] parameters) {
try {
@SuppressWarnings("unchecked")
- Method result = clazz.getDeclaredMethod(methodName, parameters);
+ Method result = clazz.getDeclaredMethod(methodName, parameters);
return result;
} catch (Exception ex) {
// human-readable class.methodName(parameter[,parameter])
Modified: db/jdo/trunk/api/test/java/javax/jdo/PMFMapMapTest.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api/test/java/javax/jdo/PMFMapMapTest.java?rev=1815682&r1=1815681&r2=1815682&view=diff
==============================================================================
--- db/jdo/trunk/api/test/java/javax/jdo/PMFMapMapTest.java (original)
+++ db/jdo/trunk/api/test/java/javax/jdo/PMFMapMapTest.java Sat Nov 18 15:23:24 2017
@@ -49,7 +49,7 @@ public class PMFMapMapTest extends Abstr
ClassLoader saveContextClassLoader;
public static void main(String args[]) {
- BatchTestRunner.run(PMFMapMapTest.class);
+ BatchTestRunner.run(PMFMapMapTest.class);
}
/**
@@ -58,25 +58,25 @@ public class PMFMapMapTest extends Abstr
* @return {@inheritDoc}
*/
public static TestSuite suite() {
- return new TestSuite(PMFMapMapTest.class);
+ return new TestSuite(PMFMapMapTest.class);
}
void setupResourceClassLoader(String dir) throws IOException {
- switch (dir.charAt(dir.length() - 1)) {
- case '\\':
- dir = dir.substring(0, dir.length() - 1) + '/';
- break;
- case '/':
- break;
- default:
- if (new File(dir).isDirectory()) {
- dir += '/';
- }
- }
+ switch (dir.charAt(dir.length() - 1)) {
+ case '\\':
+ dir = dir.substring(0, dir.length() - 1) + '/';
+ break;
+ case '/':
+ break;
+ default:
+ if (new File(dir).isDirectory()) {
+ dir += '/';
+ }
+ }
- resourceClassLoader = new JDOConfigTestClassLoader(getClass()
- .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + dir);
+ resourceClassLoader = new JDOConfigTestClassLoader(getClass()
+ .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + dir);
}
/*
@@ -88,21 +88,21 @@ public class PMFMapMapTest extends Abstr
*/
public void testJDOConfigXML() throws IOException {
- setupResourceClassLoader(resourceDir);
- Thread.currentThread().setContextClassLoader(resourceClassLoader);
+ 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 + "\"");
+ }
}
/*
@@ -113,20 +113,20 @@ public class PMFMapMapTest extends Abstr
*/
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 + "\"");
- }
+ 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 + "\"");
+ }
}
/*
@@ -136,21 +136,21 @@ public class PMFMapMapTest extends Abstr
*/
public void testPropsFile() throws IOException {
- setupResourceClassLoader(propsDir);
- Thread.currentThread().setContextClassLoader(resourceClassLoader);
+ 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 + "\"");
- }
+ 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 + "\"");
+ }
}
/*
@@ -161,21 +161,21 @@ public class PMFMapMapTest extends Abstr
*/
public void testPropsFileAndLoader() throws IOException {
- setupResourceClassLoader(propsDir);
+ 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 + "\"");
- }
+ 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 + "\"");
+ }
}
/*
@@ -184,35 +184,35 @@ public class PMFMapMapTest extends Abstr
* 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 + "\"");
- }
+ 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 + "\"");
+ }
}
/*
@@ -222,35 +222,35 @@ public class PMFMapMapTest extends Abstr
* 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 + "\"");
- }
+ 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 + "\"");
+ }
}
/*
@@ -260,25 +260,25 @@ public class PMFMapMapTest extends Abstr
* 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 + "\"");
- }
+ 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 + "\"");
+ }
}
/*
@@ -287,25 +287,25 @@ public class PMFMapMapTest extends Abstr
* 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 + "\"");
- }
+ 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 + "\"");
+ }
}
/*
@@ -314,26 +314,26 @@ public class PMFMapMapTest extends Abstr
* 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
- + "\"");
- }
+ 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
+ + "\"");
+ }
}
/*
@@ -343,26 +343,26 @@ public class PMFMapMapTest extends Abstr
* 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
- + "\"");
- }
+ 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
+ + "\"");
+ }
}
/*
@@ -376,27 +376,27 @@ public class PMFMapMapTest extends Abstr
* 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
- + "\"");
- }
+ 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
+ + "\"");
+ }
}
/*
@@ -406,21 +406,21 @@ public class PMFMapMapTest extends Abstr
*/
public void testNamedPMF() throws IOException {
- setupResourceClassLoader(resourceDir);
- Thread.currentThread().setContextClassLoader(resourceClassLoader);
+ 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 + "\"");
- }
+ 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 + "\"");
+ }
}
/*
@@ -430,21 +430,21 @@ public class PMFMapMapTest extends Abstr
*/
public void testNamedPMFWithLoader() throws IOException {
- setupResourceClassLoader(resourceDir);
+ 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 + "\"");
- }
+ 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 + "\"");
+ }
}
/*
@@ -455,21 +455,21 @@ public class PMFMapMapTest extends Abstr
*/
public void testNamedPMFWithTwoLoaders() throws IOException {
- setupResourceClassLoader(resourceDir);
+ 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(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 + "\"");
+ }
}
}
|