Hibernate SVN: r19829 - core/trunk/documentation/manual/src/main/docbook/en-US/content.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-06-28 05:47:17 -0400 (Mon, 28 Jun 2010)
New Revision: 19829
Modified:
core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml
core/trunk/documentation/manual/src/main/docbook/en-US/content/configuration.xml
Log:
HHH-5340 Typo in tutorial at web site
Modified: core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml 2010-06-25 16:07:19 UTC (rev 19828)
+++ core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml 2010-06-28 09:47:17 UTC (rev 19829)
@@ -928,11 +928,11 @@
name="propertyName"
class="ClassName"
mapped="true|false"
- access="field|property|ClassName">
- node="element-name|."
+ access="field|property|ClassName"
+ node="element-name|.">
<key-property name="propertyName" type="typename" column="column_name"/>
- <key-many-to-one name="propertyName class="ClassName" column="column_name"/>
+ <key-many-to-one name="propertyName" class="ClassName" column="column_name"/>
......
</composite-id></programlisting>
Modified: core/trunk/documentation/manual/src/main/docbook/en-US/content/configuration.xml
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/en-US/content/configuration.xml 2010-06-25 16:07:19 UTC (rev 19828)
+++ core/trunk/documentation/manual/src/main/docbook/en-US/content/configuration.xml 2010-06-28 09:47:17 UTC (rev 19829)
@@ -518,7 +518,7 @@
<entry>Set this property to <literal>true</literal> if your JDBC
driver returns correct row counts from
- <literal>executeBatch()</literal>. Iit is usually safe to turn
+ <literal>executeBatch()</literal>. It is usually safe to turn
this option on. Hibernate will then use batched DML for
automatically versioned data. Defaults to
<literal>false</literal>. <para> <emphasis
@@ -1598,7 +1598,7 @@
one will be started and associated with that JTA transaction the first
time you call <literal>sessionFactory.getCurrentSession()</literal>. The
<literal>Session</literal>s retrieved via
- <literal>getCurrentSession()</literal> in the<literal>"jta"</literal>
+ <literal>getCurrentSession()</literal> in the <literal>"jta"</literal>
context are set to automatically flush before the transaction completes,
close after the transaction completes, and aggressively release JDBC
connections after each statement. This allows the
15 years, 10 months
Hibernate SVN: r19828 - in core/branches/gradle2: hibernate-jbosscache and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-25 12:07:19 -0400 (Fri, 25 Jun 2010)
New Revision: 19828
Modified:
core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle
core/branches/gradle2/hibernate-jbosscache/hibernate-jbosscache.gradle
Log:
intermediate working copy of infinispan and jbosscache modules (so other modules can build)
Modified: core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle
===================================================================
--- core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle 2010-06-25 16:05:20 UTC (rev 19827)
+++ core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle 2010-06-25 16:07:19 UTC (rev 19828)
@@ -1,41 +1,16 @@
-// todo : need to account for skipUnitTests from pom.xml
-// todo : need to account for groups.bind_addr from pom.xml
-// todo : need to account for surefire system-properties from pom.xml
-
dependencies {
infinispanVersion = '4.0.0.FINAL'
- jbossCommonCoreVersion = '2.2.14.GA'
jnpVersion = '5.0.3.GA'
- xapoolVersion = '1.5.0'
- jbosstsVersion = '4.9.0.GA'
- rhqVersion = '1.4.0.B01'
- jgroupsVersion = '2.9.0.GA'
- compile(
- project(':hibernate-core')
- )
- compile(
- [group: 'org.infinispan', name: 'infinispan-core', version: infinispanVersion]
- ) {
+ compile( project( ':hibernate-core' ) )
+ compile( [group: 'org.infinispan', name: 'infinispan-core', version: infinispanVersion] ) {
artifact {
name = "infinispan-core"
type = 'jar'
}
}
- testCompile(
- project(':hibernate-testing'),
- [group: 'org.jboss', name: 'jboss-common-core', version: jbossCommonCoreVersion],
- [group: 'org.jboss.naming', name: 'jnp-client', version: jnpVersion],
- [group: 'com.experlog', name: 'xapool', version: xapoolVersion],
- [group: 'jboss.jbossts', name: 'jbossjta', version: jbosstsVersion],
- [group: 'org.jboss.naming', name: 'jnpserver', version: jnpVersion],
- [group: 'org.rhq.helpers', name: 'rhq-pluginAnnotations', version: rhqVersion],
- "javax.transaction:jta:1.1"
- )
-// ewww... http://jira.codehaus.org/browse/GRADLE-739
- testCompile(
- [group: 'org.infinispan', name: 'infinispan-core', version: infinispanVersion]
- ) {
+ // http://jira.codehaus.org/browse/GRADLE-739
+ testCompile( [group: 'org.infinispan', name: 'infinispan-core', version: infinispanVersion] ) {
artifact {
name = "infinispan-core"
type = 'jar'
@@ -46,27 +21,37 @@
type = 'jar'
}
}
- testRuntime(
- [group: 'javassist', name: 'javassist', version: javassistVersion],
- [group: 'cglib', name: 'cglib', version: cglibVersion]
- )
+// testCompile( project(':hibernate-core').sourceSets.testing.classes )
+ testCompile( [group: 'org.jboss', name: 'jboss-common-core', version: '2.2.14.GA'] )
+ testCompile( [group: 'org.jboss.naming', name: 'jnp-client', version: jnpVersion] )
+ testCompile( [group: 'org.jboss.naming', name: 'jnpserver', version: jnpVersion] )
+ testCompile( [group: 'com.experlog', name: 'xapool', version: '1.5.0'] )
+ testCompile( [group: 'jboss.jbossts', name: 'jbossjta', version: '4.9.0.GA'] )
+ testCompile( libraries.jta )
+ testCompile( [group: 'org.rhq.helpers', name: 'rhq-pluginAnnotations', version: '1.4.0.B01'] )
+ testRuntime( libraries.javassist )
}
sourceCompatibility = "1.6"
targetCompatibility = "1.6"
compileJava {
- options.fork(executable: "$jdk16_home/bin/javac")
+ options.fork( executable: java6Home.getJavacExecutable() )
}
compileTestJava {
- options.fork(executable: "$jdk16_home/bin/javac")
+ options.fork( executable: java6Home.getJavacExecutable() )
}
test {
- jvm: "$jdk16_home/bin/java"
+ executable = java6Home.getJavaExecutable()
}
ideaModule {
javaVersion = "1.6"
-}
\ No newline at end of file
+}
+
+// todo : need to account for skipUnitTests from pom.xml
+// todo : need to account for groups.bind_addr from pom.xml
+// todo : need to account for surefire system-properties from pom.xml
+
Modified: core/branches/gradle2/hibernate-jbosscache/hibernate-jbosscache.gradle
===================================================================
--- core/branches/gradle2/hibernate-jbosscache/hibernate-jbosscache.gradle 2010-06-25 16:05:20 UTC (rev 19827)
+++ core/branches/gradle2/hibernate-jbosscache/hibernate-jbosscache.gradle 2010-06-25 16:07:19 UTC (rev 19828)
@@ -1,22 +1,12 @@
+dependencies {
+ compile ( project( ':hibernate-core' ) )
+ compile( [group: 'org.jboss.cache', name: 'jbosscache-core', version: '3.2.1.GA'] )
+// testCompile( project(':hibernate-core').sourceSets.testing.classes )
+ testCompile( libraries.jta )
+ testCompile( [group: 'jgroups', name: 'jgroups', version: '2.6.13.GA'] )
+ testRuntime( libraries.javassist )
+}
+
// todo : need to account for skipUnitTests from pom.xml
// todo : need to account for groups.bind_addr from pom.xml
// todo : need to account for surefire system-properties from pom.xml
-
-dependencies {
- jbcVersion = '3.2.1.GA'
- jgroupsVersion = '2.6.13.GA'
-
- compile (
- project(':hibernate-core'),
- [group: 'org.jboss.cache', name: 'jbosscache-core', version: jbcVersion]
- )
- testCompile(
- project(':hibernate-testing'),
- [group: 'jgroups', name: 'jgroups', version: jgroupsVersion],
- "javax.transaction:jta:1.1"
- )
- testRuntime (
- [group: 'javassist', name: 'javassist', version: javassistVersion],
- [group: 'cglib', name: 'cglib', version: cglibVersion]
- )
-}
15 years, 10 months
Hibernate SVN: r19827 - core/branches/gradle2/hibernate-release.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-25 12:05:20 -0400 (Fri, 25 Jun 2010)
New Revision: 19827
Modified:
core/branches/gradle2/hibernate-release/hibernate-release.gradle
Log:
use 1.0.0 release of jdocbook plugin
Modified: core/branches/gradle2/hibernate-release/hibernate-release.gradle
===================================================================
--- core/branches/gradle2/hibernate-release/hibernate-release.gradle 2010-06-25 16:01:50 UTC (rev 19826)
+++ core/branches/gradle2/hibernate-release/hibernate-release.gradle 2010-06-25 16:05:20 UTC (rev 19827)
@@ -4,7 +4,7 @@
// mavenRepo name: "mavenCache", urls: "file://" + System.getProperty('user.home') + "/.m2/repository/"
// }
dependencies {
- classpath "org.jboss.jdocbook:gradle-jdocbook:1.0.0-SNAPSHOT"
+ classpath "org.jboss.jdocbook:gradle-jdocbook:1.0.0"
// classpath "org.hibernate:hibernate-jdocbook-style:2.0.1"
// classpath gradleApi()
}
15 years, 10 months
Hibernate SVN: r19826 - core/branches/gradle2/hibernate-core/src/intgTest/java/org/hibernate/test/version/sybase.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-25 12:01:50 -0400 (Fri, 25 Jun 2010)
New Revision: 19826
Added:
core/branches/gradle2/hibernate-core/src/intgTest/java/org/hibernate/test/version/sybase/Group.java
Log:
re added file that somehow ended up missing
Added: core/branches/gradle2/hibernate-core/src/intgTest/java/org/hibernate/test/version/sybase/Group.java
===================================================================
--- core/branches/gradle2/hibernate-core/src/intgTest/java/org/hibernate/test/version/sybase/Group.java (rev 0)
+++ core/branches/gradle2/hibernate-core/src/intgTest/java/org/hibernate/test/version/sybase/Group.java 2010-06-25 16:01:50 UTC (rev 19826)
@@ -0,0 +1,56 @@
+// $Id: Group.java 7805 2005-08-10 16:25:11Z steveebersole $
+package org.hibernate.test.version.sybase;
+
+import java.util.Date;
+import java.util.Set;
+
+/**
+ * Implementation of Group.
+ *
+ * @author Steve Ebersole
+ */
+public class Group {
+ private Long id;
+ private Date timestamp;
+ private String name;
+ private Set users;
+
+ public Group() {
+ }
+
+ public Group(String name) {
+ this.name = name;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Date getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(Date timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Set getUsers() {
+ return users;
+ }
+
+ public void setUsers(Set users) {
+ this.users = users;
+ }
+}
\ No newline at end of file
15 years, 10 months
Hibernate SVN: r19825 - validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-06-24 17:29:29 -0400 (Thu, 24 Jun 2010)
New Revision: 19825
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/BeanMetaDataImpl.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintDescriptorImpl.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintHelper.java
Log:
HV-342
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/BeanMetaDataImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/BeanMetaDataImpl.java 2010-06-24 18:51:21 UTC (rev 19824)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/BeanMetaDataImpl.java 2010-06-24 21:29:29 UTC (rev 19825)
@@ -445,10 +445,10 @@
|| constraintHelper.isBuiltinConstraint( annotationType ) ) {
constraints.add( annotation );
}
+ else if ( constraintHelper.isMultiValueConstraint( annotationType ) ) {
+ constraints.addAll( constraintHelper.getMultiValueConstraints( annotation ) );
+ }
- // check if we have a multi-valued constraint
- constraints.addAll( constraintHelper.getMultiValueConstraints( annotation ) );
-
for ( Annotation constraint : constraints ) {
final ConstraintDescriptorImpl constraintDescriptor = buildConstraintDescriptor( clazz, constraint, type );
constraintDescriptors.add( constraintDescriptor );
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintDescriptorImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintDescriptorImpl.java 2010-06-24 18:51:21 UTC (rev 19824)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintDescriptorImpl.java 2010-06-24 21:29:29 UTC (rev 19825)
@@ -387,7 +387,7 @@
log.debug( "Adding composing constraint: " + descriptor );
}
}
- else if ( constraintHelper.isMultiValueConstraint( declaredAnnotation ) ) {
+ else if ( constraintHelper.isMultiValueConstraint( declaredAnnotationType ) ) {
List<Annotation> multiValueConstraints = constraintHelper.getMultiValueConstraints( declaredAnnotation );
int index = 0;
for ( Annotation constraintAnnotation : multiValueConstraints ) {
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintHelper.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintHelper.java 2010-06-24 18:51:21 UTC (rev 19824)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintHelper.java 2010-06-24 21:29:29 UTC (rev 19825)
@@ -184,38 +184,27 @@
/**
* Checks whether a given annotation is a multi value constraint or not.
*
- * @param annotation the annotation to check.
+ * @param annotationType the annotation type to check.
*
* @return {@code true} if the specified annotation is a multi value constraints, {@code false}
* otherwise.
*/
- public boolean isMultiValueConstraint(Annotation annotation) {
+ public boolean isMultiValueConstraint(Class<? extends Annotation> annotationType) {
boolean isMultiValueConstraint = false;
- try {
- final Method method = ReflectionHelper.getMethod( annotation.getClass(), "value" );
+ final Method method = ReflectionHelper.getMethod( annotationType, "value" );
if ( method != null ) {
Class returnType = method.getReturnType();
if ( returnType.isArray() && returnType.getComponentType().isAnnotation() ) {
- Annotation[] annotations = ( Annotation[] ) method.invoke( annotation );
- for ( Annotation a : annotations ) {
- Class<? extends Annotation> annotationType = a.annotationType();
- if ( isConstraintAnnotation( annotationType ) || isBuiltinConstraint( annotationType ) ) {
- isMultiValueConstraint = true;
- }
- else {
- isMultiValueConstraint = false;
- break;
- }
+ @SuppressWarnings( "unchecked" )
+ Class<? extends Annotation> componentType = ( Class<? extends Annotation> ) returnType.getComponentType();
+ if ( isConstraintAnnotation( componentType ) || isBuiltinConstraint( componentType ) ) {
+ isMultiValueConstraint = true;
}
+ else {
+ isMultiValueConstraint = false;
+ }
}
}
- }
- catch ( IllegalAccessException iae ) {
- // ignore
- }
- catch ( InvocationTargetException ite ) {
- // ignore
- }
return isMultiValueConstraint;
}
15 years, 10 months
Hibernate SVN: r19824 - in core/branches/gradle2: hibernate-core and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-24 14:51:21 -0400 (Thu, 24 Jun 2010)
New Revision: 19824
Modified:
core/branches/gradle2/hibernate-annotations/hibernate-annotations.gradle
core/branches/gradle2/hibernate-core/hibernate-core.gradle
core/branches/gradle2/hibernate-ehcache/hibernate-ehcache.gradle
core/branches/gradle2/hibernate-entitymanager/hibernate-entitymanager.gradle
Log:
split processing of matrix databases and creating of matrix testing objects into separate plugins
Modified: core/branches/gradle2/hibernate-annotations/hibernate-annotations.gradle
===================================================================
--- core/branches/gradle2/hibernate-annotations/hibernate-annotations.gradle 2010-06-24 18:45:49 UTC (rev 19823)
+++ core/branches/gradle2/hibernate-annotations/hibernate-annotations.gradle 2010-06-24 18:51:21 UTC (rev 19824)
@@ -1,13 +1,17 @@
apply plugin: 'java'
apply plugin: org.hibernate.gradle.testing.matrix.MatrixTestingPlugin
+// not needed if we rename the directories to match the sourceSet name
sourceSets {
-// intgTest {
-// resources{
-// // resources inherently exclude sources
-// srcDir 'src/intgTest/java'
-// }
-// }
+ matrix {
+ java {
+ setSrcDirs( ['src/intgTest/java'] )
+ }
+ // resources inherently exclude sources
+ resources {
+ setSrcDirs( ['src/intgTest/java','src/intgTest/resources'] )
+ }
+ }
}
dependencies {
Modified: core/branches/gradle2/hibernate-core/hibernate-core.gradle
===================================================================
--- core/branches/gradle2/hibernate-core/hibernate-core.gradle 2010-06-24 18:45:49 UTC (rev 19823)
+++ core/branches/gradle2/hibernate-core/hibernate-core.gradle 2010-06-24 18:51:21 UTC (rev 19824)
@@ -2,6 +2,7 @@
apply plugin: 'antlr'
apply plugin: org.hibernate.gradle.testing.matrix.MatrixTestingPlugin
+// not needed if we rename the directories to match the sourceSet name
sourceSets {
matrix {
java {
Modified: core/branches/gradle2/hibernate-ehcache/hibernate-ehcache.gradle
===================================================================
--- core/branches/gradle2/hibernate-ehcache/hibernate-ehcache.gradle 2010-06-24 18:45:49 UTC (rev 19823)
+++ core/branches/gradle2/hibernate-ehcache/hibernate-ehcache.gradle 2010-06-24 18:51:21 UTC (rev 19824)
@@ -3,6 +3,19 @@
// todo : does this single test really need to be run against ever database in the matrix?
+// not needed if we rename the directories to match the sourceSet name
+sourceSets {
+ matrix {
+ java {
+ setSrcDirs( ['src/intgTest/java'] )
+ }
+ // resources inherently exclude sources
+ resources {
+ setSrcDirs( ['src/intgTest/resources'] )
+ }
+ }
+}
+
dependencies {
compile( project( ':hibernate-core' ) )
compile( [group: 'net.sf.ehcache', name: 'ehcache', version: '1.5.0'] )
Modified: core/branches/gradle2/hibernate-entitymanager/hibernate-entitymanager.gradle
===================================================================
--- core/branches/gradle2/hibernate-entitymanager/hibernate-entitymanager.gradle 2010-06-24 18:45:49 UTC (rev 19823)
+++ core/branches/gradle2/hibernate-entitymanager/hibernate-entitymanager.gradle 2010-06-24 18:51:21 UTC (rev 19824)
@@ -4,12 +4,20 @@
// todo : there are test failures due to issues with how 'bundles' are handled.
// My guess is using TCCL as the tests try to is not valid in Gradle.
-//buildscript {
-// dependencies {
-// classpath libraries.jpa_modelgen
-// }
-//}
+// not needed if we rename the directories to match the sourceSet name
+sourceSets {
+ matrix {
+ java {
+ setSrcDirs( ['src/intgTest/java'] )
+ }
+ // resources inherently exclude sources
+ resources {
+ setSrcDirs( ['src/intgTest/java','src/intgTest/resources'] )
+ }
+ }
+}
+
dependencies {
shrinkwrapVersion = '1.0.0-alpha-6'
@@ -39,9 +47,7 @@
}
}
compileMatrixJava.dependsOn procTargetDir
-//sourceSets.intgTest.java.srcDir procTargetDirName
-
bundlesTargetDirName = "$buildDirName/bundles"
bundlesTargetDir = dir( bundlesTargetDirName )
task processBundleResources {
15 years, 10 months
Hibernate SVN: r19823 - in core/branches/gradle2: hibernate-annotations and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-24 14:45:49 -0400 (Thu, 24 Jun 2010)
New Revision: 19823
Modified:
core/branches/gradle2/build.gradle
core/branches/gradle2/hibernate-annotations/hibernate-annotations.gradle
core/branches/gradle2/hibernate-core/hibernate-core.gradle
core/branches/gradle2/hibernate-ehcache/hibernate-ehcache.gradle
core/branches/gradle2/hibernate-entitymanager/hibernate-entitymanager.gradle
Log:
split processing of matrix databases and creating of matrix testing objects into separate plugins
Modified: core/branches/gradle2/build.gradle
===================================================================
--- core/branches/gradle2/build.gradle 2010-06-24 18:44:42 UTC (rev 19822)
+++ core/branches/gradle2/build.gradle 2010-06-24 18:45:49 UTC (rev 19823)
@@ -193,17 +193,40 @@
}
}
+//configurations {
+// junit
+// testng
+// baseTestRuntime
+// junitTestRuntime {
+// extendsFrom baseTestRuntime, junit
+// }
+// testngTestRuntime {
+// extendsFrom baseTestRuntime, testng
+// }
+//}
+//
+//dependencies {
+// junit( libraries.junit )
+// testng( libraries.testng )
+// baseTestRuntime( libraries.slf4j_log4j ) {
+// transitive = true
+// }
+// baseTestRuntime( libraries.jcl_slf4j )
+// baseTestRuntime( libraries.jcl_api )
+// baseTestRuntime( libraries.jcl )
+//}
+
gradle.afterProject { project ->
// if the sub-project contains integration tests, inject dependencies into those configurations too
- if ( project.plugins.findPlugin( org.hibernate.gradle.util.IntegrationTestPlugin.class ) ) {
+ if ( project.plugins.findPlugin( org.hibernate.gradle.testing.matrix.MatrixTestingPlugin ) ) {
project.dependencies {
- intgTestCompile( libraries.junit )
- intgTestRuntime( libraries.slf4j_log4j ) {
+ matrixCompile( libraries.junit )
+ matrixRuntime( libraries.slf4j_log4j ) {
transitive = true
}
- intgTestRuntime( libraries.jcl_slf4j )
- intgTestRuntime( libraries.jcl_api )
- intgTestRuntime( libraries.jcl )
+ matrixRuntime( libraries.jcl_slf4j )
+ matrixRuntime( libraries.jcl_api )
+ matrixRuntime( libraries.jcl )
}
}
}
Modified: core/branches/gradle2/hibernate-annotations/hibernate-annotations.gradle
===================================================================
--- core/branches/gradle2/hibernate-annotations/hibernate-annotations.gradle 2010-06-24 18:44:42 UTC (rev 19822)
+++ core/branches/gradle2/hibernate-annotations/hibernate-annotations.gradle 2010-06-24 18:45:49 UTC (rev 19823)
@@ -1,5 +1,5 @@
apply plugin: 'java'
-apply plugin: org.hibernate.gradle.util.IntegrationTestPlugin
+apply plugin: org.hibernate.gradle.testing.matrix.MatrixTestingPlugin
sourceSets {
// intgTest {
@@ -24,10 +24,10 @@
transitive = true
}
testRuntime( libraries.javassist )
- intgTestCompile( project(':hibernate-core').sourceSets.intgTest.classes )
+ matrixCompile( project(':hibernate-core').sourceSets.matrix.classes )
}
ideaModule {
- testSourceDirs.addAll( sourceSets.intgTest.java.srcDirs )
- testSourceDirs.addAll( sourceSets.intgTest.resources.srcDirs )
+ testSourceDirs.addAll( sourceSets.matrix.java.srcDirs )
+ testSourceDirs.addAll( sourceSets.matrix.resources.srcDirs )
}
\ No newline at end of file
Modified: core/branches/gradle2/hibernate-core/hibernate-core.gradle
===================================================================
--- core/branches/gradle2/hibernate-core/hibernate-core.gradle 2010-06-24 18:44:42 UTC (rev 19822)
+++ core/branches/gradle2/hibernate-core/hibernate-core.gradle 2010-06-24 18:45:49 UTC (rev 19823)
@@ -1,13 +1,16 @@
apply plugin: 'java'
apply plugin: 'antlr'
-apply plugin: org.hibernate.gradle.util.IntegrationTestPlugin
+apply plugin: org.hibernate.gradle.testing.matrix.MatrixTestingPlugin
sourceSets {
- intgTest {
- resources{
- // resources inherently exclude sources
- srcDir 'src/intgTest/java'
+ matrix {
+ java {
+ setSrcDirs( ['src/intgTest/java'] )
}
+ // resources inherently exclude sources
+ resources {
+ setSrcDirs( ['src/intgTest/java','src/intgTest/resources'] )
+ }
}
}
@@ -24,11 +27,16 @@
}
provided( libraries.ant )
provided( libraries.jacc )
- testRuntime( 'jaxen:jaxen:1.1@jar' )
+ testRuntime( 'jaxen:jaxen:1.1' )
testRuntime( libraries.javassist )
testRuntime( libraries.cglib ) {
transitive = true
}
+ matrixRuntime( 'jaxen:jaxen:1.1' )
+ matrixRuntime( libraries.javassist )
+ matrixRuntime( libraries.cglib ) {
+ transitive = true
+ }
}
@@ -38,7 +46,7 @@
ideaModule {
sourceDirs.add( file( buildDirName + '/generated-src/antlr/main' ) )
- testSourceDirs.addAll( sourceSets.intgTest.java.srcDirs )
- testSourceDirs.addAll( sourceSets.intgTest.resources.srcDirs )
+ testSourceDirs.addAll( sourceSets.matrix.java.srcDirs )
+ testSourceDirs.addAll( sourceSets.matrix.resources.srcDirs )
}
Modified: core/branches/gradle2/hibernate-ehcache/hibernate-ehcache.gradle
===================================================================
--- core/branches/gradle2/hibernate-ehcache/hibernate-ehcache.gradle 2010-06-24 18:44:42 UTC (rev 19822)
+++ core/branches/gradle2/hibernate-ehcache/hibernate-ehcache.gradle 2010-06-24 18:45:49 UTC (rev 19823)
@@ -1,10 +1,10 @@
apply plugin: 'java'
-apply plugin: org.hibernate.gradle.util.IntegrationTestPlugin
+apply plugin: org.hibernate.gradle.testing.matrix.MatrixTestingPlugin
// todo : does this single test really need to be run against ever database in the matrix?
dependencies {
compile( project( ':hibernate-core' ) )
compile( [group: 'net.sf.ehcache', name: 'ehcache', version: '1.5.0'] )
- intgTestCompile( project(':hibernate-core').sourceSets.intgTest.classes )
+ matrixCompile( project(':hibernate-core').sourceSets.matrix.classes )
}
\ No newline at end of file
Modified: core/branches/gradle2/hibernate-entitymanager/hibernate-entitymanager.gradle
===================================================================
--- core/branches/gradle2/hibernate-entitymanager/hibernate-entitymanager.gradle 2010-06-24 18:44:42 UTC (rev 19822)
+++ core/branches/gradle2/hibernate-entitymanager/hibernate-entitymanager.gradle 2010-06-24 18:45:49 UTC (rev 19823)
@@ -1,5 +1,5 @@
apply plugin: 'java'
-apply plugin: org.hibernate.gradle.util.IntegrationTestPlugin
+apply plugin: org.hibernate.gradle.testing.matrix.MatrixTestingPlugin
// todo : there are test failures due to issues with how 'bundles' are handled.
// My guess is using TCCL as the tests try to is not valid in Gradle.
@@ -20,40 +20,39 @@
compile( libraries.jpa )
compile( libraries.jta )
compile( libraries.javassist )
- intgTestCompile( project(':hibernate-core').sourceSets.intgTest.classes )
- intgTestCompile( libraries.junit )
- intgTestCompile( libraries.jpa_modelgen )
- intgTestCompile( libraries.shrinkwrap_api )
- intgTestCompile( libraries.shrinkwrap )
- intgTestCompile( libraries.validation )
- intgTestCompile( libraries.slf4j_api )
- intgTestRuntime( libraries.validator )
+ matrixCompile( project(':hibernate-core').sourceSets.matrix.classes )
+ matrixCompile( libraries.junit )
+ matrixCompile( libraries.jpa_modelgen )
+ matrixCompile( libraries.shrinkwrap_api )
+ matrixCompile( libraries.shrinkwrap )
+ matrixCompile( libraries.validation )
+ matrixCompile( libraries.slf4j_api )
+ matrixRuntime( libraries.validator )
}
procTargetDirName = buildDirName + "/generated-src/jpamodelgen"
procTargetDir = dir( procTargetDirName )
-compileIntgTestJava {
+compileMatrixJava {
configure( options ) {
fork( executable: java6Home.getJavacExecutable() )
compilerArgs = [ "-s", "$procTargetDir.dir.absolutePath" ]
}
}
-compileIntgTestJava.dependsOn procTargetDir
-sourceSets.intgTest.java.srcDir procTargetDirName
+compileMatrixJava.dependsOn procTargetDir
+//sourceSets.intgTest.java.srcDir procTargetDirName
bundlesTargetDirName = "$buildDirName/bundles"
bundlesTargetDir = dir( bundlesTargetDirName )
-task processIntgTestBundles {
+task processBundleResources {
copy {
from 'src/intgTest/bundles'
into bundlesTargetDir.dir
}
}
-processIntgTestBundles.dependsOn bundlesTargetDir
+processBundleResources.dependsOn bundlesTargetDir
+processMatrixResources.dependsOn processBundleResources
-processIntgTestResources.dependsOn processIntgTestBundles
-
ideaModule {
testSourceDirs.add( file( procTargetDirName ) )
}
15 years, 10 months
Hibernate SVN: r19822 - in core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle: testing and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-24 14:44:42 -0400 (Thu, 24 Jun 2010)
New Revision: 19822
Added:
core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/
core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/database/
core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/database/DatabaseMatrixConvention.java
core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/database/DatabaseMatrixPlugin.java
core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/
core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/MatrixNode.java
core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/MatrixNodeProvider.java
core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/MatrixTestingPlugin.java
Removed:
core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/util/IntegrationTestPlugin.java
Modified:
core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/util/IvyResolutionHelper.java
Log:
split processing of matrix databases and creating of matrix testing objects into separate plugins
Added: core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/database/DatabaseMatrixConvention.java
===================================================================
--- core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/database/DatabaseMatrixConvention.java (rev 0)
+++ core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/database/DatabaseMatrixConvention.java 2010-06-24 18:44:42 UTC (rev 19822)
@@ -0,0 +1,47 @@
+package org.hibernate.gradle.testing.database;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import groovy.lang.Closure;
+import org.gradle.util.ConfigureUtil;
+
+/**
+ * TODO : javadoc
+ *
+ * @author Steve Ebersole
+ */
+public class DatabaseMatrixConvention {
+ private final DatabaseMatrixPlugin plugin;
+ private final Configuration configuration = new Configuration();
+
+ public DatabaseMatrixConvention(DatabaseMatrixPlugin plugin) {
+ this.plugin = plugin;
+ }
+
+ /**
+ * Allows the user access to define where we should look for database configs
+ *
+ * @param closure The configuration closure
+ */
+ public void databases(Closure closure) {
+ ConfigureUtil.configure( closure, configuration );
+ for ( Object baseDir : configuration.baseDirectories ) {
+ plugin.applyDatabaseDirectories( baseDir );
+ }
+ }
+
+ private static class Configuration {
+ List<Object> baseDirectories = new ArrayList<Object>();
+
+ public void baseDir(Object directory) {
+ baseDirectories.add( directory );
+ }
+
+ public void baseDirs(Object... directories) {
+ this.baseDirectories.addAll( Arrays.asList( directories ) );
+ }
+ }
+}
Added: core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/database/DatabaseMatrixPlugin.java
===================================================================
--- core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/database/DatabaseMatrixPlugin.java (rev 0)
+++ core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/database/DatabaseMatrixPlugin.java 2010-06-24 18:44:42 UTC (rev 19822)
@@ -0,0 +1,128 @@
+package org.hibernate.gradle.testing.database;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gradle.api.Plugin;
+import org.gradle.api.Project;
+import org.gradle.api.artifacts.Configuration;
+import org.gradle.api.file.FileCollection;
+import org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.hibernate.gradle.testing.matrix.MatrixNode;
+import org.hibernate.gradle.testing.matrix.MatrixNodeProvider;
+import org.hibernate.gradle.util.IvyResolutionHelper;
+import org.hibernate.gradle.util.Jdk;
+import org.hibernate.gradle.util.ResolutionException;
+
+/**
+ * TODO : javadoc
+ *
+ * @author Steve Ebersole
+ */
+public class DatabaseMatrixPlugin implements Plugin<Project>, MatrixNodeProvider {
+ private static final Logger log = LoggerFactory.getLogger( DatabaseMatrixPlugin.class );
+
+ private Project project;
+ private IvyResolutionHelper ivyResolutionHelper;
+ private List<MatrixNode> matrixNodes = new ArrayList<MatrixNode>();
+
+ public void apply(Project project) {
+ this.project = project;
+ this.ivyResolutionHelper = new IvyResolutionHelper( project );
+
+ project.getConvention().getPlugins().put( "databases", new DatabaseMatrixConvention( this ) );
+ }
+
+
+ /*package*/ void applyDatabaseDirectories(Object databasesBaseDirObject) {
+ final File databasesBaseDir = project.file( databasesBaseDirObject );
+ for ( File entry : databasesBaseDir.listFiles() ) {
+ if ( entry.isDirectory() ) {
+ applyPossibleDatabaseDirectory( entry );
+ }
+ }
+ }
+
+ private void applyPossibleDatabaseDirectory(final File databaseDir) {
+ final String databaseName = databaseDir.getName();
+ log.debug( "Checking potential database directory : {}", databaseName );
+
+ final Configuration configuration = prepareJdbcDependencies( databaseDir );
+ if ( configuration == null ) {
+ return;
+ }
+ configuration.setVisible( true );
+ configuration.setDescription( "The [" + databaseName + "] JDBC dependency configuration" );
+
+ final File resourcesDir = new File( databaseDir, "resources" );
+ if ( resourcesDir.isDirectory() && resourcesDir.exists() ) {
+ configuration.addDependency(
+ new DefaultSelfResolvingDependency( project.files( resourcesDir ) )
+ );
+ }
+
+ matrixNodes.add(
+ new MatrixNode() {
+ public String getName() {
+ return databaseName;
+ }
+
+ public Configuration getTestingRuntimeConfiguration() {
+ return configuration;
+ }
+
+ public Jdk getTestingRuntimeJdk() {
+ return null;
+ }
+ }
+ );
+ }
+
+ private Configuration prepareJdbcDependencies(File databaseDir) {
+ final String databaseName = databaseDir.getName();
+
+ final File ivyXml = new File( databaseDir, "ivy.xml" );
+ if ( ivyXml.exists() && ivyXml.isFile() ) {
+ try {
+ return ivyResolutionHelper.resolve( ivyXml, databaseName );
+ }
+ catch ( ResolutionException e ) {
+ log.info( "Skipping database '{}' due to problems resolving dependencies", databaseDir.getName() );
+ }
+ }
+
+ final File jdbcDir = new File( databaseDir, "jdbc" );
+ if ( jdbcDir.exists() && jdbcDir.isDirectory() ) {
+ File[] jdbcDirFiles = jdbcDir.listFiles();
+ if ( jdbcDirFiles == null || jdbcDirFiles.length == 0 ) {
+ log.warn( "Found 'jdbc' directory, but no entries" );
+ }
+ else {
+ return createSelfContainedConfiguration( jdbcDir, databaseName );
+ }
+ }
+
+ log.info(
+ "Skipping directory from database processing [{}]; could not locate 'ivy.xml' nor 'jdbc' directory",
+ databaseDir.getAbsolutePath()
+ );
+
+ return null;
+ }
+
+ private Configuration createSelfContainedConfiguration(File directory, String configurationName) {
+ DefaultSelfResolvingDependency dependency =
+ new DefaultSelfResolvingDependency( project.files( (File[]) directory.listFiles() ) );
+ Configuration configuration = ivyResolutionHelper.getOrCreateConfiguration( configurationName );
+ configuration.addDependency( dependency );
+ return configuration;
+ }
+
+ public List<MatrixNode> getMatrixNodes() {
+ return matrixNodes;
+ }
+}
Added: core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/MatrixNode.java
===================================================================
--- core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/MatrixNode.java (rev 0)
+++ core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/MatrixNode.java 2010-06-24 18:44:42 UTC (rev 19822)
@@ -0,0 +1,25 @@
+package org.hibernate.gradle.testing.matrix;
+
+import java.io.File;
+
+import org.gradle.api.artifacts.Configuration;
+
+import org.hibernate.gradle.util.Jdk;
+
+/**
+ * Describes the various pieces of information being contributed to the matrix by a given node.
+ *
+ * @author Steve Ebersole
+ */
+public interface MatrixNode {
+ /**
+ * Get the name of this node.
+ *
+ * @return The node.
+ */
+ public String getName();
+
+ public Configuration getTestingRuntimeConfiguration();
+
+ public Jdk getTestingRuntimeJdk();
+}
Added: core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/MatrixNodeProvider.java
===================================================================
--- core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/MatrixNodeProvider.java (rev 0)
+++ core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/MatrixNodeProvider.java 2010-06-24 18:44:42 UTC (rev 19822)
@@ -0,0 +1,12 @@
+package org.hibernate.gradle.testing.matrix;
+
+import java.util.List;
+
+/**
+ * TODO : javadoc
+ *
+ * @author Steve Ebersole
+ */
+public interface MatrixNodeProvider {
+ public List<MatrixNode> getMatrixNodes();
+}
Added: core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/MatrixTestingPlugin.java
===================================================================
--- core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/MatrixTestingPlugin.java (rev 0)
+++ core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/testing/matrix/MatrixTestingPlugin.java 2010-06-24 18:44:42 UTC (rev 19822)
@@ -0,0 +1,163 @@
+package org.hibernate.gradle.testing.matrix;
+
+import java.io.File;
+import java.util.List;
+
+import org.gradle.api.Plugin;
+import org.gradle.api.Project;
+import org.gradle.api.Task;
+import org.gradle.api.artifacts.Configuration;
+import org.gradle.api.file.FileCollection;
+import org.gradle.api.plugins.JavaPluginConvention;
+import org.gradle.api.tasks.SourceSet;
+import org.gradle.api.tasks.SourceSetContainer;
+import org.gradle.api.tasks.testing.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.gradle.api.plugins.JavaPlugin.COMPILE_CONFIGURATION_NAME;
+import static org.gradle.api.plugins.JavaPlugin.RUNTIME_CONFIGURATION_NAME;
+import static org.gradle.api.plugins.JavaPlugin.TEST_TASK_NAME;
+
+/**
+ * TODO : 1) add a base configuration of common attribute across all matrix node tasks (convention)
+ * TODO: 2) somehow allow applying just a single database to a project (non matrix testing).
+ *
+ * @author Steve Ebersole
+ */
+public class MatrixTestingPlugin implements Plugin<Project> {
+ private static final Logger log = LoggerFactory.getLogger( MatrixTestingPlugin.class );
+
+ public static final String MATRIX_COMPILE_CONFIG_NAME = "matrixCompile";
+ public static final String MATRIX_RUNTIME_CONFIG_NAME = "matrixRuntime";
+ public static final String MATRIX_TASK_NAME = "matrix";
+ public static final String MATRIX_SOURCE_SET_NAME = "matrix";
+
+ private Project project;
+
+ private Configuration matrixCompileConfig;
+ private Configuration matrixRuntimeConfig;
+
+ private Task matrixTask;
+
+ private SourceSet matrixSourceSet;
+
+ public void apply(Project project) {
+ this.project = project;
+
+ matrixCompileConfig = prepareCompileConfiguration();
+ matrixRuntimeConfig = prepareRuntimeConfiguration();
+
+ matrixSourceSet = prepareSourceSet();
+
+ // create a "grouping task" for all the matrix nodes
+ matrixTask = project.getTasks().add( MATRIX_TASK_NAME );
+
+ generateNodes();
+ }
+
+ private Configuration prepareCompileConfiguration() {
+ return project.getConfigurations().add( MATRIX_COMPILE_CONFIG_NAME )
+ .setVisible( true )
+ .setTransitive( false )
+ .setDescription( "Dependencies used to compile the matrix tests" )
+ .extendsFrom( project.getConfigurations().getByName( COMPILE_CONFIGURATION_NAME ) );
+ }
+
+ private Configuration prepareRuntimeConfiguration() {
+ return project.getConfigurations().add( MATRIX_RUNTIME_CONFIG_NAME )
+ .setVisible( true )
+ .setTransitive( true )
+ .setDescription( "Dependencies (baseline) used to run the matrix tests" )
+ .extendsFrom( matrixCompileConfig )
+ .extendsFrom( project.getConfigurations().getByName( RUNTIME_CONFIGURATION_NAME ) );
+ }
+
+ private SourceSet prepareSourceSet() {
+ final SourceSetContainer sourceSets = project.getConvention().getPlugin( JavaPluginConvention.class ).getSourceSets();
+ SourceSet sourceSet = sourceSets.findByName( MATRIX_SOURCE_SET_NAME );
+ if ( sourceSet == null ) {
+ sourceSet = sourceSets.add( MATRIX_SOURCE_SET_NAME );
+ }
+
+ final SourceSet mainSourceSet = sourceSets.getByName( SourceSet.MAIN_SOURCE_SET_NAME );
+ sourceSet.setCompileClasspath( mainSourceSet.getClasses().plus( matrixCompileConfig ) );
+ sourceSet.setRuntimeClasspath( mainSourceSet.getClasses().plus( sourceSet.getClasses() ).plus( matrixRuntimeConfig ) );
+
+ final SourceSet unitTestSourceSet = sourceSets.getByName( SourceSet.TEST_SOURCE_SET_NAME );
+ sourceSet.setClassesDir( unitTestSourceSet.getClassesDir() );
+
+ return sourceSet;
+ }
+
+ private void generateNodes() {
+ // For now we just hard code this to locate the databases processed by
+ // org.hibernate.gradle.testing.database.DatabaseMatrixPlugin. But long term would be much better to
+ // abstract this idea via the MatrixNode/MatrixNodeProvider interfaces; this would allow the jvm variance
+ // needed for jdbc3/jdbc4 testing for example. Not to mention its much more generally applicable
+ //
+ // Also the notion that the plugin as a MatrixNodeProducer might not be appropriate. probably a split there
+ // is in order too (config producer and jvm producer and somehow they get wired into a matrix).
+ //
+ // but again this is just a start.
+ List<MatrixNode> matrixNodes = locateMatrixNodes();
+
+ for ( MatrixNode node : matrixNodes ) {
+ Task nodeTask = prepareNodeTask( node );
+ matrixTask.dependsOn( nodeTask );
+ }
+ }
+
+ private List<MatrixNode> locateMatrixNodes() {
+ Project project = this.project;
+ do {
+ for ( Plugin plugin : project.getPlugins() ) {
+ if ( MatrixNodeProvider.class.isInstance( plugin ) ) {
+ return ( (MatrixNodeProvider) plugin ).getMatrixNodes();
+ }
+ }
+ project = project.getParent();
+ } while ( project != null );
+
+ return null;
+ }
+
+
+ private static final String[] INTG_TEST_INCLUDES = new String[] {
+ "**/org/hibernate/test/**",
+ "**/org/hibernate/ejb/test/**"
+ };
+
+ private Task prepareNodeTask(MatrixNode node) {
+ final Test nodeTask = project.getTasks().add( MATRIX_TASK_NAME + '_' + node.getName(), Test.class );
+ nodeTask.setDescription( "Runs the matrix against " + node.getName() );
+
+ FileCollection classpath = node.getTestingRuntimeConfiguration()
+ .plus( matrixRuntimeConfig )
+ .plus( matrixSourceSet.getRuntimeClasspath() );
+ nodeTask.setClasspath( classpath );
+ nodeTask.setTestClassesDir( matrixSourceSet.getClassesDir() );
+ nodeTask.getTestSrcDirs().addAll( matrixSourceSet.getJava().getSrcDirs() );
+
+ final File baseOutputDirectory = new File( new File( project.getBuildDir(), "matrix" ), node.getName() );
+ nodeTask.setWorkingDir( baseOutputDirectory );
+ nodeTask.setTestReportDir( new File( baseOutputDirectory, "reports" ) );
+ nodeTask.setTestResultsDir( new File( baseOutputDirectory, "results" ) );
+
+ // todo : to make this more general purpose we would need to expose the Test options via a convention object.
+ // for now we just set the Hibernate specific needs...
+ nodeTask.include( INTG_TEST_INCLUDES );
+
+ final Test unitTestTask = (Test) project.getTasks().findByName( TEST_TASK_NAME );
+ if ( unitTestTask != null ) {
+ nodeTask.dependsOn( unitTestTask );
+ unitTestTask.exclude( INTG_TEST_INCLUDES );
+ }
+ nodeTask.dependsOn( project.getTasks().getByName( matrixSourceSet.getClassesTaskName() ) );
+
+ nodeTask.jvmArgs( "-Xms512m", "-Xmx1024m", "-XX:MaxPermSize=128m" );
+ nodeTask.getSystemProperties().put( "hibernate.test.validatefailureexpected", "true" );
+
+ return nodeTask;
+ }
+}
Deleted: core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/util/IntegrationTestPlugin.java
===================================================================
--- core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/util/IntegrationTestPlugin.java 2010-06-24 18:37:40 UTC (rev 19821)
+++ core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/util/IntegrationTestPlugin.java 2010-06-24 18:44:42 UTC (rev 19822)
@@ -1,215 +0,0 @@
-package org.hibernate.gradle.util;
-
-import java.io.File;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.gradle.api.Plugin;
-import org.gradle.api.Project;
-import org.gradle.api.Task;
-import org.gradle.api.artifacts.Configuration;
-import org.gradle.api.file.FileCollection;
-import org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency;
-import org.gradle.api.plugins.JavaPluginConvention;
-import org.gradle.api.tasks.SourceSet;
-import org.gradle.api.tasks.SourceSetContainer;
-import org.gradle.api.tasks.testing.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.gradle.api.plugins.JavaPlugin.COMPILE_CONFIGURATION_NAME;
-import static org.gradle.api.plugins.JavaPlugin.RUNTIME_CONFIGURATION_NAME;
-import static org.gradle.api.plugins.JavaPlugin.TEST_TASK_NAME;
-
-
-/**
- * TODO : would be nice to allow singular configuration of common attributes across all the intgTest_X tasks
- * As it is each would need to be configured individually
- *
- * @author Steve Ebersole
- */
-public class IntegrationTestPlugin implements Plugin<Project> {
- private static final Logger log = LoggerFactory.getLogger( IntegrationTestPlugin.class );
-
- public static final String INTG_TEST_TASK_NAME = "intgTest";
- public static final String INTG_TEST_SOURCE_SET_NAME = "intgTest";
- public static final String INTG_TEST_COMPILE_CONFIG_NAME = "intgTestCompile";
- public static final String INTG_TEST_RUNTIME_CONFIG_NAME = "intgTestRuntime";
-
- private Project project;
- private IvyResolutionHelper ivyResolutionHelper;
- private Set<File> databaseDirs = new HashSet<File>();
-
- private Configuration intgTestCompileConfig;
- private Configuration intgTestRuntimeConfig;
- private SourceSet intgTestSourceSet;
- private Task intgTestGroupTask;
-
- public void apply(Project project) {
- this.project = project;
- this.ivyResolutionHelper = new IvyResolutionHelper( project );
- this.databaseDirs = new HashSet<File>();
- applyDatabaseDirectories( new File( project.getRootProject().getProjectDir(), "databases" ) );
-
- intgTestCompileConfig = prepareCompileConfiguration();
- intgTestRuntimeConfig = prepareRuntimeConfiguration();
-
- intgTestSourceSet = prepareSourceSet();
-
- // create a "grouping task" for all the integration tests in *this* project
- intgTestGroupTask = project.getTasks().add( INTG_TEST_TASK_NAME );
-
-// todo : handle "extra" / "local" database directories; requires convention object and delayed task generation
-//
-// project.getGradle().addBuildListener(
-// new BuildAdapter() {
-// @Override
-// public void projectsEvaluated(Gradle gradle) {
-// finishUp();
-// }
-// }
-// );
-// for now we just use the defaults and finish up immediately
- finishUp();
- }
-
- private SourceSet prepareSourceSet() {
- final SourceSetContainer sourceSets = project.getConvention().getPlugin( JavaPluginConvention.class ).getSourceSets();
- SourceSet sourceSet = sourceSets.findByName( INTG_TEST_SOURCE_SET_NAME );
- if ( sourceSet == null ) {
- sourceSet = sourceSets.add( INTG_TEST_SOURCE_SET_NAME );
- }
-// sourceSet.setCompileClasspath( intgTestCompileConfig );
-// // this one is not totally accurate as it is missing the specific jdbc drivers.
-// sourceSet.setRuntimeClasspath( intgTestSourceSet.getClasses().plus( intgTestRuntimeConfig ) );
-
- final SourceSet mainSourceSet = sourceSets.getByName( SourceSet.MAIN_SOURCE_SET_NAME );
- sourceSet.setCompileClasspath( mainSourceSet.getClasses().plus( intgTestCompileConfig ) );
- sourceSet.setRuntimeClasspath( mainSourceSet.getClasses().plus( sourceSet.getClasses() ).plus( intgTestRuntimeConfig ) );
-
- final SourceSet unitTestSourceSet = sourceSets.getByName( SourceSet.TEST_SOURCE_SET_NAME );
- sourceSet.setClassesDir( unitTestSourceSet.getClassesDir() );
-
- return sourceSet;
- }
-
- private Configuration prepareCompileConfiguration() {
- return project.getConfigurations().add( INTG_TEST_COMPILE_CONFIG_NAME )
- .setVisible( true )
- .setTransitive( false )
- .setDescription( "Libraries/dependencies used to compile the integration tests" )
- .extendsFrom( project.getConfigurations().getByName( COMPILE_CONFIGURATION_NAME ) );
- }
-
- private Configuration prepareRuntimeConfiguration() {
- return project.getConfigurations().add( INTG_TEST_RUNTIME_CONFIG_NAME )
- .setVisible( true )
- .setTransitive( true )
- .setDescription( "Libraries/dependencies used to run the integration tests" )
- .extendsFrom( intgTestCompileConfig )
- .extendsFrom( project.getConfigurations().getByName( RUNTIME_CONFIGURATION_NAME ) );
- }
-
- private void applyDatabaseDirectories(File databasesBaseDir) {
- File[] files = databasesBaseDir.listFiles();
- for ( File file : files ) {
- log.debug( "Checking potential database directory : {}", file.getName() );
- if ( !file.isDirectory() ) {
- continue;
- }
- // look for a file named 'ivy.xml' or a directory named 'jdbc' (expected to contain driver-related jars)
- File ivyXml = new File( file, "ivy.xml" );
- if ( ivyXml.exists() && ivyXml.isFile() ) {
- databaseDirs.add( file );
- continue;
- }
- File jdbcDir = new File( file, "jdbc" );
- if ( jdbcDir.exists() && jdbcDir.isDirectory() ) {
- // it better have entries also...
- File[] jdbcDirFiles = jdbcDir.listFiles();
- if ( jdbcDirFiles == null || jdbcDirFiles.length == 0 ) {
- log.warn( "Found 'jdbc' directory, but no entries" );
- }
- databaseDirs.add( file );
- continue;
- }
- log.info( "Skipping database directory [{}] as no 'ivy.xml' file nor 'jdbc' directory could be found", file.getName() );
- }
- }
-
- private void finishUp() {
- for ( File databaseDir : databaseDirs ) {
- processDatabase( databaseDir );
- }
- }
-
- private void processDatabase(File databaseDir) {
- try {
- Configuration configuration = prepareJdbcDependencies( databaseDir );
- configuration.extendsFrom( intgTestRuntimeConfig );
- Task intgTestTask = prepareTestTask( databaseDir, configuration );
- intgTestGroupTask.dependsOn( intgTestTask );
- }
- catch ( ResolutionException e ) {
- log.info( "Skipping database '{}' due to problems resolving dependencies", databaseDir.getName() );
- }
- }
-
- private Configuration prepareJdbcDependencies(File databaseDir) {
- final String databaseName = databaseDir.getName();
- log.debug( "Starting processing of '{}' database", databaseName );
- final File ivyXml = new File( databaseDir, "ivy.xml" );
- if ( ivyXml.exists() && ivyXml.isFile() ) {
- return ivyResolutionHelper.resolve( ivyXml, databaseName );
- }
- else {
- return createSelfContainedConfiguration( new File( databaseDir, "jdbc" ), databaseName );
- }
- }
-
- private Configuration createSelfContainedConfiguration(File directory, String configurationName) {
- DefaultSelfResolvingDependency dependency = new DefaultSelfResolvingDependency(
- project.files( (File[]) directory.listFiles() )
- );
- Configuration configuration = ivyResolutionHelper.getOrCreateConfiguration( configurationName );
- configuration.addDependency( dependency );
- return configuration;
- }
-
- private static final String INTG_TEST_INCLUDES = "**/org/hibernate/test/**";
-
- private Task prepareTestTask(File databaseDir, Configuration configuration) {
- final String databaseName = databaseDir.getName();
- final Test intgTestTask = project.getTasks().add( String.format( "intgTest_%s", databaseName ), Test.class );
- intgTestTask.setDescription( "Runs the integration tests for " + databaseName );
-
- final FileCollection classpath = project.files( new File( databaseDir, "resources" ) )
- .plus( intgTestSourceSet.getRuntimeClasspath() )
- .plus( configuration );
- intgTestTask.setClasspath( classpath );
- intgTestTask.setTestClassesDir( intgTestSourceSet.getClassesDir() );
- intgTestTask.getTestSrcDirs().addAll( intgTestSourceSet.getJava().getSrcDirs() );
-
- final File baseOutputDirectory = new File( new File( project.getBuildDir(), "intgTest" ), databaseName );
- intgTestTask.setWorkingDir( baseOutputDirectory );
- intgTestTask.setTestReportDir( new File( baseOutputDirectory, "reports" ) );
- intgTestTask.setTestResultsDir( new File( baseOutputDirectory, "results" ) );
-
- // todo : to make this more general purpose we would need to expose the Test options via a convention object.
- // for now we just set the Hibernate specific needs...
- intgTestTask.include( INTG_TEST_INCLUDES );
-
- final Test unitTestTask = (Test) project.getTasks().findByName( TEST_TASK_NAME );
- if ( unitTestTask != null ) {
- intgTestTask.dependsOn( unitTestTask );
- unitTestTask.exclude( INTG_TEST_INCLUDES );
- }
- intgTestTask.dependsOn( project.getTasks().getByName( intgTestSourceSet.getClassesTaskName() ) );
-
- intgTestTask.setMaxHeapSize( "1024m" );
- intgTestTask.getSystemProperties().put( "hibernate.test.validatefailureexpected", "true" );
-
- return intgTestTask;
- }
-
-}
Modified: core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/util/IvyResolutionHelper.java
===================================================================
--- core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/util/IvyResolutionHelper.java 2010-06-24 18:37:40 UTC (rev 19821)
+++ core/branches/gradle2/buildSrc/src/main/java/org/hibernate/gradle/util/IvyResolutionHelper.java 2010-06-24 18:44:42 UTC (rev 19822)
@@ -86,9 +86,6 @@
Configuration configuration = project.getConfigurations().findByName( configurationName );
if ( configuration == null ) {
configuration = project.getConfigurations().add( configurationName );
- configuration.setVisible( true );
- configuration.setDescription( "The [" + configurationName + "] integration test dependency configuration" );
- configuration.extendsFrom( project.getConfigurations().getByName( TEST_RUNTIME_CONFIGURATION_NAME ) );
}
return configuration;
}
15 years, 10 months
Hibernate SVN: r19821 - core/branches/gradle2/buildSrc.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-24 14:37:40 -0400 (Thu, 24 Jun 2010)
New Revision: 19821
Modified:
core/branches/gradle2/buildSrc/build.gradle
Log:
added proper repositories
Modified: core/branches/gradle2/buildSrc/build.gradle
===================================================================
--- core/branches/gradle2/buildSrc/build.gradle 2010-06-24 09:52:18 UTC (rev 19820)
+++ core/branches/gradle2/buildSrc/build.gradle 2010-06-24 18:37:40 UTC (rev 19821)
@@ -7,6 +7,11 @@
}
}
+repositories {
+ mavenCentral()
+ mavenRepo urls: "file://" + System.getProperty('user.home') + "/.m2/repository/"
+}
+
apply plugin: 'groovy'
dependencies {
15 years, 10 months
Hibernate SVN: r19820 - in core/branches/Branch_3_3_2_GA_CP: testsuite/src/test/java/org/hibernate/test/batch and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-06-24 05:52:18 -0400 (Thu, 24 Jun 2010)
New Revision: 19820
Modified:
core/branches/Branch_3_3_2_GA_CP/parent/pom.xml
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/batch/DataPoint.hbm.xml
Log:
JBPAPP-2731 HHH-4568 Sybase - Test BatchTest fails due to 'unexpected row count from update'
Modified: core/branches/Branch_3_3_2_GA_CP/parent/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/parent/pom.xml 2010-06-24 09:50:07 UTC (rev 19819)
+++ core/branches/Branch_3_3_2_GA_CP/parent/pom.xml 2010-06-24 09:52:18 UTC (rev 19820)
@@ -731,7 +731,7 @@
<properties>
<db.dialect>org.hibernate.dialect.SybaseASE15Dialect</db.dialect>
<jdbc.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.driver>
- <jdbc.url>jdbc:sybase:Tds:dev77.qa.atl2.redhat.com:5000/hibbr330</jdbc.url>
+ <jdbc.url>jdbc:sybase:Tds:dev77.qa.atl2.redhat.com:5000/hibbr330?DYNAMIC_PREPARE=true</jdbc.url>
<jdbc.user>hibbr330</jdbc.user>
<jdbc.pass>hibbr330</jdbc.pass>
<jdbc.isolation />
Modified: core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/batch/DataPoint.hbm.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/batch/DataPoint.hbm.xml 2010-06-24 09:50:07 UTC (rev 19819)
+++ core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/batch/DataPoint.hbm.xml 2010-06-24 09:52:18 UTC (rev 19820)
@@ -13,10 +13,10 @@
<generator class="increment"/>
</id>
<property name="x">
- <column name="xval" not-null="true" length="4" unique-key="xy"/>
+ <column name="xval" not-null="true" precision="25" scale="20" unique-key="xy"/>
</property>
<property name="y">
- <column name="yval" not-null="true" length="4" unique-key="xy"/>
+ <column name="yval" not-null="true" precision="25" scale="20" unique-key="xy"/>
</property>
<property name="description"/>
</class>
15 years, 10 months