git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17779 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Hardy Ferentschik 2009-10-16 13:22:28 +00:00
parent 6613dce0cb
commit 95285ad109
23 changed files with 20 additions and 14 deletions

View File

@ -16,8 +16,8 @@ public class DuplicateTest extends TestCase {
try {
cfg.addAnnotatedClass( Flight.class );
cfg.addAnnotatedClass( org.hibernate.test.annotations.Flight.class );
cfg.addResource( "org/hibernate/test/annotations/orm.xml");
cfg.addResource( "org/hibernate/test/annotations/duplicatedgenerator/orm.xml");
cfg.addResource( "org/hibernate/test/annotations/orm.xml" );
cfg.addResource( "org/hibernate/test/annotations/duplicatedgenerator/orm.xml" );
cfg.buildSessionFactory();
fail( "Should not be able to map the same entity name twice" );
}

View File

@ -75,7 +75,8 @@ import org.xml.sax.SAXNotSupportedException;
public class JPAOverridenAnnotationReaderTest extends TestCase {
public void testMappedSuperclassAnnotations() throws Exception {
XMLContext context = buildContext(
"org/hibernate/test/annotations/reflection/metadata-complete.xml" );
"org/hibernate/test/annotations/reflection/metadata-complete.xml"
);
JPAOverridenAnnotationReader reader = new JPAOverridenAnnotationReader( Organization.class, context );
assertTrue( reader.isAnnotationPresent( MappedSuperclass.class ) );
}
@ -212,7 +213,8 @@ public class JPAOverridenAnnotationReaderTest extends TestCase {
public void testEntityRelatedAnnotationsMetadataComplete() throws Exception {
XMLContext context = buildContext(
"org/hibernate/test/annotations/reflection/metadata-complete.xml" );
"org/hibernate/test/annotations/reflection/metadata-complete.xml"
);
JPAOverridenAnnotationReader reader = new JPAOverridenAnnotationReader( Administration.class, context );
assertNotNull( reader.getAnnotation( Entity.class ) );
assertEquals(
@ -269,7 +271,8 @@ public class JPAOverridenAnnotationReaderTest extends TestCase {
assertEquals( TemporalType.DATE, reader.getAnnotation( Temporal.class ).value() );
context = buildContext(
"org/hibernate/test/annotations/reflection/metadata-complete.xml" );
"org/hibernate/test/annotations/reflection/metadata-complete.xml"
);
method = Administration.class.getDeclaredMethod( "getId" );
reader = new JPAOverridenAnnotationReader( method, context );
assertNotNull(
@ -295,7 +298,8 @@ public class JPAOverridenAnnotationReaderTest extends TestCase {
public void testBasicRelatedAnnotations() throws Exception {
XMLContext context = buildContext(
"org/hibernate/test/annotations/reflection/metadata-complete.xml" );
"org/hibernate/test/annotations/reflection/metadata-complete.xml"
);
Field field = BusTrip.class.getDeclaredField( "status" );
JPAOverridenAnnotationReader reader = new JPAOverridenAnnotationReader( field, context );
assertNotNull( reader.getAnnotation( Enumerated.class ) );
@ -354,7 +358,8 @@ public class JPAOverridenAnnotationReaderTest extends TestCase {
assertEquals( "test", reader.getAnnotation( OneToOne.class ).mappedBy() );
context = buildContext(
"org/hibernate/test/annotations/reflection/metadata-complete.xml" );
"org/hibernate/test/annotations/reflection/metadata-complete.xml"
);
field = BusTrip.class.getDeclaredField( "players" );
reader = new JPAOverridenAnnotationReader( field, context );
assertNotNull( reader.getAnnotation( OneToMany.class ) );

View File

@ -23,7 +23,8 @@ public class XMLContextTest extends TestCase {
XMLHelper xmlHelper = new XMLHelper();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
InputStream is = cl.getResourceAsStream(
"org/hibernate/test/annotations/reflection/orm.xml" );
"org/hibernate/test/annotations/reflection/orm.xml"
);
assertNotNull( "ORM.xml not found", is );
XMLContext context = new XMLContext();
List errors = new ArrayList();

View File

@ -8,6 +8,7 @@ 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();
@ -21,16 +22,14 @@ public class HbmWithIdentityTest extends TestCase {
s.getTransaction().rollback();
s.close();
}
@Override
protected boolean runForCurrentDialect() {
return super.runForCurrentDialect() && getDialect().supportsIdentityColumns();
}
protected Class[] getMappings() {
return new Class[]{
return new Class[] {
Sky.class,
ZImpl.class
@ -39,9 +38,10 @@ public class HbmWithIdentityTest extends TestCase {
@Override
protected String[] getXmlFiles() {
return new String[]{
return new String[] {
"org/hibernate/test/annotations/xml/hbm/A.hbm.xml",
"org/hibernate/test/annotations/xml/hbm/B.hbm.xml"
"org/hibernate/test/annotations/xml/hbm/B.hbm.xml",
"org/hibernate/test/annotations/xml/hbm/CloudType.hbm.xml"
};
}
}