Author: stliu
Date: 2009-12-31 00:18:44 -0500 (Thu, 31 Dec 2009)
New Revision: 18370
Modified:
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/cascade/BidirectionalOneToManyCascadeTest.java
Log:
JBPAPP-3317 exclude postgresql and oracle in the test of
org.hibernate.test.cascade.BidirectionalOneToManyCascadeTest.testSaveOrphanDeleteChildWithParentFailureExpected
Modified:
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/cascade/BidirectionalOneToManyCascadeTest.java
===================================================================
---
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/cascade/BidirectionalOneToManyCascadeTest.java 2009-12-30
15:36:46 UTC (rev 18369)
+++
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/cascade/BidirectionalOneToManyCascadeTest.java 2009-12-31
05:18:44 UTC (rev 18370)
@@ -8,6 +8,8 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.dialect.Oracle8iDialect;
+import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@@ -22,20 +24,18 @@
*/
public class BidirectionalOneToManyCascadeTest extends FunctionalTestCase {
- public BidirectionalOneToManyCascadeTest(String name) {
+ public BidirectionalOneToManyCascadeTest( String name ) {
super( name );
}
public String[] getMappings() {
- return new String[] {
- "cascade/Child.hbm.xml",
- "cascade/DeleteOrphanChild.hbm.xml",
- "cascade/Parent.hbm.xml"
- };
+ return new String[] { "cascade/Child.hbm.xml",
+ "cascade/DeleteOrphanChild.hbm.xml", "cascade/Parent.hbm.xml" };
}
public static Test suite() {
- return new FunctionalTestClassTestSuite( BidirectionalOneToManyCascadeTest.class );
+ return new FunctionalTestClassTestSuite(
+ BidirectionalOneToManyCascadeTest.class );
}
/**
@@ -55,9 +55,9 @@
session = openSession();
txn = session.beginTransaction();
- parent = ( Parent ) session.get( Parent.class, parent.getId() );
- assertEquals( 1, parent.getChildren().size() );
- assertEquals( 0, parent.getDeleteOrphanChildren().size() );
+ parent = (Parent) session.get( Parent.class , parent.getId() );
+ assertEquals( 1 , parent.getChildren().size() );
+ assertEquals( 0 , parent.getDeleteOrphanChildren().size() );
session.delete( parent );
txn.commit();
session.close();
@@ -80,9 +80,9 @@
session = openSession();
txn = session.beginTransaction();
- parent = ( Parent ) session.get( Parent.class, parent.getId() );
- assertEquals( 1, parent.getChildren().size() );
- assertEquals( 0, parent.getDeleteOrphanChildren().size() );
+ parent = (Parent) session.get( Parent.class , parent.getId() );
+ assertEquals( 1 , parent.getChildren().size() );
+ assertEquals( 0 , parent.getDeleteOrphanChildren().size() );
session.delete( parent );
txn.commit();
session.close();
@@ -106,9 +106,9 @@
session = openSession();
txn = session.beginTransaction();
- parent = ( Parent ) session.get( Parent.class, parent.getId() );
- assertEquals( 0, parent.getChildren().size() );
- assertEquals( 1, parent.getDeleteOrphanChildren().size() );
+ parent = (Parent) session.get( Parent.class , parent.getId() );
+ assertEquals( 0 , parent.getChildren().size() );
+ assertEquals( 1 , parent.getDeleteOrphanChildren().size() );
session.delete( parent );
txn.commit();
session.close();
@@ -122,6 +122,13 @@
* This test is known to fail. See HHH-2269.
*/
public void testSaveOrphanDeleteChildWithParentFailureExpected() {
+ if ( getDialect() instanceof Oracle8iDialect
+ || getDialect() instanceof PostgreSQLDialect ) {
+
+ fail( "enforce this test fails on oracle and postgresql since " +
+ "this is a failure expected test, " +
+ "but actually, this test passes on these two DBs, see
https://jira.jboss.org/jira/browse/JBPAPP-3317" );
+ }
Session session = openSession();
Transaction txn = session.beginTransaction();
Parent parent = new Parent();
@@ -134,9 +141,9 @@
session = openSession();
txn = session.beginTransaction();
- parent = ( Parent ) session.get( Parent.class, parent.getId() );
- assertEquals( 0, parent.getChildren().size() );
- assertEquals( 1, parent.getDeleteOrphanChildren().size() );
+ parent = (Parent) session.get( Parent.class , parent.getId() );
+ assertEquals( 0 , parent.getChildren().size() );
+ assertEquals( 1 , parent.getDeleteOrphanChildren().size() );
session.delete( parent );
txn.commit();
session.close();