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
This commit is contained in:
parent
9409685386
commit
087f2b567a
|
@ -36,11 +36,12 @@ import org.hibernate.dialect.Dialect;
|
||||||
*
|
*
|
||||||
* @author Hardy Ferentschik
|
* @author Hardy Ferentschik
|
||||||
*/
|
*/
|
||||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
@Target({ ElementType.METHOD, ElementType.TYPE })
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface RequiresDialect {
|
public @interface RequiresDialect {
|
||||||
/**
|
/**
|
||||||
* The dialects against which to run the test
|
* The dialects against which to run the test
|
||||||
|
*
|
||||||
* @return The dialects
|
* @return The dialects
|
||||||
*/
|
*/
|
||||||
Class<? extends Dialect>[] value();
|
Class<? extends Dialect>[] value();
|
||||||
|
@ -48,7 +49,22 @@ public @interface RequiresDialect {
|
||||||
/**
|
/**
|
||||||
* Used to indicate if the dialects should be matched strictly (classes equal) or
|
* Used to indicate if the dialects should be matched strictly (classes equal) or
|
||||||
* non-strictly (instanceof).
|
* non-strictly (instanceof).
|
||||||
|
*
|
||||||
* @return Should strict matching be used?
|
* @return Should strict matching be used?
|
||||||
*/
|
*/
|
||||||
boolean strictMatching() default false;
|
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 "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,4 +42,18 @@ public @interface RequiresDialectFeature {
|
||||||
* @return The name of the dialect feature.
|
* @return The name of the dialect feature.
|
||||||
*/
|
*/
|
||||||
Class<? extends DialectChecks> value();
|
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 "";
|
||||||
}
|
}
|
|
@ -184,7 +184,7 @@ public abstract class HibernateTestCase extends TestCase {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( !dialectClass.isInstance( dialect ) ) {
|
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();
|
DialectChecks check = checkClass.newInstance();
|
||||||
boolean skip = check.include( dialect );
|
boolean skip = check.include( dialect );
|
||||||
if ( skip ) {
|
if ( skip ) {
|
||||||
return buildSkip( dialect, null, null );
|
return buildSkip( dialect, requiresDialectFeatureAnn.comment(), requiresDialectFeatureAnn.jiraKey() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue