提交 9eb19ac8 编写于 作者: S Sam Brannen

Polishing test annotation declarations and JavaDoc.

上级 a1b3b875
...@@ -53,9 +53,9 @@ import java.lang.annotation.Target; ...@@ -53,9 +53,9 @@ import java.lang.annotation.Target;
* @author Rod Johnson * @author Rod Johnson
* @since 2.0 * @since 2.0
*/ */
@Target( { ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME)
@Target( { ElementType.TYPE, ElementType.METHOD })
public @interface DirtiesContext { public @interface DirtiesContext {
/** /**
......
/* /*
* Copyright 2002-2007 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -25,14 +25,14 @@ import java.lang.annotation.Target; ...@@ -25,14 +25,14 @@ import java.lang.annotation.Target;
/** /**
* Test annotation to indicate that a test method is required to throw the * Test annotation to indicate that a test method is required to throw the
* specified exception. * specified exception.
* *
* @author Rod Johnson * @author Rod Johnson
* @author Sam Brannen * @author Sam Brannen
* @since 2.0 * @since 2.0
*/ */
@Target( { ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ExpectedException { public @interface ExpectedException {
Class<? extends Throwable> value(); Class<? extends Throwable> value();
......
...@@ -72,10 +72,10 @@ import java.lang.annotation.Target; ...@@ -72,10 +72,10 @@ import java.lang.annotation.Target;
* @see org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests * @see org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
* @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner * @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner
*/ */
@Target( { ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented @Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target( { ElementType.TYPE, ElementType.METHOD })
public @interface IfProfileValue { public @interface IfProfileValue {
/** /**
......
...@@ -24,14 +24,13 @@ import java.lang.annotation.Target; ...@@ -24,14 +24,13 @@ import java.lang.annotation.Target;
/** /**
* Test annotation to indicate that a method is not transactional. * Test annotation to indicate that a method is not transactional.
* *
* @author Rod Johnson * @author Rod Johnson
* @author Sam Brannen * @author Sam Brannen
* @since 2.0 * @since 2.0
*/ */
@Target( { ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface NotTransactional { public @interface NotTransactional {
} }
/* /*
* Copyright 2002-2007 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -27,20 +27,20 @@ import java.lang.annotation.Target; ...@@ -27,20 +27,20 @@ import java.lang.annotation.Target;
* <p> * <p>
* ProfileValueSourceConfiguration is a class-level annotation which is used to * ProfileValueSourceConfiguration is a class-level annotation which is used to
* specify what type of {@link ProfileValueSource} to use when retrieving * specify what type of {@link ProfileValueSource} to use when retrieving
* <em>profile values</em> configured via the * <em>profile values</em> configured via the {@link IfProfileValue
* {@link IfProfileValue @IfProfileValue} annotation. * &#064;IfProfileValue} annotation.
* </p> * </p>
* *
* @author Sam Brannen * @author Sam Brannen
* @since 2.5 * @since 2.5
* @see ProfileValueSource * @see ProfileValueSource
* @see IfProfileValue * @see IfProfileValue
* @see ProfileValueUtils * @see ProfileValueUtils
*/ */
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Inherited
@Documented
public @interface ProfileValueSourceConfiguration { public @interface ProfileValueSourceConfiguration {
/** /**
...@@ -48,7 +48,7 @@ public @interface ProfileValueSourceConfiguration { ...@@ -48,7 +48,7 @@ public @interface ProfileValueSourceConfiguration {
* The type of {@link ProfileValueSource} to use when retrieving * The type of {@link ProfileValueSource} to use when retrieving
* <em>profile values</em>. * <em>profile values</em>.
* </p> * </p>
* *
* @see SystemProfileValueSource * @see SystemProfileValueSource
*/ */
Class<? extends ProfileValueSource> value() default SystemProfileValueSource.class; Class<? extends ProfileValueSource> value() default SystemProfileValueSource.class;
......
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -26,16 +26,16 @@ import java.lang.annotation.Target; ...@@ -26,16 +26,16 @@ import java.lang.annotation.Target;
* Test annotation to indicate that a test method should be invoked repeatedly. * Test annotation to indicate that a test method should be invoked repeatedly.
* <p /> * <p />
* Note that the scope of execution to be repeated includes execution of the * Note that the scope of execution to be repeated includes execution of the
* test method itself as well as any <em>set up</em> or <em>tear down</em> * test method itself as well as any <em>set up</em> or <em>tear down</em> of
* of the test fixture. * the test fixture.
* *
* @author Rod Johnson * @author Rod Johnson
* @author Sam Brannen * @author Sam Brannen
* @since 2.0 * @since 2.0
*/ */
@Target( { ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Repeat { public @interface Repeat {
int value() default 1; int value() default 1;
......
...@@ -27,13 +27,13 @@ import java.lang.annotation.Target; ...@@ -27,13 +27,13 @@ import java.lang.annotation.Target;
* test method should be <em>rolled back</em> after the test method has * test method should be <em>rolled back</em> after the test method has
* completed. If <code>true</code>, the transaction will be rolled back; * completed. If <code>true</code>, the transaction will be rolled back;
* otherwise, the transaction will be committed. * otherwise, the transaction will be committed.
* *
* @author Sam Brannen * @author Sam Brannen
* @since 2.5 * @since 2.5
*/ */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Rollback { public @interface Rollback {
/** /**
......
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -36,16 +36,16 @@ import java.lang.annotation.Target; ...@@ -36,16 +36,16 @@ import java.lang.annotation.Target;
* {@link Repeat repetitions} of the test, and any <em>set up</em> or * {@link Repeat repetitions} of the test, and any <em>set up</em> or
* <em>tear down</em> of the test fixture. * <em>tear down</em> of the test fixture.
* </p> * </p>
* *
* @author Rod Johnson * @author Rod Johnson
* @author Sam Brannen * @author Sam Brannen
* @since 2.0 * @since 2.0
* @see Repeat * @see Repeat
* @see AbstractAnnotationAwareTransactionalTests * @see AbstractAnnotationAwareTransactionalTests
*/ */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Timed { public @interface Timed {
/** /**
......
...@@ -27,16 +27,16 @@ import java.lang.annotation.Target; ...@@ -27,16 +27,16 @@ import java.lang.annotation.Target;
* ContextConfiguration defines class-level metadata which can be used to * ContextConfiguration defines class-level metadata which can be used to
* instruct client code with regard to how to load and configure an * instruct client code with regard to how to load and configure an
* {@link org.springframework.context.ApplicationContext ApplicationContext}. * {@link org.springframework.context.ApplicationContext ApplicationContext}.
* *
* @author Sam Brannen * @author Sam Brannen
* @since 2.5 * @since 2.5
* @see ContextLoader * @see ContextLoader
* @see org.springframework.context.ApplicationContext * @see org.springframework.context.ApplicationContext
*/ */
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Inherited
@Documented
public @interface ContextConfiguration { public @interface ContextConfiguration {
/** /**
...@@ -62,7 +62,7 @@ public @interface ContextConfiguration { ...@@ -62,7 +62,7 @@ public @interface ContextConfiguration {
* defined by an annotated superclass. Thus, subclasses have the option of * defined by an annotated superclass. Thus, subclasses have the option of
* <em>extending</em> the list of resource locations. In the following * <em>extending</em> the list of resource locations. In the following
* example, the {@link org.springframework.context.ApplicationContext ApplicationContext} * example, the {@link org.springframework.context.ApplicationContext ApplicationContext}
* for <code>ExtendedTest</code> will be loaded from * for <code>ExtendedTest</code> will be loaded from
* &quot;base-context.xml&quot; <strong>and</strong> * &quot;base-context.xml&quot; <strong>and</strong>
* &quot;extended-context.xml&quot;, in that order. Beans defined in * &quot;extended-context.xml&quot;, in that order. Beans defined in
* &quot;extended-context.xml&quot; may therefore override those defined in * &quot;extended-context.xml&quot; may therefore override those defined in
...@@ -70,12 +70,12 @@ public @interface ContextConfiguration { ...@@ -70,12 +70,12 @@ public @interface ContextConfiguration {
* <pre class="code"> * <pre class="code">
* &#064;ContextConfiguration(&quot;base-context.xml&quot;) * &#064;ContextConfiguration(&quot;base-context.xml&quot;)
* public class BaseTest { * public class BaseTest {
* // ... * // ...
* } * }
* *
* &#064;ContextConfiguration(&quot;extended-context.xml&quot;) * &#064;ContextConfiguration(&quot;extended-context.xml&quot;)
* public class ExtendedTest extends BaseTest { * public class ExtendedTest extends BaseTest {
* // ... * // ...
* } * }
* </pre> * </pre>
* If <code>inheritLocations</code> is set to <code>false</code>, the * If <code>inheritLocations</code> is set to <code>false</code>, the
...@@ -89,8 +89,8 @@ public @interface ContextConfiguration { ...@@ -89,8 +89,8 @@ public @interface ContextConfiguration {
* {@link org.springframework.context.ApplicationContext ApplicationContext}. * {@link org.springframework.context.ApplicationContext ApplicationContext}.
* <p>If not specified, the loader will be inherited from the first superclass * <p>If not specified, the loader will be inherited from the first superclass
* which is annotated with <code>&#064;ContextConfiguration</code> and specifies * which is annotated with <code>&#064;ContextConfiguration</code> and specifies
* an explicit loader. If no class in the hierarchy specifies an explicit * an explicit loader. If no class in the hierarchy specifies an explicit
* loader, a default loader will be used instead. * loader, a default loader will be used instead.
*/ */
Class<? extends ContextLoader> loader() default ContextLoader.class; Class<? extends ContextLoader> loader() default ContextLoader.class;
......
...@@ -29,17 +29,17 @@ import java.lang.annotation.Target; ...@@ -29,17 +29,17 @@ import java.lang.annotation.Target;
* be registered with a {@link TestContextManager}. Typically, * be registered with a {@link TestContextManager}. Typically,
* <code>&#064;TestExecutionListeners</code> will be used in conjunction with * <code>&#064;TestExecutionListeners</code> will be used in conjunction with
* {@link ContextConfiguration &#064;ContextConfiguration}. * {@link ContextConfiguration &#064;ContextConfiguration}.
* *
* @author Sam Brannen * @author Sam Brannen
* @since 2.5 * @since 2.5
* @see TestExecutionListener * @see TestExecutionListener
* @see TestContextManager * @see TestContextManager
* @see ContextConfiguration * @see ContextConfiguration
*/ */
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Inherited
@Documented
public @interface TestExecutionListeners { public @interface TestExecutionListeners {
/** /**
...@@ -47,7 +47,7 @@ public @interface TestExecutionListeners { ...@@ -47,7 +47,7 @@ public @interface TestExecutionListeners {
* The {@link TestExecutionListener TestExecutionListeners} to register with * The {@link TestExecutionListener TestExecutionListeners} to register with
* a {@link TestContextManager}. * a {@link TestContextManager}.
* </p> * </p>
* *
* @see org.springframework.test.context.support.DependencyInjectionTestExecutionListener * @see org.springframework.test.context.support.DependencyInjectionTestExecutionListener
* @see org.springframework.test.context.support.DirtiesContextTestExecutionListener * @see org.springframework.test.context.support.DirtiesContextTestExecutionListener
* @see org.springframework.test.context.transaction.TransactionalTestExecutionListener * @see org.springframework.test.context.transaction.TransactionalTestExecutionListener
...@@ -73,20 +73,20 @@ public @interface TestExecutionListeners { ...@@ -73,20 +73,20 @@ public @interface TestExecutionListeners {
* <code>DirtiesContextTestExecutionListener</code>, <strong>and</strong> * <code>DirtiesContextTestExecutionListener</code>, <strong>and</strong>
* <code>TransactionalTestExecutionListener</code>, in that order. * <code>TransactionalTestExecutionListener</code>, in that order.
* </p> * </p>
* *
* <pre class="code"> * <pre class="code">
* &#064;TestExecutionListeners({ DependencyInjectionTestExecutionListener.class, * &#064;TestExecutionListeners({ DependencyInjectionTestExecutionListener.class,
* DirtiesContextTestExecutionListener.class }) * DirtiesContextTestExecutionListener.class })
* public abstract class AbstractBaseTest { * public abstract class AbstractBaseTest {
* // ... * // ...
* } * }
* *
* &#064;TestExecutionListeners(TransactionalTestExecutionListener.class) * &#064;TestExecutionListeners(TransactionalTestExecutionListener.class)
* public class TransactionalTest extends AbstractBaseTest { * public class TransactionalTest extends AbstractBaseTest {
* // ... * // ...
* } * }
* </pre> * </pre>
* *
* <p> * <p>
* If <code>inheritListeners</code> is set to <code>false</code>, the * If <code>inheritListeners</code> is set to <code>false</code>, the
* listeners for the annotated class will <em>shadow</em> and effectively * listeners for the annotated class will <em>shadow</em> and effectively
......
/* /*
* Copyright 2002-2007 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -33,14 +33,13 @@ import java.lang.annotation.Target; ...@@ -33,14 +33,13 @@ import java.lang.annotation.Target;
* The <code>&#064;AfterTransaction</code> methods of superclasses will be * The <code>&#064;AfterTransaction</code> methods of superclasses will be
* executed after those of the current class. * executed after those of the current class.
* </p> * </p>
* *
* @author Sam Brannen * @author Sam Brannen
* @since 2.5 * @since 2.5
* @see org.springframework.transaction.annotation.Transactional * @see org.springframework.transaction.annotation.Transactional
*/ */
@Target( { ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface AfterTransaction { public @interface AfterTransaction {
} }
/* /*
* Copyright 2002-2007 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -33,14 +33,13 @@ import java.lang.annotation.Target; ...@@ -33,14 +33,13 @@ import java.lang.annotation.Target;
* The <code>&#064;BeforeTransaction</code> methods of superclasses will be * The <code>&#064;BeforeTransaction</code> methods of superclasses will be
* executed before those of the current class. * executed before those of the current class.
* </p> * </p>
* *
* @author Sam Brannen * @author Sam Brannen
* @since 2.5 * @since 2.5
* @see org.springframework.transaction.annotation.Transactional * @see org.springframework.transaction.annotation.Transactional
*/ */
@Target( { ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface BeforeTransaction { public @interface BeforeTransaction {
} }
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -29,16 +29,16 @@ import org.springframework.transaction.PlatformTransactionManager; ...@@ -29,16 +29,16 @@ import org.springframework.transaction.PlatformTransactionManager;
/** /**
* TransactionConfiguration defines class-level metadata for configuring * TransactionConfiguration defines class-level metadata for configuring
* transactional tests. * transactional tests.
* *
* @author Sam Brannen * @author Sam Brannen
* @since 2.5 * @since 2.5
* @see ContextConfiguration * @see ContextConfiguration
* @see TransactionalTestExecutionListener * @see TransactionalTestExecutionListener
*/ */
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Inherited
@Documented
public @interface TransactionConfiguration { public @interface TransactionConfiguration {
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册