forked from debezium/debezium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DBZ-4272 Skip connector test using annotations
- Loading branch information
1 parent
358eb03
commit 5e40e1c
Showing
3 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
debezium-core/src/test/java/io/debezium/junit/SkipWhenConnectorUnderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright Debezium Authors. | ||
* | ||
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package io.debezium.junit; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Marker annotation used together with the {@link SkipTestRule} JUnit rule, that allows tests to be skipped | ||
* based on the current connector under test | ||
* | ||
* @author Jiri Pechanec | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ ElementType.METHOD, ElementType.TYPE }) | ||
public @interface SkipWhenConnectorUnderTest { | ||
|
||
Connector value(); | ||
|
||
EqualityCheck check(); | ||
|
||
String description() default ""; | ||
|
||
public enum Connector { | ||
SQL_SERVER { | ||
|
||
@Override | ||
boolean isEqualTo(String packageName) { | ||
return packageName != null && packageName.startsWith("io.debezium.connector.sqlserver"); | ||
} | ||
}; | ||
|
||
abstract boolean isEqualTo(String packageName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters