Hibernate SVN: r19799 - core/branches/Branch_3_5/core/src/main/java/org/hibernate/impl.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2010-06-23 10:55:58 -0400 (Wed, 23 Jun 2010)
New Revision: 19799
Modified:
core/branches/Branch_3_5/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java
Log:
HHH-5329 Consider NoClasDefFoundError as a sign of not having Java 5 and concurrent package
Modified: core/branches/Branch_3_5/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java
===================================================================
--- core/branches/Branch_3_5/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java 2010-06-23 14:54:25 UTC (rev 19798)
+++ core/branches/Branch_3_5/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java 2010-06-23 14:55:58 UTC (rev 19799)
@@ -204,6 +204,8 @@
Constructor constructor = concurrentStatsClass.getConstructor(new Class[]{SessionFactoryImplementor.class});
concurrentStatistics = (Statistics) constructor.newInstance(new Object[]{this});
log.trace("JDK 1.5 concurrent classes present");
+ } catch ( NoClassDefFoundError noJava5 ) {
+ log.trace("JDK 1.5 concurrent classes missing");
} catch (Exception noJava5) {
log.trace("JDK 1.5 concurrent classes missing");
}
13 years, 10 months
Hibernate SVN: r19798 - core/trunk/core/src/main/java/org/hibernate/impl.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2010-06-23 10:54:25 -0400 (Wed, 23 Jun 2010)
New Revision: 19798
Modified:
core/trunk/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java
Log:
HHH-5329 Consider NoClasDefFoundError as a sign of not having Java 5 and concurrent package
Modified: core/trunk/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java 2010-06-23 14:14:06 UTC (rev 19797)
+++ core/trunk/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java 2010-06-23 14:54:25 UTC (rev 19798)
@@ -207,6 +207,8 @@
Constructor constructor = concurrentStatsClass.getConstructor(new Class[]{SessionFactoryImplementor.class});
concurrentStatistics = (Statistics) constructor.newInstance(new Object[]{this});
log.trace("JDK 1.5 concurrent classes present");
+ } catch ( NoClassDefFoundError noJava5 ) {
+ log.trace("JDK 1.5 concurrent classes missing");
} catch (Exception noJava5) {
log.trace("JDK 1.5 concurrent classes missing");
}
13 years, 10 months
Hibernate SVN: r19797 - validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-06-23 10:14:06 -0400 (Wed, 23 Jun 2010)
New Revision: 19797
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/ConstraintHelper.java
Log:
HV-340
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-23 11:23:07 UTC (rev 19796)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintDescriptorImpl.java 2010-06-23 14:14:06 UTC (rev 19797)
@@ -19,10 +19,12 @@
import java.io.Serializable;
import java.lang.annotation.Annotation;
+import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.security.AccessController;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -63,6 +65,19 @@
private static final String PAYLOAD = "payload";
/**
+ * A list of annotations which can be ignored when investigating for composing constraints.
+ */
+ private static final List<String> NON_COMPOSING_CONSTRAINT_ANNOTATIONS = new ArrayList<String>();
+
+ static {
+ NON_COMPOSING_CONSTRAINT_ANNOTATIONS.add( Documented.class.getName() );
+ NON_COMPOSING_CONSTRAINT_ANNOTATIONS.add( Retention.class.getName() );
+ NON_COMPOSING_CONSTRAINT_ANNOTATIONS.add( Target.class.getName() );
+ NON_COMPOSING_CONSTRAINT_ANNOTATIONS.add( Constraint.class.getName() );
+ NON_COMPOSING_CONSTRAINT_ANNOTATIONS.add( ReportAsSingleViolation.class.getName() );
+ }
+
+ /**
* The actual constraint annotation.
*/
private final T annotation;
@@ -356,6 +371,11 @@
Map<ClassIndexWrapper, Map<String, Object>> overrideParameters = parseOverrideParameters();
for ( Annotation declaredAnnotation : annotation.annotationType().getDeclaredAnnotations() ) {
+ if ( NON_COMPOSING_CONSTRAINT_ANNOTATIONS.contains( declaredAnnotation.annotationType().getName() ) ) {
+ // ignore the usual suspects which will be in almost any constraint, but are no composing constraint
+ continue;
+ }
+
if ( constraintHelper.isConstraintAnnotation( declaredAnnotation )
|| constraintHelper.isBuiltinConstraint( declaredAnnotation.annotationType() ) ) {
ConstraintDescriptorImpl<?> descriptor = createComposingConstraintDescriptor(
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-23 11:23:07 UTC (rev 19796)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintHelper.java 2010-06-23 14:14:06 UTC (rev 19797)
@@ -80,11 +80,10 @@
* @author Alaa Nassef
*/
public class ConstraintHelper {
-
private final ConcurrentHashMap<Class<? extends Annotation>, List<Class<? extends ConstraintValidator<?, ?>>>> builtinConstraints =
new ConcurrentHashMap<Class<? extends Annotation>, List<Class<? extends ConstraintValidator<?, ?>>>>();
- private final ConcurrentHashMap<Class<? extends Annotation>, List<Class<? extends ConstraintValidator<? extends Annotation, ?>>>> constraintValidatorDefinitons =
+ private final ConcurrentHashMap<Class<? extends Annotation>, List<Class<? extends ConstraintValidator<? extends Annotation, ?>>>> constraintValidatorDefinitions =
new ConcurrentHashMap<Class<? extends Annotation>, List<Class<? extends ConstraintValidator<? extends Annotation, ?>>>>();
public ConstraintHelper() {
@@ -171,8 +170,8 @@
for ( Class<? extends ConstraintValidator<?, ?>> validatorClass : builtInList ) {
//safe cause all CV for a given annotation A are CV<A, ?>
@SuppressWarnings("unchecked")
- Class<ConstraintValidator<? extends Annotation, ?>> safeValdiatorClass = ( Class<ConstraintValidator<? extends Annotation, ?>> ) validatorClass;
- constraints.add( safeValdiatorClass );
+ Class<ConstraintValidator<? extends Annotation, ?>> safeValidatorClass = ( Class<ConstraintValidator<? extends Annotation, ?>> ) validatorClass;
+ constraints.add( safeValidatorClass );
}
return constraints;
@@ -187,7 +186,7 @@
*
* @param annotation the annotation to check.
*
- * @return <code>true</code> if the specified annotation is a multi value constraints, <code>false</code>
+ * @return {@code true} if the specified annotation is a multi value constraints, {@code false}
* otherwise.
*/
public boolean isMultiValueConstraint(Annotation annotation) {
@@ -356,7 +355,7 @@
throw new IllegalArgumentException( "Class cannot be null" );
}
- final List<Class<? extends ConstraintValidator<? extends Annotation, ?>>> list = constraintValidatorDefinitons.get(
+ final List<Class<? extends ConstraintValidator<? extends Annotation, ?>>> list = constraintValidatorDefinitions.get(
annotationClass
);
@@ -365,18 +364,18 @@
for ( Class<? extends ConstraintValidator<?, ?>> validatorClass : list ) {
//safe cause all CV for a given annotation A are CV<A, ?>
@SuppressWarnings("unchecked")
- Class<ConstraintValidator<T, ?>> safeValdiatorClass = ( Class<ConstraintValidator<T, ?>> ) validatorClass;
- constraintsValidators.add( safeValdiatorClass );
+ Class<ConstraintValidator<T, ?>> safeValidatorClass = ( Class<ConstraintValidator<T, ?>> ) validatorClass;
+ constraintsValidators.add( safeValidatorClass );
}
return constraintsValidators;
}
public <A extends Annotation> void addConstraintValidatorDefinition(Class<A> annotationClass, List<Class<? extends ConstraintValidator<? extends Annotation, ?>>> definitionClasses) {
- constraintValidatorDefinitons.putIfAbsent( annotationClass, definitionClasses );
+ constraintValidatorDefinitions.putIfAbsent( annotationClass, definitionClasses );
}
public boolean containsConstraintValidatorDefinition(Class<? extends Annotation> annotationClass) {
- return constraintValidatorDefinitons.containsKey( annotationClass );
+ return constraintValidatorDefinitions.containsKey( annotationClass );
}
}
13 years, 10 months
Hibernate SVN: r19796 - in validator/trunk/hibernate-validator/src: test/java/org/hibernate/validator/test/constraints/impl and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-06-23 07:23:07 -0400 (Wed, 23 Jun 2010)
New Revision: 19796
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/EmailValidator.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/test/constraints/impl/EmailValidatorTest.java
Log:
HV-339 Updated the ATOM regular expression to explicitly include allowed characters. The old expression tried to exclude characters which were not allowed. In my opinion the RFC is contradicting itself in the 'atext' definition.
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/EmailValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/EmailValidator.java 2010-06-23 07:36:32 UTC (rev 19795)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/EmailValidator.java 2010-06-23 11:23:07 UTC (rev 19796)
@@ -8,13 +8,22 @@
import org.hibernate.validator.constraints.Email;
/**
- * Check that a given string is a well-formed email address.
+ * Checks that a given string is a well-formed email address.
+ * <p>
+ * The specification of a valid email can be found in
+ * <a href="http://www.faqs.org/rfcs/rfc2822.html">RFC 2822</a>
+ * and one can come up with a regular expression matching <a href="http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html">
+ * all valid email addresses</a> as per specification. However, as this
+ * <a href="http://www.regular-expressions.info/email.html">article</a> discusses it is not necessarily practical to
+ * implement a 100% compliant email validator. This implementation is a trade-off trying to match most email while ignoring
+ * for example emails with double quotes or comments.
+ * </p>
*
* @author Emmanuel Bernard
+ * @author Hardy Ferentschik
*/
public class EmailValidator implements ConstraintValidator<Email, String> {
- //TODO: Implement this http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html regex in java
- private static String ATOM = "[^\\x00-\\x1F^\\(^\\)^\\<^\\>^\\@^\\,^\\;^\\:^\\\\^\\\"^\\.^\\[^\\]^\\s]";
+ private static String ATOM = "[a-z0-9!#$%&'*+/=?^_`{|}~-]";
private static String DOMAIN = "(" + ATOM + "+(\\." + ATOM + "+)*";
private static String IP_DOMAIN = "\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\]";
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/test/constraints/impl/EmailValidatorTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/test/constraints/impl/EmailValidatorTest.java 2010-06-23 07:36:32 UTC (rev 19795)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/test/constraints/impl/EmailValidatorTest.java 2010-06-23 11:23:07 UTC (rev 19796)
@@ -17,13 +17,14 @@
*/
package org.hibernate.validator.test.constraints.impl;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.hibernate.validator.constraints.impl.EmailValidator;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
/**
* @author Hardy Ferentschik
*/
@@ -37,23 +38,52 @@
}
@Test
- public void testEmail() throws Exception {
- isRightEmail( "emmanuel(a)hibernate.org" );
+ public void testNullAndEmptyString() throws Exception {
isRightEmail( "" );
isRightEmail( null );
+ }
+
+ @Test
+ public void testValidEmail() throws Exception {
+ isRightEmail( "emmanuel(a)hibernate.org" );
isRightEmail( "emmanuel@hibernate" );
isRightEmail( "emma-n_uel@hibernate" );
isRightEmail( "emma+nuel(a)hibernate.org" );
isRightEmail( "emma=nuel(a)hibernate.org" );
isRightEmail( "emmanuel(a)[123.12.2.11]" );
+ isRightEmail( "*(a)example.net" );
+ isRightEmail( "fred&barny(a)example.com" );
+ isRightEmail( "---(a)example.com" );
+ isRightEmail( "foo-bar(a)example.net" );
+ isRightEmail( "mailbox.sub1.sub2@this-domain" );
+ }
+
+ @Test
+ public void testInValidEmail() throws Exception {
isWrongEmail( "emmanuel.hibernate.org" );
isWrongEmail( "emma nuel(a)hibernate.org" );
isWrongEmail( "emma(nuel(a)hibernate.org" );
isWrongEmail( "emmanuel@" );
isWrongEmail( "emma\nnuel(a)hibernate.org" );
isWrongEmail( "emma@nuel(a)hibernate.org" );
+ isWrongEmail( "Just a string" );
+ isWrongEmail( "string" );
+ isWrongEmail( "me@");
+ isWrongEmail( "@example.com");
+ isWrongEmail( "me.(a)example.com");
+ isWrongEmail( ".me(a)example.com");
+ isWrongEmail( "me@example..com");
+ isWrongEmail( "me\\(a)example.com");
}
+ /**
+ * HV-339
+ */
+ @Test
+ public void testAccent() {
+ isRightEmail( "Test^Email(a)example.com" );
+ }
+
private void isRightEmail(String email) {
assertTrue( validator.isValid( email, null ), "Expected a valid email." );
}
13 years, 10 months
Hibernate SVN: r19795 - core/branches/gradle2.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-23 03:36:32 -0400 (Wed, 23 Jun 2010)
New Revision: 19795
Removed:
core/branches/gradle2/hibernate-maven-plugin/
Log:
cleanup unused maven plugin module directory
13 years, 10 months
Hibernate SVN: r19794 - core/branches/gradle2.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-23 03:35:52 -0400 (Wed, 23 Jun 2010)
New Revision: 19794
Removed:
core/branches/gradle2/hibernate-testing/
Log:
cleanup old testing module directory
13 years, 10 months
Hibernate SVN: r19793 - core/branches/gradle2.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-23 03:31:13 -0400 (Wed, 23 Jun 2010)
New Revision: 19793
Removed:
core/branches/gradle2/testsuite/
Log:
cleanup old testsuite module dir
13 years, 10 months
Hibernate SVN: r19792 - core/branches/gradle2.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-23 03:29:02 -0400 (Wed, 23 Jun 2010)
New Revision: 19792
Modified:
core/branches/gradle2/build.gradle
Log:
added infrastructure for integration testing
Modified: core/branches/gradle2/build.gradle
===================================================================
--- core/branches/gradle2/build.gradle 2010-06-23 07:27:38 UTC (rev 19791)
+++ core/branches/gradle2/build.gradle 2010-06-23 07:29:02 UTC (rev 19792)
@@ -15,6 +15,59 @@
javaVersion = "1.5"
}
+// build a map of the dependency artifacts to use. Allows centralized definition of the version of artifacts to
+// use. In that respect it serves a role similar to <dependencyManagement> in Maven
+slf4jVersion = '1.5.8'
+
+libraries = [
+ // Ant
+ ant: 'ant:ant:1.6.5',
+
+ // Antlr
+ antlr: 'antlr:antlr:2.7.7',
+
+ // Annotations
+ commons_annotations:
+ 'org.hibernate:hibernate-commons-annotations:3.2.0.Final',
+
+ // CGLIB
+ cglib: 'cglib:cglib:2.2',
+
+ // Jakarta commons-collections; todo : get rid of commons-collections dependency
+ commons_collections:
+ 'commons-collections:commons-collections:3.1',
+
+ // Dom4J
+ dom4j: 'dom4j:dom4j:1.6.1@jar',
+
+ // h2
+ h2: 'com.h2database:h2:1.2.134',
+
+ // Javassist
+ javassist: 'javassist:javassist:3.12.0.GA',
+
+ // javax
+ jpa: 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.0.Final',
+ jta: 'javax.transaction:jta:1.1',
+ validation: 'javax.validation:validation-api:1.0.0.GA',
+ validator: 'org.hibernate:hibernate-validator:4.0.2.GA',
+ jacc: 'org.jboss.javaee:jboss-jacc-api:1.1.0.GA',
+
+ // logging
+ slf4j_api: 'org.slf4j:slf4j-api:' + slf4jVersion,
+ slf4j_log4j: 'org.slf4j:slf4j-log4j12:' + slf4jVersion,
+ jcl_slf4j: 'org.slf4j:jcl-over-slf4j:' + slf4jVersion,
+ jcl_api: 'commons-logging:commons-logging-api:99.0-does-not-exist',
+ jcl: 'commons-logging:commons-logging:99.0-does-not-exist',
+
+ // testing
+ junit: 'junit:junit:3.8.2',
+ testng: 'org.testng:testng:5.8:jdk15',
+ jpa_modelgen: 'org.hibernate:hibernate-jpamodelgen:1.0.0.Final',
+ shrinkwrap_api: 'org.jboss.shrinkwrap:shrinkwrap-api:1.0.0-alpha-6',
+ shrinkwrap: 'org.jboss.shrinkwrap:shrinkwrap-impl-base:1.0.0-alpha-6'
+]
+
subprojects { subProject ->
group = 'org.hibernate.gradlePoC'
version = '1.0.0-SNAPSHOT'
@@ -34,8 +87,10 @@
}
else {
apply plugin: 'java'
- defaultTasks 'classes'
+ apply plugin: 'maven' // for install task as well as deploy dependencies
+ defaultTasks 'build'
+
configurations {
provided {
// todo : need to make sure these are non-exported
@@ -43,39 +98,22 @@
}
}
+ // appropriately inject the common dependencies into each sub-project
dependencies {
- slf4jVersion = '1.5.8'
- dom4jVersion = '1.6.1'
- antlrVersion = '2.7.7'
- annotationsCommonsVersion = '3.2.0.Final'
- jpaVersion = '1.0.0.Final'
- jtaVersion = '1.1'
- javassistVersion = '3.12.0.GA'
- cglibVersion = '2.2'
- javaxValidationVersion = '1.0.0.GA'
- hibernateValidatorVersion = '4.0.2.GA'
-
- junitVersion = '3.8.2'
- testngVersion = '5.8'
-
- h2Version = '1.2.134'
-
- compile(
- group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
- )
- testCompile(
- [group: 'junit', name: 'junit', version: junitVersion]
- )
- testRuntime(
- [group: 'org.slf4j', name: 'jcl-over-slf4j', version: slf4jVersion],
- [group: 'org.slf4j', name: 'slf4j-log4j12', version: slf4jVersion],
- [group: 'com.h2database', name: 'h2', version: h2Version]
- )
+ compile( libraries.slf4j_api )
+ testCompile( libraries.junit )
+ testRuntime( libraries.slf4j_log4j ) {
+ transitive = true
+ }
+ testRuntime( libraries.jcl_slf4j )
+ testRuntime( libraries.jcl_api )
+ testRuntime( libraries.jcl )
+ testRuntime( libraries.h2 )
}
sourceSets {
main {
- compileClasspath = compileClasspath + configurations.provided
+ compileClasspath += configurations.provided
}
}
@@ -88,31 +126,77 @@
)
compileJava {
- if (hasProperty('jdk15_home')) { options.fork(executable: "$jdk15_home/bin/javac") }
+ // by default, use jdk 1.5
+ options.fork( executable: subProject.java5Home.getJavacExecutable() )
}
compileTestJava {
- if (hasProperty('jdk15_home')) { options.fork(executable: "$jdk15_home/bin/javac") }
+ // by default, use jdk 1.5
+ options.fork( executable: subProject.java5Home.getJavacExecutable() )
}
test {
- ignoreFailures = true
+// ignoreFailures = true
+ executable = subProject.java5Home.getJavaExecutable()
+ environment['hibernate.test.validatefailureexpected'] = true
+ maxHeapSize = "1024m"
}
+ processTestResources.doLast(
+ {
+ copy {
+ from( sourceSets.test.java.srcDirs ) {
+ include '**/*.properties'
+ include '**/*.xml'
+ }
+ into sourceSets.test.classesDir
+ }
+ }
+ )
+
+ assemble.doLast( { install } )
+ uploadArchives.dependsOn install
+
// by default, compile to 1.5 compatibility
targetCompatibility = "1.5"
sourceCompatibility = "1.5"
ideaModule {
downloadJavadoc = false
- scopes.COMPILE.plus.add(configurations.provided)
+ scopes.COMPILE.plus.add( configurations.provided )
+ outputDir = subProject.sourceSets.main.classesDir
+ testOutputDir = subProject.sourceSets.test.classesDir
+ whenConfigured { module ->
+ module.dependencies*.exported = true
+ }
}
}
}
dependsOnChildren()
+// Work around for http://jira.codehaus.org/browse/GRADLE-990
+gradle.beforeProject { project ->
+ if ( 'hibernate-core' != project.name ) {
+ project.evaluationDependsOn( ':hibernate-core' )
+ }
+}
+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 ) ) {
+ project.dependencies {
+ intgTestCompile( libraries.junit )
+ intgTestRuntime( libraries.slf4j_log4j ) {
+ transitive = true
+ }
+ intgTestRuntime( libraries.jcl_slf4j )
+ intgTestRuntime( libraries.jcl_api )
+ intgTestRuntime( libraries.jcl )
+ }
+ }
+}
+
task wrapper(type: Wrapper) {
gradleVersion = '0.9-preview-3'
jarPath = 'gradle'
13 years, 10 months
Hibernate SVN: r19791 - in core/branches/gradle2/hibernate-annotations: src/intgTest/java/org/hibernate/test/annotations and 9 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-23 03:27:38 -0400 (Wed, 23 Jun 2010)
New Revision: 19791
Removed:
core/branches/gradle2/hibernate-annotations/pom.xml
Modified:
core/branches/gradle2/hibernate-annotations/hibernate-annotations.gradle
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/TestCase.java
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/derivedidentities/e6/a/DerivedIdentityEmbeddedIdParentSameIdTypeIdClassDepTest.java
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/embedded/one2many/EmbeddableWithOne2ManyTest.java
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/id/sequences/IdTest.java
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/idclass/xml/IdClassXmlTest.java
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/lob/ImageTest.java
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/lob/LobTest.java
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/lob/TextTest.java
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/onetomany/OneToManyTest.java
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java
Log:
converted hibernate-core and hibernate-annotations to use intgTest stuff
Modified: core/branches/gradle2/hibernate-annotations/hibernate-annotations.gradle
===================================================================
--- core/branches/gradle2/hibernate-annotations/hibernate-annotations.gradle 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/hibernate-annotations.gradle 2010-06-23 07:27:38 UTC (rev 19791)
@@ -1,32 +1,33 @@
+apply plugin: 'java'
+apply plugin: org.hibernate.gradle.util.IntegrationTestPlugin
+
+sourceSets {
+// intgTest {
+// resources{
+// // resources inherently exclude sources
+// srcDir 'src/intgTest/java'
+// }
+// }
+}
+
dependencies {
- compile (
- project(':hibernate-core'),
- [group: 'dom4j', name: 'dom4j', version: dom4jVersion],
- [group: 'org.hibernate', name: 'hibernate-commons-annotations', version: annotationsCommonsVersion],
- [group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.0-api', version: jpaVersion]
- )
- provided (
- [group: 'javax.validation', name: 'validation-api', version: javaxValidationVersion]
- )
- testCompile (
- project(':hibernate-testing'),
- [group: 'org.hibernate', name: 'hibernate-validator', version: hibernateValidatorVersion],
- [group: 'javax.validation', name: 'validation-api', version: javaxValidationVersion]
- )
- testRuntime (
- [group: 'javassist', name: 'javassist', version: javassistVersion],
- [group: 'cglib', name: 'cglib', version: cglibVersion, transitive: true]
- )
+ compile( project(':hibernate-core') )
+ compile( libraries.dom4j ) {
+ transitive = false
+ }
+ compile( libraries.commons_annotations )
+ compile( libraries.jpa )
+ provided( libraries.validation )
+ testCompile( libraries.validation )
+ testCompile( libraries.validator ) {
+ // for test runtime
+ transitive = true
+ }
+ testRuntime( libraries.javassist )
+ intgTestCompile( project(':hibernate-core').sourceSets.intgTest.classes )
}
-processTestResources.doLast(
- {
- copy {
- from( sourceSets.test.java.srcDirs ) {
- include '**/*.properties'
- include '**/*.xml'
- }
- into sourceSets.test.classesDir
- }
- }
-)
+ideaModule {
+ testSourceDirs.addAll( sourceSets.intgTest.java.srcDirs )
+ testSourceDirs.addAll( sourceSets.intgTest.resources.srcDirs )
+}
\ No newline at end of file
Deleted: core/branches/gradle2/hibernate-annotations/pom.xml
===================================================================
--- core/branches/gradle2/hibernate-annotations/pom.xml 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/pom.xml 2010-06-23 07:27:38 UTC (rev 19791)
@@ -1,184 +0,0 @@
-<?xml version="1.0"?>
-<!--
- ~ Hibernate, Relational Persistence for Idiomatic Java
- ~
- ~ Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- ~ indicated by the @author tags or express copyright attribution
- ~ statements applied by the authors. All third-party contributions are
- ~ distributed under license by Red Hat Middleware LLC.
- ~
- ~ This copyrighted material is made available to anyone wishing to use, modify,
- ~ copy, or redistribute it subject to the terms and conditions of the GNU
- ~ Lesser General Public License, as published by the Free Software Foundation.
- ~
- ~ This program is distributed in the hope that it will be useful,
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- ~ for more details.
- ~
- ~ You should have received a copy of the GNU Lesser General Public License
- ~ along with this distribution; if not, write to:
- ~ Free Software Foundation, Inc.
- ~ 51 Franklin Street, Fifth Floor
- ~ Boston, MA 02110-1301 USA
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-parent</artifactId>
- <version>3.6.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
- </parent>
-
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-annotations</artifactId>
- <packaging>jar</packaging>
-
- <name>Hibernate Annotations</name>
- <description>Annotations metadata for Hibernate</description>
-
- <dependencies>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-commons-annotations</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.0-api</artifactId>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>hibernate-testing</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <testResources>
- <testResource>
- <filtering>true</filtering>
- <directory>src/test/resources</directory>
- </testResource>
- </testResources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-test-ext-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-injection-plugin</artifactId>
- <configuration>
- <bytecodeInjections>
- <bytecodeInjection>
- <expression>${project.version}</expression>
- <targetMembers>
- <methodBodyReturn>
- <className>org.hibernate.cfg.annotations.Version</className>
- <methodName>getVersionString</methodName>
- </methodBodyReturn>
- </targetMembers>
- </bytecodeInjection>
- </bytecodeInjections>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.twdata.maven</groupId>
- <artifactId>maven-cli-plugin</artifactId>
- <version>0.6.4</version>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>jaxb</id>
- <activation>
- <jdk>1.5</jdk>
- </activation>
- <dependencies>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.1.3</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>doc</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <configuration>
- <sourceDocumentName>master.xml</sourceDocumentName>
- <sourceDirectory>${basedir}/src/main/docbook</sourceDirectory>
- <masterTranslation>en</masterTranslation>
- <imageResource>
- <directory>${basedir}/src/main/docbook/en/images</directory>
- </imageResource>
- </configuration>
- <executions>
- <execution>
- <id>make-doc</id>
- <phase>package</phase>
- <goals>
- <goal>resources</goal>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/TestCase.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/TestCase.java 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/TestCase.java 2010-06-23 07:27:38 UTC (rev 19791)
@@ -33,6 +33,7 @@
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Environment;
import org.hibernate.engine.SessionFactoryImplementor;
+import org.hibernate.testing.junit.functional.annotations.HibernateTestCase;
/**
* A base class for all annotation tests.
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/derivedidentities/e6/a/DerivedIdentityEmbeddedIdParentSameIdTypeIdClassDepTest.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/derivedidentities/e6/a/DerivedIdentityEmbeddedIdParentSameIdTypeIdClassDepTest.java 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/derivedidentities/e6/a/DerivedIdentityEmbeddedIdParentSameIdTypeIdClassDepTest.java 2010-06-23 07:27:38 UTC (rev 19791)
@@ -1,7 +1,6 @@
package org.hibernate.test.annotations.derivedidentities.e6.a;
import org.hibernate.Session;
-import org.hibernate.junit.FailureExpected;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.test.util.SchemaUtil;
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/embedded/one2many/EmbeddableWithOne2ManyTest.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/embedded/one2many/EmbeddableWithOne2ManyTest.java 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/embedded/one2many/EmbeddableWithOne2ManyTest.java 2010-06-23 07:27:38 UTC (rev 19791)
@@ -26,7 +26,7 @@
import java.util.List;
import org.hibernate.Session;
-import org.hibernate.junit.FailureExpected;
+import org.hibernate.testing.junit.FailureExpected;
import org.hibernate.test.annotations.TestCase;
/**
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/id/sequences/IdTest.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/id/sequences/IdTest.java 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/id/sequences/IdTest.java 2010-06-23 07:27:38 UTC (rev 19791)
@@ -28,8 +28,8 @@
import org.hibernate.Transaction;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
-import org.hibernate.junit.DialectChecks;
-import org.hibernate.junit.RequiresDialectFeature;
+import org.hibernate.testing.junit.DialectChecks;
+import org.hibernate.testing.junit.RequiresDialectFeature;
import org.hibernate.mapping.Column;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.test.annotations.id.sequences.entities.Ball;
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/idclass/xml/IdClassXmlTest.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/idclass/xml/IdClassXmlTest.java 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/idclass/xml/IdClassXmlTest.java 2010-06-23 07:27:38 UTC (rev 19791)
@@ -22,7 +22,7 @@
*/
package org.hibernate.test.annotations.idclass.xml;
-import org.hibernate.junit.FailureExpected;
+import org.hibernate.testing.junit.FailureExpected;
import org.hibernate.test.annotations.TestCase;
/**
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java 2010-06-23 07:27:38 UTC (rev 19791)
@@ -12,7 +12,7 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.HSQLDialect;
-import org.hibernate.junit.RequiresDialect;
+import org.hibernate.testing.junit.RequiresDialect;
import org.hibernate.mapping.Collection;
import org.hibernate.mapping.Column;
import org.hibernate.test.annotations.TestCase;
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/lob/ImageTest.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/lob/ImageTest.java 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/lob/ImageTest.java 2010-06-23 07:27:38 UTC (rev 19791)
@@ -32,7 +32,7 @@
import org.hibernate.dialect.Sybase11Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.dialect.SybaseDialect;
-import org.hibernate.junit.RequiresDialect;
+import org.hibernate.testing.junit.RequiresDialect;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.util.ArrayHelper;
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/lob/LobTest.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/lob/LobTest.java 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/lob/LobTest.java 2010-06-23 07:27:38 UTC (rev 19791)
@@ -26,8 +26,8 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.junit.DialectChecks;
-import org.hibernate.junit.RequiresDialectFeature;
+import org.hibernate.testing.junit.DialectChecks;
+import org.hibernate.testing.junit.RequiresDialectFeature;
import org.hibernate.test.annotations.TestCase;
/**
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/lob/TextTest.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/lob/TextTest.java 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/lob/TextTest.java 2010-06-23 07:27:38 UTC (rev 19791)
@@ -32,7 +32,7 @@
import org.hibernate.dialect.Sybase11Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.dialect.SybaseDialect;
-import org.hibernate.junit.RequiresDialect;
+import org.hibernate.testing.junit.RequiresDialect;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.util.ArrayHelper;
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java 2010-06-23 07:27:38 UTC (rev 19791)
@@ -27,8 +27,8 @@
import java.math.BigDecimal;
import org.hibernate.Session;
-import org.hibernate.junit.DialectChecks;
-import org.hibernate.junit.RequiresDialectFeature;
+import org.hibernate.testing.junit.DialectChecks;
+import org.hibernate.testing.junit.RequiresDialectFeature;
import org.hibernate.test.annotations.TestCase;
/**
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/onetomany/OneToManyTest.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/onetomany/OneToManyTest.java 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/onetomany/OneToManyTest.java 2010-06-23 07:27:38 UTC (rev 19791)
@@ -13,7 +13,7 @@
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.junit.FailureExpected;
+import org.hibernate.testing.junit.FailureExpected;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Table;
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java 2010-06-23 07:26:36 UTC (rev 19790)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java 2010-06-23 07:27:38 UTC (rev 19791)
@@ -2,8 +2,8 @@
package org.hibernate.test.annotations.xml.hbm;
import org.hibernate.Session;
-import org.hibernate.junit.DialectChecks;
-import org.hibernate.junit.RequiresDialectFeature;
+import org.hibernate.testing.junit.DialectChecks;
+import org.hibernate.testing.junit.RequiresDialectFeature;
import org.hibernate.test.annotations.TestCase;
/**
13 years, 10 months
Hibernate SVN: r19790 - core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/manytoonewithformula.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-23 03:26:36 -0400 (Wed, 23 Jun 2010)
New Revision: 19790
Modified:
core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/manytoonewithformula/ManyToOneWithFormulaTest.java
Log:
converted hibernate-core and hibernate-annotations to use intgTest stuff
Modified: core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/manytoonewithformula/ManyToOneWithFormulaTest.java
===================================================================
--- core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/manytoonewithformula/ManyToOneWithFormulaTest.java 2010-06-23 07:23:39 UTC (rev 19789)
+++ core/branches/gradle2/hibernate-annotations/src/intgTest/java/org/hibernate/test/annotations/manytoonewithformula/ManyToOneWithFormulaTest.java 2010-06-23 07:26:36 UTC (rev 19790)
@@ -29,7 +29,7 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.HSQLDialect;
-import org.hibernate.junit.SkipForDialect;
+import org.hibernate.testing.junit.SkipForDialect;
import org.hibernate.test.annotations.TestCase;
/**
13 years, 10 months