Alternatively, getPMF() could check to see if pmf is closed or null and
return a new pmf in either case.
-- Michelle
Michael Watzek wrote:
Hi,
there are 5 tests (AfterCloseGetPMThrowsException,
AfterCloseSetMethodsThrowException, Close,
CloseFailsIfTransactionActive,
CloseWithoutPermissionThrowsSecurityException) that call "getPMF()"
and "pmf.close()" in their "testXXX" methods , but they do not nullify
field "pmf". All of those tests fail in "localTearDown":
"localTearDown" calls "getPMF()" which returns field "pmf" if it is
not null. For this reason, "getPMF()" returnes a closed PMF in those
tests.
The proposal for a fix is to add a check before "localTearDown" is
called:
if (pmf!=null && pmf.isClosed())
pmf = null;
Regards,
Michael