You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Peter Dettman (JIRA)" <ji...@apache.org> on 2010/04/26 17:21:31 UTC

[jira] Created: (JDO-653) Extra checks in PMF.close tests

Extra checks in PMF.close tests
-------------------------------

                 Key: JDO-653
                 URL: https://issues.apache.org/jira/browse/JDO-653
             Project: JDO
          Issue Type: Test
          Components: tck2
    Affects Versions: JDO 2 maintenance release 2
            Reporter: Peter Dettman


Some of the implications of section 11.4 don't appear to be checked for in the case of an already-closed PersistenceManagerFactory.

1. If close() is called on an already-closed PMF (with correct permission i.e. "closePersistenceManagerFactory"), no exception should be thrown.

2. If close() is called on an already-closed PMF (without correct permission), exception should be thrown (even though it would otherwise do nothing).

3. If close() fails (throws JDOUserException) due to active transaction(s), then none of the PersistenceManager objects belonging to the PMF should have actually been closed.

4. Several get/set pairs are not tested for their behaviour after close()


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JDO-653) Extra checks in PMF.close tests

Posted by "Peter Dettman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12882823#action_12882823 ] 

Peter Dettman commented on JDO-653:
-----------------------------------

The reference implementation for JDO3 is DataNucleus 2.1.0, which passes these new test cases.

The revised patch, which adds the test cases to "tck", can therefore now be safely applied, and I have confirmed that indeed all tests run without errors or failures (but in particular pmf.conf, which this patch affects).


> Extra checks in PMF.close tests
> -------------------------------
>
>                 Key: JDO-653
>                 URL: https://issues.apache.org/jira/browse/JDO-653
>             Project: JDO
>          Issue Type: Test
>          Components: tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Peter Dettman
>            Assignee: Michelle Caisse
>         Attachments: JDO-653-2nd.patch, JDO-653-tck.patch, JDO-653.patch
>
>
> Some of the implications of section 11.4 don't appear to be checked for in the case of an already-closed PersistenceManagerFactory.
> 1. If close() is called on an already-closed PMF (with correct permission i.e. "closePersistenceManagerFactory"), no exception should be thrown.
> 2. If close() is called on an already-closed PMF (without correct permission), exception should be thrown (even though it would otherwise do nothing).
> 3. If close() fails (throws JDOUserException) due to active transaction(s), then none of the PersistenceManager objects belonging to the PMF should have actually been closed.
> 4. Several get/set pairs are not tested for their behaviour after close()

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JDO-653) Extra checks in PMF.close tests

Posted by "Peter Dettman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868996#action_12868996 ] 

Peter Dettman commented on JDO-653:
-----------------------------------

Yes, those tests currently fail against the reference implementation (DN 2.0.x).

I am looking firstly for confirmation that these failures represent violations of the spec; see "11.4 Close the PersistenceManagerFactory" (http://people.apache.org/~clr/jdo-2010-04-09.pdf).

Then it is my intention to patch the reference implementation to fix these problems once I have that confirmation.

Obviously there are some interdependencies; I am unsure whether these test cases must remain in limbo until the RI is fixed, or whether there is a mechanism for known-failing tests to be added to the TCK.


> Extra checks in PMF.close tests
> -------------------------------
>
>                 Key: JDO-653
>                 URL: https://issues.apache.org/jira/browse/JDO-653
>             Project: JDO
>          Issue Type: Test
>          Components: tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Peter Dettman
>            Assignee: Michelle Caisse
>         Attachments: JDO-653-2nd.patch, JDO-653.patch
>
>
> Some of the implications of section 11.4 don't appear to be checked for in the case of an already-closed PersistenceManagerFactory.
> 1. If close() is called on an already-closed PMF (with correct permission i.e. "closePersistenceManagerFactory"), no exception should be thrown.
> 2. If close() is called on an already-closed PMF (without correct permission), exception should be thrown (even though it would otherwise do nothing).
> 3. If close() fails (throws JDOUserException) due to active transaction(s), then none of the PersistenceManager objects belonging to the PMF should have actually been closed.
> 4. Several get/set pairs are not tested for their behaviour after close()

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JDO-653) Extra checks in PMF.close tests

Posted by "Craig L Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig L Russell resolved JDO-653.
---------------------------------

    Fix Version/s: JDO 3
       Resolution: Fixed

Patch applied to trunk: svn commit -m "JDO-653 Thanks to Peter Dettman for the patch" src/java
Sending        src/java/org/apache/jdo/tck/api/persistencemanagerfactory/AfterCloseSetMethodsThrowException.java
Sending        src/java/org/apache/jdo/tck/api/persistencemanagerfactory/Close.java
Sending        src/java/org/apache/jdo/tck/api/persistencemanagerfactory/CloseFailsIfTransactionActive.java
Sending        src/java/org/apache/jdo/tck/api/persistencemanagerfactory/CloseWithoutPermissionThrowsSecurityException.java
Transmitting file data ....
Committed revision 959037.

Patch applied to branches/3.0: svn commit -m "JDO-653 Thanks to Peter Dettman for the patch" src/java
Sending        src/java/org/apache/jdo/tck/api/persistencemanagerfactory/AfterCloseSetMethodsThrowException.java
Sending        src/java/org/apache/jdo/tck/api/persistencemanagerfactory/Close.java
Sending        src/java/org/apache/jdo/tck/api/persistencemanagerfactory/CloseFailsIfTransactionActive.java
Sending        src/java/org/apache/jdo/tck/api/persistencemanagerfactory/CloseWithoutPermissionThrowsSecurityException.java
Transmitting file data ....
Committed revision 959039.


> Extra checks in PMF.close tests
> -------------------------------
>
>                 Key: JDO-653
>                 URL: https://issues.apache.org/jira/browse/JDO-653
>             Project: JDO
>          Issue Type: Test
>          Components: tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Peter Dettman
>            Assignee: Michelle Caisse
>             Fix For: JDO 3
>
>         Attachments: JDO-653-2nd.patch, JDO-653-tck.patch, JDO-653.patch
>
>
> Some of the implications of section 11.4 don't appear to be checked for in the case of an already-closed PersistenceManagerFactory.
> 1. If close() is called on an already-closed PMF (with correct permission i.e. "closePersistenceManagerFactory"), no exception should be thrown.
> 2. If close() is called on an already-closed PMF (without correct permission), exception should be thrown (even though it would otherwise do nothing).
> 3. If close() fails (throws JDOUserException) due to active transaction(s), then none of the PersistenceManager objects belonging to the PMF should have actually been closed.
> 4. Several get/set pairs are not tested for their behaviour after close()

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Updated: (JDO-653) Extra checks in PMF.close tests

Posted by Craig L Russell <cr...@oracle.com>.
Hi Peter,

Thanks for the patch. I'll take a look.

Craig

On Apr 26, 2010, at 9:27 AM, Peter Dettman (JIRA) wrote:

>
>     [ https://issues.apache.org/jira/browse/JDO-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel 
>  ]
>
> Peter Dettman updated JDO-653:
> ------------------------------
>
>    Attachment: JDO-653.patch
>
> Attaching a patch to add the missing checks described above.
>
> Note: there was also a "fail" missing in  
> CloseWithoutPermissionThrowsSecurityException for the case where no  
> exception is thrown (but one is expected).
>
>> Extra checks in PMF.close tests
>> -------------------------------
>>
>>                Key: JDO-653
>>                URL: https://issues.apache.org/jira/browse/JDO-653
>>            Project: JDO
>>         Issue Type: Test
>>         Components: tck2
>>   Affects Versions: JDO 2 maintenance release 2
>>           Reporter: Peter Dettman
>>        Attachments: JDO-653.patch
>>
>>
>> Some of the implications of section 11.4 don't appear to be checked  
>> for in the case of an already-closed PersistenceManagerFactory.
>> 1. If close() is called on an already-closed PMF (with correct  
>> permission i.e. "closePersistenceManagerFactory"), no exception  
>> should be thrown.
>> 2. If close() is called on an already-closed PMF (without correct  
>> permission), exception should be thrown (even though it would  
>> otherwise do nothing).
>> 3. If close() fails (throws JDOUserException) due to active  
>> transaction(s), then none of the PersistenceManager objects  
>> belonging to the PMF should have actually been closed.
>> 4. Several get/set pairs are not tested for their behaviour after  
>> close()
>
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>

Craig L Russell
Architect, Oracle
http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@oracle.com
P.S. A good JDO? O, Gasp!


[jira] Updated: (JDO-653) Extra checks in PMF.close tests

Posted by "Peter Dettman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Dettman updated JDO-653:
------------------------------

    Attachment: JDO-653.patch

Attaching a patch to add the missing checks described above.

Note: there was also a "fail" missing in CloseWithoutPermissionThrowsSecurityException for the case where no exception is thrown (but one is expected).

> Extra checks in PMF.close tests
> -------------------------------
>
>                 Key: JDO-653
>                 URL: https://issues.apache.org/jira/browse/JDO-653
>             Project: JDO
>          Issue Type: Test
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Peter Dettman
>         Attachments: JDO-653.patch
>
>
> Some of the implications of section 11.4 don't appear to be checked for in the case of an already-closed PersistenceManagerFactory.
> 1. If close() is called on an already-closed PMF (with correct permission i.e. "closePersistenceManagerFactory"), no exception should be thrown.
> 2. If close() is called on an already-closed PMF (without correct permission), exception should be thrown (even though it would otherwise do nothing).
> 3. If close() fails (throws JDOUserException) due to active transaction(s), then none of the PersistenceManager objects belonging to the PMF should have actually been closed.
> 4. Several get/set pairs are not tested for their behaviour after close()

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-653) Extra checks in PMF.close tests

Posted by "Peter Dettman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Dettman updated JDO-653:
------------------------------

    Attachment: JDO-653-tck.patch

Revised patch that affects "tck" subfolder

> Extra checks in PMF.close tests
> -------------------------------
>
>                 Key: JDO-653
>                 URL: https://issues.apache.org/jira/browse/JDO-653
>             Project: JDO
>          Issue Type: Test
>          Components: tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Peter Dettman
>            Assignee: Michelle Caisse
>         Attachments: JDO-653-2nd.patch, JDO-653-tck.patch, JDO-653.patch
>
>
> Some of the implications of section 11.4 don't appear to be checked for in the case of an already-closed PersistenceManagerFactory.
> 1. If close() is called on an already-closed PMF (with correct permission i.e. "closePersistenceManagerFactory"), no exception should be thrown.
> 2. If close() is called on an already-closed PMF (without correct permission), exception should be thrown (even though it would otherwise do nothing).
> 3. If close() fails (throws JDOUserException) due to active transaction(s), then none of the PersistenceManager objects belonging to the PMF should have actually been closed.
> 4. Several get/set pairs are not tested for their behaviour after close()

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-653) Extra checks in PMF.close tests

Posted by "Peter Dettman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Dettman updated JDO-653:
------------------------------

    Attachment: JDO-653-2nd.patch

Apologies, first patch gives errors running tests. Second patch replaces first.

The tests now run without errors, though there are several failures against the RI.


> Extra checks in PMF.close tests
> -------------------------------
>
>                 Key: JDO-653
>                 URL: https://issues.apache.org/jira/browse/JDO-653
>             Project: JDO
>          Issue Type: Test
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Peter Dettman
>         Attachments: JDO-653-2nd.patch, JDO-653.patch
>
>
> Some of the implications of section 11.4 don't appear to be checked for in the case of an already-closed PersistenceManagerFactory.
> 1. If close() is called on an already-closed PMF (with correct permission i.e. "closePersistenceManagerFactory"), no exception should be thrown.
> 2. If close() is called on an already-closed PMF (without correct permission), exception should be thrown (even though it would otherwise do nothing).
> 3. If close() fails (throws JDOUserException) due to active transaction(s), then none of the PersistenceManager objects belonging to the PMF should have actually been closed.
> 4. Several get/set pairs are not tested for their behaviour after close()

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JDO-653) Extra checks in PMF.close tests

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868969#action_12868969 ] 

Michelle Caisse commented on JDO-653:
-------------------------------------

After applying the second patch, I get three test failures for each identity type:
Description: All pmf tests with standard mapping, no testdata.
Time: 026
There were 3 failures:
1) test(org.apache.jdo.tck.api.persistencemanagerfactory.AfterCloseSetMethodsThrowException)junit.framework.AssertionFailedError: Assertion A11.4-9A (AfterCloseSetMethodsThrowException) failed:
Caught unexpected exception org.datanucleus.exceptions.NucleusUserException: Invalid TimeZone ID specified from setServerTimeZoneID
        at org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:682)
        at org.apache.jdo.tck.api.persistencemanagerfactory.AfterCloseSetMethodsThrowException.test(AfterCloseSetMethodsThrowException.java:148)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:272)
        at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
        at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
        at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)
2) test(org.apache.jdo.tck.api.persistencemanagerfactory.Close)junit.framework.AssertionFailedError: Assertions A11.4-2 (Close), A11.4-10 (isClosed) failed:
Unexpected exception at repeated pmf.close(): javax.jdo.JDOUserException: Can't access or use persistence factory after it has been closed.
        at org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:682)
        at org.apache.jdo.tck.api.persistencemanagerfactory.Close.test(Close.java:98)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:272)
        at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
        at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
        at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)
3) test(org.apache.jdo.tck.api.persistencemanagerfactory.CloseWithoutPermissionThrowsSecurityException)junit.framework.AssertionFailedError: Assertions A11.4-3 (CloseWithoutPermissionThrowsSecurityException) failed:
Unexpected exception at pmf.close(): javax.jdo.JDOUserException: Can't access or use persistence factory after it has been closed.
        at org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:682)
        at org.apache.jdo.tck.api.persistencemanagerfactory.CloseWithoutPermissionThrowsSecurityException.closeWithMySecurityManager(CloseWithoutPermissionThrowsSecurityException.java:89)
        at org.apache.jdo.tck.api.persistencemanagerfactory.CloseWithoutPermissionThrowsSecurityException.test(CloseWithoutPermissionThrowsSecurityException.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:272)
        at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
        at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
        at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)
FAILURES!!!
derby-app-pmf-junit.txt:
    ** Tests run: 067, Time: 026 seconds. Failures: 3, Errors: 0


> Extra checks in PMF.close tests
> -------------------------------
>
>                 Key: JDO-653
>                 URL: https://issues.apache.org/jira/browse/JDO-653
>             Project: JDO
>          Issue Type: Test
>          Components: tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Peter Dettman
>            Assignee: Michelle Caisse
>         Attachments: JDO-653-2nd.patch, JDO-653.patch
>
>
> Some of the implications of section 11.4 don't appear to be checked for in the case of an already-closed PersistenceManagerFactory.
> 1. If close() is called on an already-closed PMF (with correct permission i.e. "closePersistenceManagerFactory"), no exception should be thrown.
> 2. If close() is called on an already-closed PMF (without correct permission), exception should be thrown (even though it would otherwise do nothing).
> 3. If close() fails (throws JDOUserException) due to active transaction(s), then none of the PersistenceManager objects belonging to the PMF should have actually been closed.
> 4. Several get/set pairs are not tested for their behaviour after close()

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (JDO-653) Extra checks in PMF.close tests

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen reassigned JDO-653:
------------------------------------

    Assignee: Michelle Caisse

> Extra checks in PMF.close tests
> -------------------------------
>
>                 Key: JDO-653
>                 URL: https://issues.apache.org/jira/browse/JDO-653
>             Project: JDO
>          Issue Type: Test
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Peter Dettman
>            Assignee: Michelle Caisse
>         Attachments: JDO-653-2nd.patch, JDO-653.patch
>
>
> Some of the implications of section 11.4 don't appear to be checked for in the case of an already-closed PersistenceManagerFactory.
> 1. If close() is called on an already-closed PMF (with correct permission i.e. "closePersistenceManagerFactory"), no exception should be thrown.
> 2. If close() is called on an already-closed PMF (without correct permission), exception should be thrown (even though it would otherwise do nothing).
> 3. If close() fails (throws JDOUserException) due to active transaction(s), then none of the PersistenceManager objects belonging to the PMF should have actually been closed.
> 4. Several get/set pairs are not tested for their behaviour after close()

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.