use of org.hibernate.testing.Skip in project hibernate-orm by hibernate.
the class CustomRunner method convertSkipToIgnore.
protected Ignore convertSkipToIgnore(FrameworkMethod frameworkMethod) {
// @Skip
Skip skip = Helper.locateAnnotation(Skip.class, frameworkMethod, getTestClass());
if (skip != null) {
if (isMatch(skip.condition())) {
return buildIgnore(skip);
}
}
// @SkipForDialects & @SkipForDialect
for (SkipForDialect skipForDialectAnn : Helper.collectAnnotations(SkipForDialect.class, SkipForDialects.class, frameworkMethod, getTestClass())) {
for (Class<? extends Dialect> dialectClass : skipForDialectAnn.value()) {
if (skipForDialectAnn.strictMatching()) {
if (dialectClass.equals(dialect.getClass())) {
return buildIgnore(skipForDialectAnn);
}
} else {
if (dialectClass.isInstance(dialect)) {
return buildIgnore(skipForDialectAnn);
}
}
}
}
// @RequiresDialects & @RequiresDialect
final List<RequiresDialect> requiresDialects = Helper.collectAnnotations(RequiresDialect.class, RequiresDialects.class, frameworkMethod, getTestClass());
if (!requiresDialects.isEmpty() && !isDialectMatchingRequired(requiresDialects)) {
return buildIgnore(requiresDialects);
}
// @RequiresDialectFeature
RequiresDialectFeature requiresDialectFeatureAnn = Helper.locateAnnotation(RequiresDialectFeature.class, frameworkMethod, getTestClass());
if (requiresDialectFeatureAnn != null) {
try {
for (Class<? extends DialectCheck> checkClass : requiresDialectFeatureAnn.value()) {
if (!checkClass.newInstance().isMatch(dialect)) {
return buildIgnore(requiresDialectFeatureAnn);
}
}
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException("Unable to instantiate DialectCheck", e);
}
}
return null;
}
use of org.hibernate.testing.Skip in project hibernate-orm by hibernate.
the class QuotedTableNameSchemaUpdateTest method testSchemaUpdateWithQuotedTableName.
@Test
@TestForIssue(jiraKey = "HHH-10820")
@Skip(condition = Skip.OperatingSystem.Windows.class, message = "On Windows, MySQL is case insensitive!")
public void testSchemaUpdateWithQuotedTableName() throws Exception {
final MetadataSources metadataSources = new MetadataSources(ssr);
metadataSources.addAnnotatedClass(QuotedTable.class);
MetadataImplementor metadata = (MetadataImplementor) metadataSources.buildMetadata();
metadata.validate();
new SchemaExport().setOutputFile(output.getAbsolutePath()).setFormat(false).create(EnumSet.of(TargetType.DATABASE), metadata);
new SchemaUpdate().setHaltOnError(true).setOutputFile(output.getAbsolutePath()).setFormat(false).execute(EnumSet.of(TargetType.DATABASE, TargetType.SCRIPT), metadata);
final List<String> sqlLines = Files.readAllLines(output.toPath(), Charset.defaultCharset());
assertThat("The update should recognize the existing table", sqlLines.isEmpty(), is(true));
new SchemaExport().setHaltOnError(true).setOutputFile(output.getAbsolutePath()).setFormat(false).drop(EnumSet.of(TargetType.DATABASE), metadata);
}
Aggregations