Author: stliu
Date: 2009-10-13 11:57:41 -0400 (Tue, 13 Oct 2009)
New Revision: 17726
Added:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmTest.java
Log:
HHH-4397 Split test involving database specific features (like sequence / identity)
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java
===================================================================
---
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java 2009-10-13
15:49:38 UTC (rev 17725)
+++
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java 2009-10-13
15:57:41 UTC (rev 17726)
@@ -34,6 +34,14 @@
s.close();
}
+
+ @Override
+ protected boolean runForCurrentDialect() {
+ return super.runForCurrentDialect() && getDialect().supportsIdentityColumns();
+ }
+
+
+
protected Class[] getMappings() {
return new Class[] {
Item.class,
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmTest.java
===================================================================
---
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmTest.java 2009-10-13
15:49:38 UTC (rev 17725)
+++
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmTest.java 2009-10-13
15:57:41 UTC (rev 17726)
@@ -4,7 +4,6 @@
import java.util.HashSet;
import org.hibernate.Session;
-import org.hibernate.cfg.Configuration;
import org.hibernate.test.annotations.TestCase;
/**
@@ -63,32 +62,10 @@
s.close();
}
- public void testManyToOneAndInterface() throws Exception {
- Session s = openSession();
- s.getTransaction().begin();
- B b = new BImpl();
- b.setBId( 1 );
- s.persist( b );
- Z z = new ZImpl();
- z.setB( b );
- s.persist( z );
- s.flush();
- s.getTransaction().rollback();
- s.close();
- }
-
- @Override
- protected void configure(Configuration cfg) {
- super.configure( cfg );
- //cfg.addClass( Government.class );
- }
-
protected Class[] getMappings() {
return new Class[]{
PrimeMinister.class,
Sky.class,
- ZImpl.class
-
};
}
@@ -97,8 +74,6 @@
return new String[]{
"org/hibernate/test/annotations/xml/hbm/Government.hbm.xml",
"org/hibernate/test/annotations/xml/hbm/CloudType.hbm.xml",
- "org/hibernate/test/annotations/xml/hbm/A.hbm.xml",
- "org/hibernate/test/annotations/xml/hbm/B.hbm.xml"
};
}
}
Added:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java
===================================================================
---
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java
(rev 0)
+++
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java 2009-10-13
15:57:41 UTC (rev 17726)
@@ -0,0 +1,47 @@
+//$Id:HbmTest.java 9793 2006-04-26 02:20:18 -0400 (mer., 26 avr. 2006) epbernard $
+package org.hibernate.test.annotations.xml.hbm;
+
+import org.hibernate.Session;
+import org.hibernate.test.annotations.TestCase;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class HbmWithIdentityTest extends TestCase {
+ public void testManyToOneAndInterface() throws Exception {
+ Session s = openSession();
+ s.getTransaction().begin();
+ B b = new BImpl();
+ b.setBId( 1 );
+ s.persist( b );
+ Z z = new ZImpl();
+ z.setB( b );
+ s.persist( z );
+ s.flush();
+ s.getTransaction().rollback();
+ s.close();
+ }
+
+ @Override
+ protected boolean runForCurrentDialect() {
+ return super.runForCurrentDialect() && getDialect().supportsIdentityColumns();
+ }
+
+
+
+ protected Class[] getMappings() {
+ return new Class[]{
+ Sky.class,
+ ZImpl.class
+
+ };
+ }
+
+ @Override
+ protected String[] getXmlFiles() {
+ return new String[]{
+ "org/hibernate/test/annotations/xml/hbm/A.hbm.xml",
+ "org/hibernate/test/annotations/xml/hbm/B.hbm.xml"
+ };
+ }
+}
Show replies by date