[hibernate-issues] [Hibernate-JIRA] Closed: (EJB-393) Replace EntityManagerFactory#createEntityManager by getEntityManager() in Test Cases

Juraci Paixao Krohling (JIRA) noreply at atlassian.com
Wed Oct 8 09:10:04 EDT 2008


     [ http://opensource.atlassian.com/projects/hibernate/browse/EJB-393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juraci Paixao Krohling closed EJB-393.
--------------------------------------

    Resolution: Fixed

> Replace EntityManagerFactory#createEntityManager by getEntityManager() in Test Cases
> ------------------------------------------------------------------------------------
>
>                 Key: EJB-393
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-393
>             Project: Hibernate Entity Manager
>          Issue Type: Patch
>          Components: EntityManager
>            Reporter: Juraci Paixao Krohling
>            Assignee: Juraci Paixao Krohling
>         Attachments: ChangedEntityManagerSource.diff
>
>
> The test cases are using EntityManagerFactory#createEntityManager to get an EntityManager instance and are not properly handling the exceptions. Thus, the parent test case org.hibernate.ejb.test.TestCase needs to override the runTest method to catch the exceptions and rollback the non-finished transactions and close the entity manager. Also, the main test case should provide a getter method to the entity manager. 
> Additionally, the existing test cases should not use createEntityManager anymore, which should be replaced by the entity manager getter defined in the super class.
> The following patch implements these changes. 

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

        



More information about the hibernate-issues mailing list