Hibernate SVN: r17716 - in annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations: id and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-10-13 09:23:37 -0400 (Tue, 13 Oct 2009)
New Revision: 17716
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/TestCase.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/id/IdTest.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/lob/LobTest.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/xml/hbm/HbmTest.java
Log:
JBPAPP-2910 HHH-4415 : TestCase could check for superclass of Dialect before skipping it
Modified: annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/TestCase.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/TestCase.java 2009-10-13 12:25:56 UTC (rev 17715)
+++ annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/TestCase.java 2009-10-13 13:23:37 UTC (rev 17716)
@@ -2,24 +2,60 @@
package org.hibernate.test.annotations;
import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;
+import org.hibernate.Interceptor;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
-import org.hibernate.Interceptor;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.Dialect;
+import org.hibernate.tool.hbm2ddl.SchemaExport;
+/**
+ * A base class for all tests.
+ *
+ * @author Emmnauel Bernand
+ * @author Hardy Ferentschik
+ */
public abstract class TestCase extends junit.framework.TestCase {
+ public static final Log log = LogFactory.getLog( TestCase.class );
+
private static SessionFactory sessions;
private static AnnotationConfiguration cfg;
- private static Dialect dialect;
- private static Class lastTestClass;
+ private static Class<?> lastTestClass;
private Session session;
+ /**
+ * The test method.
+ */
+ private Method runMethod = null;
+
+ /**
+ * Flag indicating whether the test should be run or skipped.
+ */
+ private boolean runTest = true;
+
+ /**
+ * List of required dialect for the current {@code runMethod}. If the list is empty any dialect is allowed.
+ * Otherwise the current dialect or a superclass of the current dialect must be in the list.
+ */
+ private final Set<Class<? extends Dialect>> requiredDialectList = new HashSet<Class<? extends Dialect>>();
+
public TestCase() {
super();
}
@@ -28,73 +64,171 @@
super( x );
}
- protected void buildSessionFactory(Class[] classes, String[] packages, String[] xmlFiles) throws Exception {
+ protected void buildSessionFactory(Class<?>[] classes, String[] packages, String[] xmlFiles) throws Exception {
- if ( getSessions() != null ) getSessions().close();
+ if ( getSessions() != null ) {
+ getSessions().close();
+ }
try {
setCfg( new AnnotationConfiguration() );
configure( cfg );
if ( recreateSchema() ) {
cfg.setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
}
- for ( int i = 0; i < packages.length ; i++ ) {
- getCfg().addPackage( packages[i] );
+ for ( String aPackage : packages ) {
+ getCfg().addPackage( aPackage );
}
- for ( int i = 0; i < classes.length ; i++ ) {
- getCfg().addAnnotatedClass( classes[i] );
+ for ( Class<?> aClass : classes ) {
+ getCfg().addAnnotatedClass( aClass );
}
- for ( int i = 0; i < xmlFiles.length ; i++ ) {
- InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream( xmlFiles[i] );
+ for ( String xmlFile : xmlFiles ) {
+ InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream( xmlFile );
getCfg().addInputStream( is );
}
- setDialect( Dialect.getDialect() );
- setSessions( getCfg().buildSessionFactory( /*new TestInterceptor()*/ ) );
+ setSessions( getCfg().buildSessionFactory( /* new TestInterceptor() */ ) );
}
- catch (Exception e) {
+ catch ( Exception e ) {
e.printStackTrace();
throw e;
}
}
protected void setUp() throws Exception {
- if ( getSessions() == null || lastTestClass != getClass() ) {
- buildSessionFactory( getMappings(), getAnnotatedPackages(), getXmlFiles() );
- lastTestClass = getClass();
+ runMethod = findTestMethod();
+ System.out.println(Dialect.getDialect());
+ setRunTestFlag( runMethod );
+ if ( runTest ) {
+ if ( getSessions() == null || lastTestClass != getClass() ) {
+ buildSessionFactory( getMappings(), getAnnotatedPackages(), getXmlFiles() );
+ lastTestClass = getClass();
+ }
+ else {
+ runSchemaGeneration();
+ }
}
}
protected void runTest() throws Throwable {
try {
- super.runTest();
- if ( session != null && session.isOpen() ) {
- if ( session.isConnected() ) session.connection().rollback();
- session.close();
- session = null;
- fail( "unclosed session" );
+ if ( runTest ) {
+ runTestMethod( runMethod );
+ handleUnclosedSession();
}
- else {
- session = null;
- }
}
- catch (Throwable e) {
- try {
- if ( session != null && session.isOpen() ) {
- if ( session.isConnected() ) session.connection().rollback();
- session.close();
+ catch ( Throwable e ) {
+ closeSession( e );
+ }
+ }
+
+ private void setRunTestFlag(Method runMethod) {
+ updateRequiredDialectList( runMethod );
+
+ if ( runForCurrentDialect() ) {
+ runTest = true;
+ }
+ else {
+ log.warn(
+ "Skipping test { "+runMethod.getName()+" }, because test does not apply for dialect { "+Dialect.getDialect().getClass()+" }");
+
+ runTest = false;
+ }
+ }
+
+ private void updateRequiredDialectList(Method runMethod) {
+ requiredDialectList.clear();
+
+ RequiresDialect requiresDialectMethodAnn = runMethod.getAnnotation( RequiresDialect.class );
+ if ( requiresDialectMethodAnn != null ) {
+ Class<? extends Dialect>[] requiredDialects = requiresDialectMethodAnn.value();
+ requiredDialectList.addAll( Arrays.asList( requiredDialects ) );
+ }
+
+ RequiresDialect requiresDialectClassAnn = getClass().getAnnotation( RequiresDialect.class );
+ if ( requiresDialectClassAnn != null ) {
+ Class<? extends Dialect>[] requiredDialects = requiresDialectClassAnn.value();
+ requiredDialectList.addAll( Arrays.asList( requiredDialects ) );
+ }
+ }
+
+ protected boolean runForCurrentDialect() {
+ if ( requiredDialectList.isEmpty() ) {
+ return true;
+ }
+ else {
+ // check whether the current dialect is assignableFrom from any of the specified required dialects.
+ for ( Class<? extends Dialect> dialect : requiredDialectList ) {
+ if ( dialect.isAssignableFrom( Dialect.getDialect().getClass() ) ) {
+ return true;
}
}
- catch (Exception ignore) {
+ return false;
+ }
+ }
+
+ private void runTestMethod(Method runMethod) throws Throwable {
+ try {
+ runMethod.invoke( this, new Class[0] );
+ }
+ catch ( InvocationTargetException e ) {
+ e.fillInStackTrace();
+ throw e.getTargetException();
+ }
+ catch ( IllegalAccessException e ) {
+ e.fillInStackTrace();
+ throw e;
+ }
+ }
+
+ private Method findTestMethod() {
+ String fName = getName();
+ assertNotNull( fName );
+ Method runMethod = null;
+ try {
+ runMethod = getClass().getMethod( fName, null );
+ }
+ catch ( NoSuchMethodException e ) {
+ fail( "Method \"" + fName + "\" not found" );
+ }
+ if ( !Modifier.isPublic( runMethod.getModifiers() ) ) {
+ fail( "Method \"" + fName + "\" should be public" );
+ }
+ return runMethod;
+ }
+
+ private void handleUnclosedSession() throws Exception {
+ if ( session != null && session.isOpen() ) {
+ if ( session.isConnected() ) {
+ session.connection().rollback();
}
- try {
- if ( sessions != null ) {
- sessions.close();
- sessions = null;
+ session.close();
+ session = null;
+ fail( "unclosed session" );
+ }
+ else {
+ session = null;
+ }
+ }
+
+ private void closeSession(Throwable e) throws Throwable {
+ try {
+ if ( session != null && session.isOpen() ) {
+ if ( session.isConnected() ) {
+ session.connection().rollback();
}
+ session.close();
}
- catch (Exception ignore) {
+ }
+ catch ( Exception ignore ) {
+ }
+ try {
+ if ( sessions != null ) {
+ sessions.close();
+ sessions = null;
}
- throw e;
}
+ catch ( Exception ignore ) {
+ }
+ throw e;
}
public Session openSession() throws HibernateException {
@@ -103,18 +237,18 @@
}
public Session openSession(Interceptor interceptor) throws HibernateException {
- session = getSessions().openSession(interceptor);
+ session = getSessions().openSession( interceptor );
return session;
}
- protected abstract Class[] getMappings();
+ protected abstract Class<?>[] getMappings();
protected String[] getAnnotatedPackages() {
- return new String[]{};
+ return new String[] { };
}
protected String[] getXmlFiles() {
- return new String[]{};
+ return new String[] { };
}
private void setSessions(SessionFactory sessions) {
@@ -125,12 +259,9 @@
return sessions;
}
- private void setDialect(Dialect dialect) {
- TestCase.dialect = dialect;
- }
protected Dialect getDialect() {
- return dialect;
+ return Dialect.getDialect();
}
protected static void setCfg(AnnotationConfiguration cfg) {
@@ -142,13 +273,15 @@
}
protected void configure(Configuration cfg) {
- //cfg.setNamingStrategy( AlternativeNamingStrategy.INSTANCE );
- //cfg.getSessionEventListenerConfig().setFlushEventListener( new EJB3FlushEventListener() );
- //cfg.getSessionEventListenerConfig().setAutoFlushEventListener( new EJB3AutoFlushEventListener() );
}
protected boolean recreateSchema() {
return true;
}
+ protected void runSchemaGeneration() {
+ SchemaExport export = new SchemaExport( cfg );
+ export.create( true, true );
+ }
+
}
Modified: annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/id/IdTest.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/id/IdTest.java 2009-10-13 12:25:56 UTC (rev 17715)
+++ annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/id/IdTest.java 2009-10-13 13:23:37 UTC (rev 17716)
@@ -293,6 +293,11 @@
"org.hibernate.test.annotations.id"
};
}
+ //fix for https://jira.jboss.org/jira/browse/JBPAPP-1061
+ @Override
+ protected boolean runForCurrentDialect() {
+ return super.runForCurrentDialect() && getDialect().supportsSequences();
+ }
@Override
protected String[] getXmlFiles() {
Modified: annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/lob/LobTest.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/lob/LobTest.java 2009-10-13 12:25:56 UTC (rev 17715)
+++ annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/lob/LobTest.java 2009-10-13 13:23:37 UTC (rev 17716)
@@ -113,6 +113,11 @@
s.close();
}
+ @Override
+ protected boolean runForCurrentDialect() {
+ return super.runForCurrentDialect() && getDialect().supportsExpectedLobUsagePattern();
+ }
+
public LobTest(String x) {
super( x );
}
Modified: annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java 2009-10-13 12:25:56 UTC (rev 17715)
+++ annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java 2009-10-13 13:23:37 UTC (rev 17716)
@@ -34,6 +34,16 @@
s.close();
}
+
+
+ //fix for https://jira.jboss.org/jira/browse/JBPAPP-1125
+ @Override
+ protected boolean runForCurrentDialect() {
+ return super.runForCurrentDialect() && getDialect().supportsIdentityColumns();
+ }
+
+
+
protected Class[] getMappings() {
return new Class[] {
Item.class,
Modified: annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/xml/hbm/HbmTest.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/xml/hbm/HbmTest.java 2009-10-13 12:25:56 UTC (rev 17715)
+++ annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/xml/hbm/HbmTest.java 2009-10-13 13:23:37 UTC (rev 17716)
@@ -63,19 +63,6 @@
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) {
@@ -87,7 +74,6 @@
return new Class[]{
PrimeMinister.class,
Sky.class,
- ZImpl.class
};
}
@@ -97,8 +83,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"
};
}
}
14 years, 8 months
You've received a postcard
by 123greetings.com
Good day.
Your family member has sent you an ecard from 123greetings.com.
Send free ecards from 123greetings.com with your choice of colors, words and music.
Your ecard will be available with us for the next 30 days.
If you wish to keep the ecard longer, you may save it on your computer or take a print.
To view your ecard, open zip attached file.
14 years, 8 months
Hibernate SVN: r17715 - in branches/Branch_3_2/HibernateExt/tools/src: test/org/hibernate/tool/hbm2x/hbm2hbmxml and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-10-13 08:25:56 -0400 (Tue, 13 Oct 2009)
New Revision: 17715
Modified:
branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/array.hbm.ftl
branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/list.hbm.ftl
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4250
Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/array.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/array.hbm.ftl 2009-10-13 11:52:34 UTC (rev 17714)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/array.hbm.ftl 2009-10-13 12:25:56 UTC (rev 17715)
@@ -14,14 +14,10 @@
<#assign metaattributable=property>
<#include "meta.hbm.ftl">
<#include "key.hbm.ftl">
- <#if c2h.isManyToOne(indexValue)>
- <list-index class="${indexValue.getReferencedEntityName()}">
+ <list-index>
<#foreach column in indexValue.columnIterator>
<#include "column.hbm.ftl">
</#foreach>
</list-index>
- <#else>
- <index <#foreach column in indexValue.columnIterator>column="${column.quotedName}"</#foreach>/>
- </#if>
<#include "${elementTag}-element.hbm.ftl">
</array>
Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/list.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/list.hbm.ftl 2009-10-13 11:52:34 UTC (rev 17714)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/list.hbm.ftl 2009-10-13 12:25:56 UTC (rev 17715)
@@ -13,17 +13,11 @@
<#assign metaattributable=property>
<#include "meta.hbm.ftl">
<#include "key.hbm.ftl">
- <#if c2h.isManyToOne(indexValue)>
- <list-index class="${indexValue.getReferencedEntityName()}">
+ <list-index>
<#foreach column in indexValue.columnIterator>
<#include "column.hbm.ftl">
</#foreach>
</list-index>
- <#else>
- <index <#foreach column in indexValue.columnIterator>
- column="${column.quotedName}"
- </#foreach>/>
- </#if>
<#include "${elementTag}-element.hbm.ftl">
</list>
Modified: branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest.java 2009-10-13 11:52:34 UTC (rev 17714)
+++ branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest.java 2009-10-13 12:25:56 UTC (rev 17715)
@@ -84,30 +84,33 @@
List list = xpath.selectNodes(document);
assertEquals("Expected to get two list element", 2, list.size());
Element node = (Element) list.get(1); //second list
- assertEquals(node.attribute( "name" ).getText(),"fooComponents");
- assertEquals(node.attribute( "lazy" ).getText(),"true");
- assertEquals(node.attribute( "cascade" ).getText(),"all");
+ assertEquals("fooComponents", node.attribute( "name" ).getText());
+ assertEquals("true", node.attribute( "lazy" ).getText());
+ assertEquals("all", node.attribute( "cascade" ).getText());
- list = node.elements("index");
- assertEquals("Expected to get one index element", 1, list.size());
+ list = node.elements("list-index");
+ assertEquals("Expected to get one list-index element", 1, list.size());
+ list = ((Element) list.get(0)).elements("column");
+ assertEquals("Expected to get one column element", 1, list.size());
+
node = (Element) list.get(0);
- assertEquals(node.attribute( "column" ).getText(),"tha_indecks");
+ assertEquals("tha_indecks", node.attribute( "name" ).getText());
- node = node.getParent();//list
+ node = node.getParent().getParent();//list
list = node.elements("composite-element");
assertEquals("Expected to get one composite-element element", 1, list.size());
node = (Element) list.get(0);
assertEquals("Expected to get two property element", 2, node.elements("property").size());
node = node.element("many-to-one");
- assertEquals(node.attribute( "name" ).getText(),"fee");
- assertEquals(node.attribute( "cascade" ).getText(),"all");
+ assertEquals("fee", node.attribute( "name" ).getText());
+ assertEquals("all", node.attribute( "cascade" ).getText());
//TODO :assertEquals(node.attribute( "outer-join" ).getText(),"true");
node = node.getParent();//composite-element
node = node.element("nested-composite-element");
- assertEquals(node.attribute( "name" ).getText(),"subcomponent");
- assertEquals(node.attribute( "class" ).getText(),"org.hibernate.tool.hbm2x.hbm2hbmxml.FooComponent");
+ assertEquals("subcomponent", node.attribute( "name" ).getText());
+ assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.FooComponent", node.attribute( "class" ).getText());
}
public void testArrayNode() throws DocumentException {
@@ -122,15 +125,18 @@
List list = xpath.selectNodes(document);
assertEquals("Expected to get one array element", 1, list.size());
Element node = (Element) list.get(0);
- assertEquals(node.attribute( "name" ).getText(),"proxyArray");
- assertEquals(node.attribute( "element-class" ).getText(),"org.hibernate.tool.hbm2x.hbm2hbmxml.GlarchProxy");
-
- list = node.elements("index");
- assertEquals("Expected to get one index element", 1, list.size());
+ assertEquals("proxyArray", node.attribute( "name" ).getText());
+ assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.GlarchProxy", node.attribute( "element-class" ).getText());
+
+ list = node.elements("list-index");
+ assertEquals("Expected to get one list-index element", 1, list.size());
+ list = ((Element) list.get(0)).elements("column");
+ assertEquals("Expected to get one column element", 1, list.size());
+
node = (Element) list.get(0);
- assertEquals(node.attribute( "column" ).getText(),"array_indecks");
+ assertEquals("array_indecks", node.attribute( "name" ).getText());
- node = node.getParent();//array
+ node = node.getParent().getParent();//array
list = node.elements("one-to-many");
assertEquals("Expected to get one 'one-to-many' element", 1, list.size());
14 years, 8 months
Hibernate SVN: r17714 - core/branches/gradle.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-10-13 07:52:34 -0400 (Tue, 13 Oct 2009)
New Revision: 17714
Modified:
core/branches/gradle/
Log:
added .gradle to ingore list
Property changes on: core/branches/gradle
___________________________________________________________________
Name: svn:ignore
- target
local
*.ipr
*.iws
*.iml
atlassian-ide-plugin.xml
.classpath
.project
.settings
.nbattrs
*.log
*.properties
.clover
+ target
local
*.ipr
*.iws
*.iml
atlassian-ide-plugin.xml
.classpath
.project
.settings
.nbattrs
*.log
*.properties
.clover
.gradle
14 years, 8 months
Hibernate SVN: r17713 - in core/trunk/annotations/src/test/java/org/hibernate/test/annotations: lob and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-10-13 05:20:40 -0400 (Tue, 13 Oct 2009)
New Revision: 17713
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/TestCase.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/lob/LobTest.java
Log:
HHH-4415 removed the ambigous dialect instance variable in TestCase. Instead use the static method Dialect.getDialect
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/TestCase.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/TestCase.java 2009-10-13 02:50:50 UTC (rev 17712)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/TestCase.java 2009-10-13 09:20:40 UTC (rev 17713)
@@ -37,7 +37,6 @@
private static SessionFactory sessions;
private static AnnotationConfiguration cfg;
- private static Dialect dialect;
private static Class<?> lastTestClass;
private Session session;
@@ -86,7 +85,6 @@
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream( xmlFile );
getCfg().addInputStream( is );
}
- setDialect( Dialect.getDialect() );
setSessions( getCfg().buildSessionFactory( /* new TestInterceptor() */ ) );
}
catch ( Exception e ) {
@@ -261,12 +259,8 @@
return sessions;
}
- private void setDialect(Dialect dialect) {
- TestCase.dialect = dialect;
- }
-
protected Dialect getDialect() {
- return dialect;
+ return Dialect.getDialect();
}
protected static void setCfg(AnnotationConfiguration cfg) {
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/lob/LobTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/lob/LobTest.java 2009-10-13 02:50:50 UTC (rev 17712)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/lob/LobTest.java 2009-10-13 09:20:40 UTC (rev 17713)
@@ -3,6 +3,7 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.dialect.Dialect;
import org.hibernate.test.annotations.TestCase;
/**
14 years, 8 months
You've received a postcard
by 123greetings.com
Good day.
Your family member has sent you an ecard from 123greetings.com.
Send free ecards from 123greetings.com with your choice of colors, words and music.
Your ecard will be available with us for the next 30 days.
If you wish to keep the ecard longer, you may save it on your computer or take a print.
To view your ecard, open zip attached file.
14 years, 8 months
Hibernate SVN: r17712 - in core/branches/gradle: hibernate-annotations and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-10-12 22:50:50 -0400 (Mon, 12 Oct 2009)
New Revision: 17712
Modified:
core/branches/gradle/build.gradle
core/branches/gradle/hibernate-annotations/build.gradle
core/branches/gradle/hibernate-core/build.gradle
core/branches/gradle/hibernate-entitymanager/build.gradle
core/branches/gradle/hibernate-envers/build.gradle
Log:
initial working build
Modified: core/branches/gradle/build.gradle
===================================================================
--- core/branches/gradle/build.gradle 2009-10-12 22:43:49 UTC (rev 17711)
+++ core/branches/gradle/build.gradle 2009-10-13 02:50:50 UTC (rev 17712)
@@ -9,15 +9,24 @@
}
dependencies {
+ slf4jVersion = '1.5.8'
+ dom4jVersion = '1.6.1'
+ antlrVersion = '2.7.6'
+ annotationsCommonsVersion = '3.2.0.Beta1'
+ jpaVersion = '2.0.Beta-20090815'
+ jtaVersion = '1.1'
+ javassistVersion = '3.9.0.GA'
+ cglibVersion = '2.2'
+
compile(
- 'org.slf4j:slf4j-api:1.5.8'
+ group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
)
testCompile(
- 'junit:junit:3.8.2',
- 'org.slf4j:jcl-over-slf4j:1.5.8',
- 'org.slf4j:slf4j-log4j12:1.5.8',
- 'commons-logging:commons-logging:99.0-does-not-exist',
- 'commons-logging:commons-logging-api:99.0-does-not-exist'
+ [group: 'junit', name: 'junit', version: '3.8.2'],
+ [group: 'org.slf4j', name: 'jcl-over-slf4j', version: slf4jVersion],
+ [group: 'org.slf4j', name: 'slf4j-log4j12', version: slf4jVersion],
+ [group: 'commons-logging', name: 'commons-logging', version: '99.0-does-not-exist'],
+ [group: 'commons-logging', name: 'commons-logging-api', version: '99.0-does-not-exist']
)
}
@@ -36,6 +45,7 @@
// by default, compile to 1.4 compatibility
sourceTarget = "1.4"
+ sourceCompatibility = "1.4"
}
dependsOnChildren()
\ No newline at end of file
Modified: core/branches/gradle/hibernate-annotations/build.gradle
===================================================================
--- core/branches/gradle/hibernate-annotations/build.gradle 2009-10-12 22:43:49 UTC (rev 17711)
+++ core/branches/gradle/hibernate-annotations/build.gradle 2009-10-13 02:50:50 UTC (rev 17712)
@@ -1,16 +1,18 @@
dependencies {
compile (
project(':hibernate-core'),
- 'org.hibernate:hibernate-commons-annotations:3.2.0.Beta1',
- 'org.hibernate.java-persistence:jpa-api:2.0.Beta-20090815'
+ [group: 'dom4j', name: 'dom4j', version: dom4jVersion],
+ [group: 'org.hibernate', name: 'hibernate-commons-annotations', version: annotationsCommonsVersion],
+ [group: 'org.hibernate.java-persistence', name: 'jpa-api', version: jpaVersion],
+ // need to be 'optional'/'provided'
+ [group: 'javax.validation', name: 'validation-api', version: '1.0.CR4']
)
- runtime (
- 'javax.validation:validation-api:1.0.CR4'
- )
testCompile (
- 'javassist:javassist:3.9.0.GA',
- 'cglib:cglib:2.2',
- 'org.hibernate:hibernate-validator:4.0.0.Beta3'
+ [group: 'javassist', name: 'javassist', version: javassistVersion],
+ [group: 'cglib', name: 'cglib', version: cglibVersion, transitive: true],
+ [group: 'org.hibernate', name: 'hibernate-validator', version: '4.0.0.Beta3']
)
}
-
\ No newline at end of file
+
+sourceTarget = "1.5"
+sourceCompatibility = "1.5"
\ No newline at end of file
Modified: core/branches/gradle/hibernate-core/build.gradle
===================================================================
--- core/branches/gradle/hibernate-core/build.gradle 2009-10-12 22:43:49 UTC (rev 17711)
+++ core/branches/gradle/hibernate-core/build.gradle 2009-10-13 02:50:50 UTC (rev 17712)
@@ -1,28 +1,25 @@
configurations {
- compile {
- transitive = true
- }
antAntlr
}
dependencies {
+ antVersion = '1.6.5'
+
compile (
- // need to be transitive...
- 'antlr:antlr:2.7.6',
- 'commons-collections:commons-collections:3.1',
- 'dom4j:dom4j:1.6.1',
+ [group: 'antlr', name: 'antlr', version: antlrVersion],
+ [group: 'commons-collections', name: 'commons-collections', version: '3.1'],
+ [group: 'dom4j', name: 'dom4j', version: dom4jVersion],
// need to be 'optional'/'provided'
- 'javassist:javassist:3.9.0.GA',
- 'cglib:cglib:2.2',
- // need to be 'optional'/'provided'
- 'ant:ant:1.6.5',
- 'javax.transaction:jta:1.1',
- 'javax.security:jaas:1.0.01',
- 'javax.security:jacc:1.0'
+ [group: 'javassist', name: 'javassist', version: javassistVersion],
+ [group: 'cglib', name: 'cglib', version: cglibVersion, transitive: true],
+ [group: 'ant', name: 'ant', version: antVersion],
+ [group: 'javax.transaction', name: 'jta', version: jtaVersion],
+ [group: 'javax.security', name: 'jaas', version: '1.0.01'],
+ [group: 'javax.security', name: 'jacc', version: '1.0']
)
antAntlr (
- 'ant:ant-antlr:1.6.5',
- 'antlr:antlr:2.7.6'
+ [group: 'ant', name: 'ant-antlr', version: antVersion],
+ [group: 'antlr', name: 'antlr', version: antlrVersion]
)
}
Modified: core/branches/gradle/hibernate-entitymanager/build.gradle
===================================================================
--- core/branches/gradle/hibernate-entitymanager/build.gradle 2009-10-12 22:43:49 UTC (rev 17711)
+++ core/branches/gradle/hibernate-entitymanager/build.gradle 2009-10-13 02:50:50 UTC (rev 17712)
@@ -2,12 +2,16 @@
compile(
project(':hibernate-core'),
project(':hibernate-annotations'),
- 'org.hibernate:hibernate-commons-annotations:3.2.0.Beta1',
- 'org.hibernate.java-persistence:jpa-api:2.0.Beta-20090815'
+ [group: 'dom4j', name: 'dom4j', version: dom4jVersion],
+ [group: 'org.hibernate', name: 'hibernate-commons-annotations', version: annotationsCommonsVersion],
+ [group: 'org.hibernate.java-persistence', name: 'jpa-api', version: jpaVersion],
+ [group: 'javax.transaction', name: 'jta', version: jtaVersion],
+ [group: 'javassist', name: 'javassist', version: javassistVersion]
)
testCompile(
- 'javassist:javassist:3.9.0.GA',
- 'cglib:cglib:2.2'
+ [group: 'cglib', name: 'cglib', version: cglibVersion]
)
}
-
\ No newline at end of file
+
+sourceTarget = "1.5"
+sourceCompatibility = "1.5"
\ No newline at end of file
Modified: core/branches/gradle/hibernate-envers/build.gradle
===================================================================
--- core/branches/gradle/hibernate-envers/build.gradle 2009-10-12 22:43:49 UTC (rev 17711)
+++ core/branches/gradle/hibernate-envers/build.gradle 2009-10-13 02:50:50 UTC (rev 17712)
@@ -14,4 +14,7 @@
'javassist:javassist:3.9.0.GA',
'cglib:cglib:2.2'
)
-}
\ No newline at end of file
+}
+
+sourceTarget = "1.5"
+sourceCompatibility = "1.5"
\ No newline at end of file
14 years, 8 months