From 412f74f679862cd2acc2f1794adcfee2c08b0d3f Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 25 Nov 2013 20:17:14 -0500 Subject: [PATCH] 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 --- .../test/annotation/Rollback.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/spring-test/src/main/java/org/springframework/test/annotation/Rollback.java b/spring-test/src/main/java/org/springframework/test/annotation/Rollback.java index bb0bc88cd5..85333dcb61 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/Rollback.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/Rollback.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,23 +17,24 @@ package org.springframework.test.annotation; import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + /** - * Test annotation to indicate whether or not the transaction for the annotated - * test method should be rolled back after the test method has - * completed. If {@code true}, the transaction will be rolled back; + * Test annotation used to indicate whether or not the transaction for the + * annotated test method should be rolled back after the test method + * has completed. If {@code true}, the transaction will be rolled back; * otherwise, the transaction will be committed. * * @author Sam Brannen * @since 2.5 */ @Documented -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.METHOD) +@Retention(RUNTIME) +@Target({ METHOD, ANNOTATION_TYPE }) public @interface Rollback { /**