[ http://issues.apache.org/jira/browse/JDO-273?page=all ]

Michael Watzek updated JDO-273:
-------------------------------

    Attachment: JDO-273.patch

The attached patch implements the lifecycle transition tests for JDO-258 and 
JDO-273.

The patch extends the existing test class 
org.apache.jdo.tck.lifecycle.StateTransitions and adds a new test class 
org.apache.jdo.tck.lifecycle.CheckStatesOfReturnedObjects.

The lifecycle matrix in class StateTransitions has been extended by three 
states (persistent-nontransactional-dirty, detached-clean, and detached-dirty) 
and by five operations (detach-all-on-commit, detachCopy-outside-tx, 
detachCopy-inside-tx, serialize-outside-tx, and serialize-inside-tx). Note, 
that this class checks lifecycle transitions on the parameter instance of the 
operations above.

Class CheckStatesOfReturnedObjects almost implements the same algorithm and 
lifecycle matrix as class StateTransitions. There are mainly two differences:

1) The maxtrix only considers operations makePersistent plus the five new 
operations above.
2) The expected state is checked against the returned instance of an operation.

Currently, both classes still contain some comments in the matrix. These 
comments are not meant to be checked in, but they have to be removed before 
check in. All places where these comments occur, JPOX currently returns an 
unexpected state. Due to the fact that the test fails for the first unexpected 
state, I decided to put the expected state in comments. The comments follow the 
pattern /*Bug: EXPECTED_STATE*/UNEXPECTED_STATE. In particular, I found the 
following bugs:

Class StateTransitions:
-- makeTransactional(detached-clean) -> transient-clean (must be
JDOUserException)
-- makeTransactional(detached-dirty) -> transient-clean (must be
JDOUserException)
-- makeTransient(persistent-nontransactional-dirty) -> transient (must be 
JDOUserException)
-- makeTransient(detached-clean) -> detached-clean (must be
JDOUserException)
-- makeTransient(detached-dirty) -> detached-dirty (must be
JDOUserException)
-- commit, detachAllOnCommit==true (hollow) -> hollow (must be
detached-clean)
-- commit, detachAllOnCommit==true (persistent-new-deleted) ->
JDOObjectNotFoundException (must be transient)
-- commit, detachAllOnCommit==true (persistent-deleted) ->
JDOObjectNotFoundException (must be transient)
-- commit, detachAllOnCommit==true (persistent-nontransational) ->
hollow (must be detached-clean)
-- detachCopy with active tx (transient) -> transient (must be persistent-new)
-- detachCopy with active tx (transient-clean) -> transient-clean (must be 
persistent-new)
-- detachCopy with active tx (transient-dirty) -> transient-dirty (must be 
persistent-new)

Class CheckStatesOfReturnedObjects :
-- makePersistent(detached-clean) -> persistent-dirty (must be persistent-clean)
-- detachCopy with active tx (transient) -> transient (must be detached-clean)
-- detachCopy with active tx (transient-clean) -> transient (must be 
detached-clean)
-- detachCopy with active tx (transient-dirty) -> transient (must be 
detached-dirty)
-- serialize with active tx (persistent-new) -> transient (must be 
detached-clean)


> Create tests for sections 5.5.8 & 5.5.9, detachment lifecycle
> -------------------------------------------------------------
>
>          Key: JDO-273
>          URL: http://issues.apache.org/jira/browse/JDO-273
>      Project: JDO
>         Type: Test
>   Components: tck20
>     Reporter: Matthew T. Adams
>     Assignee: Michael Watzek
>  Attachments: JDO-273.patch
>
> Write tests for assertions in sections "5.5.8 Detached-clean", "5.5.9 
> Detached-dirty".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to