|
[
Permlink
| « Hide
]
Craig Russell added a comment - 29/Jul/06 08:02 PM
Need to resolve these issues for maintenance release 1.
Craig Russell made changes - 29/Jul/06 08:02 PM
Michael Bouschen made changes - 30/Jul/06 07:59 PM
Attached you find a patch (
I found a similar issue with the following test classes from the same package: SetIgnoreCache, SetMultithreaded, SetNonTransactionalRead, SetNonTransactionalWrite, and SetRetainValues. The patch adds a finally block closing the pmf.
Michael Bouschen made changes - 30/Jul/06 08:06 PM
Attached you find a new patch (
The new patch fixes a problem I overlooked before: the old code creates a new PMF as part of the test method, but the setUp method already created a PMF. This patch fixes this problem. It also makes sure that an existing PMF is closed, that might have been left open from a previous test. The test cases testing PMF setter method cannot use the getPMF method as implemented in the test super class JDO_Test, because this returns a non-configurable PMF.
Michael Bouschen made changes - 06/Aug/06 11:44 AM
Looks great. It's good to clean up these tests. Just a few comments.
1. The pattern: if (pmf.getOptimistic() != true) { - fail(ASSERTION_FAILED, - "Optimistic set to true, value returned by PMF is " + - pmf.getOptimistic()); hides the value that was returned by the pmf, and gets a new value for the error message. I'd prefer something like this: boolean optimistic = pmf.getOptimistic(); if (optimistic != true) { - fail(ASSERTION_FAILED, - "Optimistic set to true, value returned by PMF is " + - optimistic; 2. In src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPersistenceManagerFactoryByPropertiesInstance.java you use the JDO_Test pmf instance but define your own pm and tx instances, which requires you to use your own finally block to close the pm. Couldn't you use the JDO_Test pm instance as well? Then the normal tearDown will close the pm. 3. This is really a nit, but I'd prefer the method getConfigurablePMF to be named getUnconfiguredPMF. From the name, I was expecting perhaps a PMF that was configured with all of the properties but was still configurable. Instead, it's simply an instance of PMF that had not been configured at all. 4. In src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPersistenceManagerForUser.java: username = props.getProperty(CONNECTION_USERNAME_PROP); password = props.getProperty(CONNECTION_PASSWORD_PROP); props.remove(CONNECTION_USERNAME_PROP); props.remove(CONNECTION_PASSWORD_PROP); This could be simplified, since remove returns the present value in the Map: username = props.remove(CONNECTION_USERNAME_PROP); password = props.remove(CONNECTION_PASSWORD_PROP); Craig I changed the patch according to the comments and checked it in (see revision 429480).
Michael Bouschen made changes - 07/Aug/06 09:16 PM
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||