Author: hardy.ferentschik
Date: 2010-05-28 10:21:57 -0400 (Fri, 28 May 2010)
New Revision: 19627
Modified:
core/trunk/testing/src/main/java/org/hibernate/junit/RequiresDialect.java
core/trunk/testing/src/main/java/org/hibernate/junit/RequiresDialectFeature.java
core/trunk/testing/src/main/java/org/hibernate/test/annotations/HibernateTestCase.java
Log:
HHH-5204 Aligned the properties of SkipForDialect, RequiresDialect and
RequiresDialectFeature
Modified: core/trunk/testing/src/main/java/org/hibernate/junit/RequiresDialect.java
===================================================================
--- core/trunk/testing/src/main/java/org/hibernate/junit/RequiresDialect.java 2010-05-27
18:44:57 UTC (rev 19626)
+++ core/trunk/testing/src/main/java/org/hibernate/junit/RequiresDialect.java 2010-05-28
14:21:57 UTC (rev 19627)
@@ -33,14 +33,15 @@
/**
* Annotation used to indicate that a test should be run only when run against the
* indicated dialects.
- *
+ *
* @author Hardy Ferentschik
*/
-(a)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<? extends Dialect>[] value();
@@ -48,7 +49,22 @@
/**
* 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 "";
}
Modified:
core/trunk/testing/src/main/java/org/hibernate/junit/RequiresDialectFeature.java
===================================================================
---
core/trunk/testing/src/main/java/org/hibernate/junit/RequiresDialectFeature.java 2010-05-27
18:44:57 UTC (rev 19626)
+++
core/trunk/testing/src/main/java/org/hibernate/junit/RequiresDialectFeature.java 2010-05-28
14:21:57 UTC (rev 19627)
@@ -42,4 +42,18 @@
* @return The name of the dialect feature.
*/
Class<? extends DialectChecks> 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
Modified:
core/trunk/testing/src/main/java/org/hibernate/test/annotations/HibernateTestCase.java
===================================================================
---
core/trunk/testing/src/main/java/org/hibernate/test/annotations/HibernateTestCase.java 2010-05-27
18:44:57 UTC (rev 19626)
+++
core/trunk/testing/src/main/java/org/hibernate/test/annotations/HibernateTestCase.java 2010-05-28
14:21:57 UTC (rev 19627)
@@ -184,7 +184,7 @@
}
else {
if ( !dialectClass.isInstance( dialect ) ) {
- return buildSkip( dialect, null, null );
+ return buildSkip( dialect, requiresDialectAnn.comment(),
requiresDialectAnn.jiraKey() );
}
}
}
@@ -197,7 +197,7 @@
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;
Show replies by date