From 95285ad109f4240205147e74802deb25b26a6959 Mon Sep 17 00:00:00 2001 From: Hardy Ferentschik Date: Fri, 16 Oct 2009 13:22:28 +0000 Subject: [PATCH] HHH-4498 git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17779 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../duplicatedgenerator/DuplicateTest.java | 4 ++-- .../JPAOverridenAnnotationReaderTest.java | 15 ++++++++++----- .../annotations/reflection/XMLContextTest.java | 3 ++- .../annotations/xml/hbm/HbmWithIdentityTest.java | 12 ++++++------ .../org/hibernate/test/annotations/Boat.hbm.xml | 0 .../org/hibernate/test/annotations/Ferry.hbm.xml | 0 .../test/annotations/bytecode/Hammer.hbm.xml | 0 .../test/annotations/configuration/orm.xml | 0 .../test/annotations/duplicatedgenerator/orm.xml | 0 .../hibernate/test/annotations/hibernate.cfg.xml | 0 .../annotations/inheritance/joined/Asset.hbm.xml | 0 .../test/annotations/loader/Loader.hbm.xml | 0 .../org/hibernate/test/annotations/orm.xml | 0 .../org/hibernate/test/annotations/query/orm.xml | 0 .../annotations/reflection/metadata-complete.xml | 0 .../hibernate/test/annotations/reflection/orm.xml | 0 .../hibernate/test/annotations/xml/ejb3/orm.xml | 0 .../hibernate/test/annotations/xml/ejb3/orm2.xml | 0 .../hibernate/test/annotations/xml/ejb3/orm3.xml | 0 .../hibernate/test/annotations/xml/hbm/A.hbm.xml | 0 .../hibernate/test/annotations/xml/hbm/B.hbm.xml | 0 .../test/annotations/xml/hbm/CloudType.hbm.xml | 0 .../test/annotations/xml/hbm/Government.hbm.xml | 0 23 files changed, 20 insertions(+), 14 deletions(-) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/Boat.hbm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/Ferry.hbm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/bytecode/Hammer.hbm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/configuration/orm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/duplicatedgenerator/orm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/hibernate.cfg.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/inheritance/joined/Asset.hbm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/loader/Loader.hbm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/orm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/query/orm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/reflection/metadata-complete.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/reflection/orm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/xml/ejb3/orm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/xml/ejb3/orm2.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/xml/ejb3/orm3.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/xml/hbm/A.hbm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/xml/hbm/B.hbm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/xml/hbm/CloudType.hbm.xml (100%) rename annotations/src/test/{java => resources}/org/hibernate/test/annotations/xml/hbm/Government.hbm.xml (100%) diff --git a/annotations/src/test/java/org/hibernate/test/annotations/duplicatedgenerator/DuplicateTest.java b/annotations/src/test/java/org/hibernate/test/annotations/duplicatedgenerator/DuplicateTest.java index f06368e864..2a219aeb77 100644 --- a/annotations/src/test/java/org/hibernate/test/annotations/duplicatedgenerator/DuplicateTest.java +++ b/annotations/src/test/java/org/hibernate/test/annotations/duplicatedgenerator/DuplicateTest.java @@ -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" ); } diff --git a/annotations/src/test/java/org/hibernate/test/annotations/reflection/JPAOverridenAnnotationReaderTest.java b/annotations/src/test/java/org/hibernate/test/annotations/reflection/JPAOverridenAnnotationReaderTest.java index b0ca37b084..2d154e2046 100644 --- a/annotations/src/test/java/org/hibernate/test/annotations/reflection/JPAOverridenAnnotationReaderTest.java +++ b/annotations/src/test/java/org/hibernate/test/annotations/reflection/JPAOverridenAnnotationReaderTest.java @@ -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 ) ); diff --git a/annotations/src/test/java/org/hibernate/test/annotations/reflection/XMLContextTest.java b/annotations/src/test/java/org/hibernate/test/annotations/reflection/XMLContextTest.java index 122210ce1e..6b5d0f941a 100644 --- a/annotations/src/test/java/org/hibernate/test/annotations/reflection/XMLContextTest.java +++ b/annotations/src/test/java/org/hibernate/test/annotations/reflection/XMLContextTest.java @@ -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(); diff --git a/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java b/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java index eb10aecde5..f548552027 100644 --- a/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java +++ b/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java @@ -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" }; } } diff --git a/annotations/src/test/java/org/hibernate/test/annotations/Boat.hbm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/Boat.hbm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/Boat.hbm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/Boat.hbm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/Ferry.hbm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/Ferry.hbm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/Ferry.hbm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/Ferry.hbm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/bytecode/Hammer.hbm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/bytecode/Hammer.hbm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/bytecode/Hammer.hbm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/bytecode/Hammer.hbm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/configuration/orm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/configuration/orm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/configuration/orm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/configuration/orm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/duplicatedgenerator/orm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/duplicatedgenerator/orm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/duplicatedgenerator/orm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/duplicatedgenerator/orm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/hibernate.cfg.xml b/annotations/src/test/resources/org/hibernate/test/annotations/hibernate.cfg.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/hibernate.cfg.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/hibernate.cfg.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/inheritance/joined/Asset.hbm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/inheritance/joined/Asset.hbm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/inheritance/joined/Asset.hbm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/inheritance/joined/Asset.hbm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/loader/Loader.hbm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/loader/Loader.hbm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/loader/Loader.hbm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/loader/Loader.hbm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/orm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/orm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/orm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/orm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/query/orm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/query/orm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/query/orm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/query/orm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/reflection/metadata-complete.xml b/annotations/src/test/resources/org/hibernate/test/annotations/reflection/metadata-complete.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/reflection/metadata-complete.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/reflection/metadata-complete.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/reflection/orm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/reflection/orm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/reflection/orm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/reflection/orm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/xml/ejb3/orm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/xml/ejb3/orm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/xml/ejb3/orm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/xml/ejb3/orm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/xml/ejb3/orm2.xml b/annotations/src/test/resources/org/hibernate/test/annotations/xml/ejb3/orm2.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/xml/ejb3/orm2.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/xml/ejb3/orm2.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/xml/ejb3/orm3.xml b/annotations/src/test/resources/org/hibernate/test/annotations/xml/ejb3/orm3.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/xml/ejb3/orm3.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/xml/ejb3/orm3.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/A.hbm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/xml/hbm/A.hbm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/A.hbm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/xml/hbm/A.hbm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/B.hbm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/xml/hbm/B.hbm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/B.hbm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/xml/hbm/B.hbm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/CloudType.hbm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/xml/hbm/CloudType.hbm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/CloudType.hbm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/xml/hbm/CloudType.hbm.xml diff --git a/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/Government.hbm.xml b/annotations/src/test/resources/org/hibernate/test/annotations/xml/hbm/Government.hbm.xml similarity index 100% rename from annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/Government.hbm.xml rename to annotations/src/test/resources/org/hibernate/test/annotations/xml/hbm/Government.hbm.xml