HV-361 Changing existing tests to use @RequiresDialect(DialectChecks.SupportColumnCheck)
This commit is contained in:
parent
d24a06ee8d
commit
c22a6be533
|
@ -33,11 +33,15 @@ import org.hibernate.cfg.Configuration;
|
|||
import org.hibernate.mapping.Column;
|
||||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.test.annotations.TestCase;
|
||||
import org.hibernate.testing.junit.DialectChecks;
|
||||
import org.hibernate.testing.junit.RequiresDialectFeature;
|
||||
|
||||
/**
|
||||
* @author Vladimir Klyushnikov
|
||||
*/
|
||||
public class DDLWithoutCallbackTest extends TestCase {
|
||||
@RequiresDialectFeature(value = DialectChecks.SupportsColumnCheck.class,
|
||||
comment = "Not all databases support column checks")
|
||||
public void testListeners() {
|
||||
CupHolder ch = new CupHolder();
|
||||
ch.setRadius( new BigDecimal( "12" ) );
|
||||
|
@ -46,10 +50,8 @@ public class DDLWithoutCallbackTest extends TestCase {
|
|||
try {
|
||||
s.persist( ch );
|
||||
s.flush();
|
||||
if ( getDialect().supportsColumnCheck() ) {
|
||||
fail( "expecting SQL constraint violation" );
|
||||
}
|
||||
}
|
||||
catch ( ConstraintViolationException e ) {
|
||||
fail( "invalid object should not be validated" );
|
||||
}
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// $Id$
|
||||
|
||||
package org.hibernate.testing.junit;
|
||||
|
||||
import org.hibernate.dialect.Dialect;
|
||||
|
@ -55,7 +53,11 @@ abstract public class DialectChecks {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public static class SupportsColumnCheck extends DialectChecks {
|
||||
public boolean include(Dialect dialect) {
|
||||
return dialect.supportsColumnCheck();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation used to indicate that a test should be run only when the current dialect suppports the
|
||||
* Annotation used to indicate that a test should be run only when the current dialect supports the
|
||||
* specified feature.
|
||||
*
|
||||
* @author Hardy Ferentschik
|
||||
|
|
Loading…
Reference in New Issue