Skip to content

Commit 31aeb16

Browse files
committed
Merge branch 'pending-annotation' of git://github.com/agattiker/cucumber-jvm into agattiker-pending-annotation
2 parents c186688 + 0cc159c commit 31aeb16

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package cucumber.runtime;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
@Retention(RetentionPolicy.RUNTIME)
9+
@Target(ElementType.TYPE)
10+
public @interface Pending {
11+
}

core/src/main/java/cucumber/runtime/PendingException.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cucumber.runtime;
22

33
// We're deliberately not extending CucumberException (which is used to signal fatal errors)
4+
@Pending
45
public class PendingException extends RuntimeException {
56
public PendingException() {
67
this("TODO: implement me");

core/src/main/java/cucumber/runtime/Runtime.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
public class Runtime implements UnreportedStepExecutor {
3232

3333
private static final String[] PENDING_EXCEPTIONS = new String[]{
34-
PendingException.class.getName(),
3534
"org.junit.internal.AssumptionViolatedException"
3635
};
3736

@@ -280,6 +279,9 @@ public void runStep(String uri, Step step, Reporter reporter, I18n i18n) {
280279
}
281280

282281
private static boolean isPending(Throwable t) {
282+
if (t.getClass().isAnnotationPresent(Pending.class)) {
283+
return true;
284+
}
283285
return Arrays.binarySearch(PENDING_EXCEPTIONS, t.getClass().getName()) >= 0;
284286
}
285287

0 commit comments

Comments
 (0)