Skip to content

Commit 412f74f

Browse files
committed
Provide meta-annotation support for @Rollback
@Rollback now supports ANNOTATION_TYPE as a target, allowing it to be used as meta-annotation. Note: this change was accidentally omitted from the original commit for SPR-7827. Issue: SPR-7827
1 parent 1e6f2e7 commit 412f74f

File tree

1 file changed

+9
-8
lines changed
  • spring-test/src/main/java/org/springframework/test/annotation

1 file changed

+9
-8
lines changed

spring-test/src/main/java/org/springframework/test/annotation/Rollback.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,23 +17,24 @@
1717
package org.springframework.test.annotation;
1818

1919
import java.lang.annotation.Documented;
20-
import java.lang.annotation.ElementType;
2120
import java.lang.annotation.Retention;
22-
import java.lang.annotation.RetentionPolicy;
2321
import java.lang.annotation.Target;
2422

23+
import static java.lang.annotation.ElementType.*;
24+
import static java.lang.annotation.RetentionPolicy.*;
25+
2526
/**
26-
* Test annotation to indicate whether or not the transaction for the annotated
27-
* test method should be <em>rolled back</em> after the test method has
28-
* completed. If {@code true}, the transaction will be rolled back;
27+
* Test annotation used to indicate whether or not the transaction for the
28+
* annotated test method should be <em>rolled back</em> after the test method
29+
* has completed. If {@code true}, the transaction will be rolled back;
2930
* otherwise, the transaction will be committed.
3031
*
3132
* @author Sam Brannen
3233
* @since 2.5
3334
*/
3435
@Documented
35-
@Retention(RetentionPolicy.RUNTIME)
36-
@Target(ElementType.METHOD)
36+
@Retention(RUNTIME)
37+
@Target({ METHOD, ANNOTATION_TYPE })
3738
public @interface Rollback {
3839

3940
/**

0 commit comments

Comments
 (0)