CustomRunner does not work with RequiresDialects

Description

When searching for RequiresDialect, CustomRunner uses a nested-loop and upon a match, it breaks from the innermost loop only.

So if I declare a test like this:

1 2 3 4 @RequiresDialects({ @RequiresDialect(PostgreSQL81Dialect.class), @RequiresDialect(Oracle8iDialect.class) })

The CustomRunner will do this:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 for ( RequiresDialect requiresDialectAnn : Helper.collectAnnotations( RequiresDialect.class, RequiresDialects.class, frameworkMethod, getTestClass() ) ) { boolean foundMatch = false; for ( Class<? extends Dialect> dialectClass : requiresDialectAnn.value() ) { foundMatch = requiresDialectAnn.strictMatching() ? dialectClass.equals( dialect.getClass() ) : dialectClass.isInstance( dialect ); if ( foundMatch ) { break; } } if ( !foundMatch ) { return buildIgnore( requiresDialectAnn ); } }

When using multiple RequiresDialect(s) provided via a @RequiresDialects, the current logic acts like an AND operand, not as an OR. Unfortunately, a test can only use a single Dialect at runtime, so the AND logic does not make sense.

On the other hand, this works:

1 @RequiresDialect({ Oracle8iDialect.class, PostgreSQL81Dialect.class} )

Environment

None

Status

Assignee

Unassigned

Reporter

Vlad Mihalcea

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major