From 087f2b567ac1845bf1bd52973472e408104f12bb Mon Sep 17 00:00:00 2001 From: Hardy Ferentschik Date: Fri, 28 May 2010 14:21:57 +0000 Subject: [PATCH] HHH-5204 Aligned the properties of SkipForDialect, RequiresDialect and RequiresDialectFeature git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@19627 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../org/hibernate/junit/RequiresDialect.java | 20 +++++++++++++++++-- .../junit/RequiresDialectFeature.java | 14 +++++++++++++ .../test/annotations/HibernateTestCase.java | 4 ++-- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/testing/src/main/java/org/hibernate/junit/RequiresDialect.java b/testing/src/main/java/org/hibernate/junit/RequiresDialect.java index d0ecb3cd20..a9a2c5f97c 100644 --- a/testing/src/main/java/org/hibernate/junit/RequiresDialect.java +++ b/testing/src/main/java/org/hibernate/junit/RequiresDialect.java @@ -33,14 +33,15 @@ import org.hibernate.dialect.Dialect; /** * Annotation used to indicate that a test should be run only when run against the * indicated dialects. - * + * * @author Hardy Ferentschik */ -@Target({ElementType.METHOD, ElementType.TYPE}) +@Target({ ElementType.METHOD, ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) public @interface RequiresDialect { /** * The dialects against which to run the test + * * @return The dialects */ Class[] value(); @@ -48,7 +49,22 @@ public @interface RequiresDialect { /** * Used to indicate if the dialects should be matched strictly (classes equal) or * non-strictly (instanceof). + * * @return Should strict matching be used? */ boolean strictMatching() default false; + + /** + * Comment describing the reason why the dialect is required. + * + * @return The comment + */ + String comment() default ""; + + /** + * The key of a JIRA issue which relates this this restriction + * + * @return The jira issue key + */ + String jiraKey() default ""; } diff --git a/testing/src/main/java/org/hibernate/junit/RequiresDialectFeature.java b/testing/src/main/java/org/hibernate/junit/RequiresDialectFeature.java index 17c99dd820..f8af03b396 100644 --- a/testing/src/main/java/org/hibernate/junit/RequiresDialectFeature.java +++ b/testing/src/main/java/org/hibernate/junit/RequiresDialectFeature.java @@ -42,4 +42,18 @@ public @interface RequiresDialectFeature { * @return The name of the dialect feature. */ Class value(); + + /** + * Comment describing the reason why the feature is required. + * + * @return The comment + */ + String comment() default ""; + + /** + * The key of a JIRA issue which relates this this feature requirement. + * + * @return The jira issue key + */ + String jiraKey() default ""; } \ No newline at end of file diff --git a/testing/src/main/java/org/hibernate/test/annotations/HibernateTestCase.java b/testing/src/main/java/org/hibernate/test/annotations/HibernateTestCase.java index 7f868b7ae5..68c25425b5 100644 --- a/testing/src/main/java/org/hibernate/test/annotations/HibernateTestCase.java +++ b/testing/src/main/java/org/hibernate/test/annotations/HibernateTestCase.java @@ -184,7 +184,7 @@ public abstract class HibernateTestCase extends TestCase { } else { if ( !dialectClass.isInstance( dialect ) ) { - return buildSkip( dialect, null, null ); + return buildSkip( dialect, requiresDialectAnn.comment(), requiresDialectAnn.jiraKey() ); } } } @@ -197,7 +197,7 @@ public abstract class HibernateTestCase extends TestCase { DialectChecks check = checkClass.newInstance(); boolean skip = check.include( dialect ); if ( skip ) { - return buildSkip( dialect, null, null ); + return buildSkip( dialect, requiresDialectFeatureAnn.comment(), requiresDialectFeatureAnn.jiraKey() ); } } return null;