Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for multiple class name patterns to JUnitPlatform runner
Issue: #474
- Loading branch information
1 parent
71e32ac
commit eb2be7a
Showing
10 changed files
with
178 additions
and
21 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
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
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
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
53 changes: 53 additions & 0 deletions
53
junit-platform-runner/src/main/java/org/junit/platform/runner/IncludeClassNamePatterns.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,53 @@ | |||
/* | |||
* Copyright 2015-2016 the original author or authors. | |||
* | |||
* All rights reserved. This program and the accompanying materials are | |||
* made available under the terms of the Eclipse Public License v1.0 which | |||
* accompanies this distribution and is available at | |||
* | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
*/ | |||
|
|||
package org.junit.platform.runner; | |||
|
|||
import static org.junit.platform.commons.meta.API.Usage.Maintained; | |||
|
|||
import java.lang.annotation.Documented; | |||
import java.lang.annotation.ElementType; | |||
import java.lang.annotation.Inherited; | |||
import java.lang.annotation.Retention; | |||
import java.lang.annotation.RetentionPolicy; | |||
import java.lang.annotation.Target; | |||
|
|||
import org.junit.platform.commons.meta.API; | |||
import org.junit.platform.engine.discovery.ClassNameFilter; | |||
|
|||
/** | |||
* {@code @IncludeClassNamePatterns} specifies regular expressions that are used | |||
* to match against fully qualified class names when running a test suite via | |||
* {@code @RunWith(JUnitPlatform.class)}. | |||
* | |||
* <p>The patterns are combined using OR semantics, i.e. if the fully | |||
* qualified name of a class matches against at least one of the patterns, | |||
* the class will be included in the test plan. | |||
* | |||
* @since 1.0 | |||
* @see JUnitPlatform | |||
* @see ClassNameFilter#includeClassNamePatterns | |||
*/ | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@Target(ElementType.TYPE) | |||
@Inherited | |||
@Documented | |||
@API(Maintained) | |||
public @interface IncludeClassNamePatterns { | |||
|
|||
/** | |||
* Regular expression used to match against fully qualified class names. | |||
* | |||
* <p>Defaults to {@code "^.*Tests?$"} which matches against class names | |||
* ending in {@code Test} or {@code Tests} (in any package). | |||
*/ | |||
String[] value() default { ClassNameFilter.STANDARD_INCLUDE_PATTERN }; | |||
|
|||
} |
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
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
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
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
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