Skip to content

Commit

Permalink
Rename @classes to @SelectClasses
Browse files Browse the repository at this point in the history
Issue: #312
  • Loading branch information
sbrannen committed Jun 18, 2016
1 parent 3e3e762 commit 2a87be1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
Expand Up @@ -10,14 +10,14 @@


package org.junit.gen5.engine.junit4.samples.junit4; package org.junit.gen5.engine.junit4.samples.junit4;


import org.junit.gen5.junit4.runner.Classes;
import org.junit.gen5.junit4.runner.JUnitPlatform; import org.junit.gen5.junit4.runner.JUnitPlatform;
import org.junit.gen5.junit4.runner.SelectClasses;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;


/** /**
* @since 5.0 * @since 5.0
*/ */
@RunWith(JUnitPlatform.class) @RunWith(JUnitPlatform.class)
@Classes(PlainJUnit4TestCaseWithSingleTestWhichFails.class) @SelectClasses(PlainJUnit4TestCaseWithSingleTestWhichFails.class)
public class TestCaseRunWithJUnitPlatformRunner { public class TestCaseRunWithJUnitPlatformRunner {
} }
Expand Up @@ -62,7 +62,7 @@
* in order to be picked up by IDEs and build tools. * in order to be picked up by IDEs and build tools.
* *
* @since 5.0 * @since 5.0
* @see Classes * @see SelectClasses
* @see FilterClassName * @see FilterClassName
* @see SelectPackages * @see SelectPackages
* @see IncludeTags * @see IncludeTags
Expand Down Expand Up @@ -185,7 +185,7 @@ private void addExcludedEnginesFilter(TestDiscoveryRequest discoveryRequest) {
} }


private Class<?>[] getSelectedClasses() { private Class<?>[] getSelectedClasses() {
return getValueFromAnnotation(Classes.class, Classes::value, EMPTY_CLASS_ARRAY); return getValueFromAnnotation(SelectClasses.class, SelectClasses::value, EMPTY_CLASS_ARRAY);
} }


private String[] getSelectedPackageNames() { private String[] getSelectedPackageNames() {
Expand Down
Expand Up @@ -22,20 +22,22 @@
import org.junit.gen5.commons.meta.API; import org.junit.gen5.commons.meta.API;


/** /**
* {@code @Classes} specifies the test classes to be run when a class * {@code @SelectClasses} specifies the classes to <em>select</em> when running
* annotated with {@code @RunWith(JUnitPlatform.class)} is run. * a test suite via {@code @RunWith(JUnitPlatform.class)}.
* *
* @since 5.0 * @since 5.0
* @see org.junit.gen5.engine.discovery.ClassSelector
* @see SelectPackages
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Inherited @Inherited
@Documented @Documented
@API(Maintained) @API(Maintained)
public @interface Classes { public @interface SelectClasses {


/** /**
* One or more test classes. * One or more classes to select.
*/ */
Class<?>[] value(); Class<?>[] value();


Expand Down
Expand Up @@ -27,6 +27,7 @@
* *
* @since 5.0 * @since 5.0
* @see org.junit.gen5.engine.discovery.PackageSelector * @see org.junit.gen5.engine.discovery.PackageSelector
* @see SelectClasses
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
Expand Down
Expand Up @@ -89,9 +89,9 @@ class TestCase {
} }


@Test @Test
void requestsClassSelectorsWhenClassesAnnotationIsPresent() throws Exception { void requestsClassSelectorsWhenSelectClassesAnnotationIsPresent() throws Exception {


@Classes({ Short.class, Byte.class }) @SelectClasses({ Short.class, Byte.class })
class TestCase { class TestCase {
} }


Expand Down

0 comments on commit 2a87be1

Please sign in to comment.