Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Issues List »

[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5012) Improvement
for test EntityTest.java

Anupam M (JIRA)

2010-03-15


Author LoginPost Reply
Improvement for test EntityTest.java
------------------------------------

          Key: HHH-5012
          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5012
        Project: Hibernate Core
      Issue Type: Improvement
      Components: annotations
  Affects Versions: 3.5.0-CR-2
       Reporter: Stephan Palm
       Priority: Minor


The following tests could behave nicer on failures:

testUniqueConstraint
testColumnUnique

The database which I am writing a dialect for has no unique constraint.
When I execute those tests I get a RollbackException which is not the intended behavior.

The test tries to give a nice failure message,
{code}
tx.commit();
fail( "unique constraints not respected" );
{code}

but the later
{code}
finally {
 if ( tx != null ) tx.rollback();
 s.close();
}
{code}

creates an Exception which masks the Failure. This could be avoided by adding a tx = null;

{code}
tx.commit();
tx = null;
fail( "unique constraints not respected" );
{code}


--
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

   
_______________________________________________
hibernate-issues mailing list
hibernate-issues@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-issues
©2008 gg3721.com - Jax Systems, LLC, U.S.A.