HHH-4397 Split test involving database specific features (like sequence / identity)
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17726 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
f5a280bc5b
commit
766a044dc3
|
@ -34,6 +34,14 @@ public class ManyToOneReferencedColumnNameTest extends TestCase {
|
|||
s.close();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean runForCurrentDialect() {
|
||||
return super.runForCurrentDialect() && getDialect().supportsIdentityColumns();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected Class[] getMappings() {
|
||||
return new Class[] {
|
||||
Item.class,
|
||||
|
|
|
@ -4,7 +4,6 @@ package org.hibernate.test.annotations.xml.hbm;
|
|||
import java.util.HashSet;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
import org.hibernate.test.annotations.TestCase;
|
||||
|
||||
/**
|
||||
|
@ -63,32 +62,10 @@ public class HbmTest extends TestCase {
|
|||
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 @@ public class HbmTest extends TestCase {
|
|||
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"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue