Polishing test annotation declarations and JavaDoc.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1747 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
d3b25394b8
commit
bf095ba26b
|
|
@ -53,9 +53,9 @@ import java.lang.annotation.Target;
|
|||
* @author Rod Johnson
|
||||
* @since 2.0
|
||||
*/
|
||||
@Target( { ElementType.TYPE, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target( { ElementType.TYPE, ElementType.METHOD })
|
||||
public @interface DirtiesContext {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* 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");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -25,14 +25,14 @@ import java.lang.annotation.Target;
|
|||
/**
|
||||
* Test annotation to indicate that a test method is required to throw the
|
||||
* specified exception.
|
||||
*
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Sam Brannen
|
||||
* @since 2.0
|
||||
*/
|
||||
@Target( { ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface ExpectedException {
|
||||
|
||||
Class<? extends Throwable> value();
|
||||
|
|
|
|||
|
|
@ -72,10 +72,10 @@ import java.lang.annotation.Target;
|
|||
* @see org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
|
||||
* @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner
|
||||
*/
|
||||
@Target( { ElementType.TYPE, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
@Documented
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target( { ElementType.TYPE, ElementType.METHOD })
|
||||
public @interface IfProfileValue {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -24,14 +24,13 @@ import java.lang.annotation.Target;
|
|||
|
||||
/**
|
||||
* Test annotation to indicate that a method is not transactional.
|
||||
*
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Sam Brannen
|
||||
* @since 2.0
|
||||
*/
|
||||
@Target( { ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface NotTransactional {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* 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");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -27,20 +27,20 @@ import java.lang.annotation.Target;
|
|||
* <p>
|
||||
* ProfileValueSourceConfiguration is a class-level annotation which is used to
|
||||
* specify what type of {@link ProfileValueSource} to use when retrieving
|
||||
* <em>profile values</em> configured via the
|
||||
* {@link IfProfileValue @IfProfileValue} annotation.
|
||||
* <em>profile values</em> configured via the {@link IfProfileValue
|
||||
* @IfProfileValue} annotation.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @since 2.5
|
||||
* @see ProfileValueSource
|
||||
* @see IfProfileValue
|
||||
* @see ProfileValueUtils
|
||||
*/
|
||||
@Documented
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@Inherited
|
||||
@Documented
|
||||
public @interface ProfileValueSourceConfiguration {
|
||||
|
||||
/**
|
||||
|
|
@ -48,7 +48,7 @@ public @interface ProfileValueSourceConfiguration {
|
|||
* The type of {@link ProfileValueSource} to use when retrieving
|
||||
* <em>profile values</em>.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @see SystemProfileValueSource
|
||||
*/
|
||||
Class<? extends ProfileValueSource> value() default SystemProfileValueSource.class;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* 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");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -26,16 +26,16 @@ import java.lang.annotation.Target;
|
|||
* Test annotation to indicate that a test method should be invoked repeatedly.
|
||||
* <p />
|
||||
* 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>
|
||||
* of the test fixture.
|
||||
*
|
||||
* test method itself as well as any <em>set up</em> or <em>tear down</em> of
|
||||
* the test fixture.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Sam Brannen
|
||||
* @since 2.0
|
||||
*/
|
||||
@Target( { ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface Repeat {
|
||||
|
||||
int value() default 1;
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@ import java.lang.annotation.Target;
|
|||
* test method should be <em>rolled back</em> after the test method has
|
||||
* completed. If <code>true</code>, the transaction will be rolled back;
|
||||
* otherwise, the transaction will be committed.
|
||||
*
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @since 2.5
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface Rollback {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* 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");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -36,16 +36,16 @@ import java.lang.annotation.Target;
|
|||
* {@link Repeat repetitions} of the test, and any <em>set up</em> or
|
||||
* <em>tear down</em> of the test fixture.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Sam Brannen
|
||||
* @since 2.0
|
||||
* @see Repeat
|
||||
* @see AbstractAnnotationAwareTransactionalTests
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface Timed {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -27,16 +27,16 @@ import java.lang.annotation.Target;
|
|||
* ContextConfiguration defines class-level metadata which can be used to
|
||||
* instruct client code with regard to how to load and configure an
|
||||
* {@link org.springframework.context.ApplicationContext ApplicationContext}.
|
||||
*
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @since 2.5
|
||||
* @see ContextLoader
|
||||
* @see org.springframework.context.ApplicationContext
|
||||
*/
|
||||
@Documented
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@Inherited
|
||||
@Documented
|
||||
public @interface ContextConfiguration {
|
||||
|
||||
/**
|
||||
|
|
@ -62,7 +62,7 @@ public @interface ContextConfiguration {
|
|||
* defined by an annotated superclass. Thus, subclasses have the option of
|
||||
* <em>extending</em> the list of resource locations. In the following
|
||||
* example, the {@link org.springframework.context.ApplicationContext ApplicationContext}
|
||||
* for <code>ExtendedTest</code> will be loaded from
|
||||
* for <code>ExtendedTest</code> will be loaded from
|
||||
* "base-context.xml" <strong>and</strong>
|
||||
* "extended-context.xml", in that order. Beans defined in
|
||||
* "extended-context.xml" may therefore override those defined in
|
||||
|
|
@ -70,12 +70,12 @@ public @interface ContextConfiguration {
|
|||
* <pre class="code">
|
||||
* @ContextConfiguration("base-context.xml")
|
||||
* public class BaseTest {
|
||||
* // ...
|
||||
* // ...
|
||||
* }
|
||||
*
|
||||
* @ContextConfiguration("extended-context.xml")
|
||||
* public class ExtendedTest extends BaseTest {
|
||||
* // ...
|
||||
* // ...
|
||||
* }
|
||||
* </pre>
|
||||
* If <code>inheritLocations</code> is set to <code>false</code>, the
|
||||
|
|
@ -89,8 +89,8 @@ public @interface ContextConfiguration {
|
|||
* {@link org.springframework.context.ApplicationContext ApplicationContext}.
|
||||
* <p>If not specified, the loader will be inherited from the first superclass
|
||||
* which is annotated with <code>@ContextConfiguration</code> and specifies
|
||||
* an explicit loader. If no class in the hierarchy specifies an explicit
|
||||
* loader, a default loader will be used instead.
|
||||
* an explicit loader. If no class in the hierarchy specifies an explicit
|
||||
* loader, a default loader will be used instead.
|
||||
*/
|
||||
Class<? extends ContextLoader> loader() default ContextLoader.class;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,17 +29,17 @@ import java.lang.annotation.Target;
|
|||
* be registered with a {@link TestContextManager}. Typically,
|
||||
* <code>@TestExecutionListeners</code> will be used in conjunction with
|
||||
* {@link ContextConfiguration @ContextConfiguration}.
|
||||
*
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @since 2.5
|
||||
* @see TestExecutionListener
|
||||
* @see TestContextManager
|
||||
* @see ContextConfiguration
|
||||
*/
|
||||
@Documented
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@Inherited
|
||||
@Documented
|
||||
public @interface TestExecutionListeners {
|
||||
|
||||
/**
|
||||
|
|
@ -47,7 +47,7 @@ public @interface TestExecutionListeners {
|
|||
* The {@link TestExecutionListener TestExecutionListeners} to register with
|
||||
* a {@link TestContextManager}.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @see org.springframework.test.context.support.DependencyInjectionTestExecutionListener
|
||||
* @see org.springframework.test.context.support.DirtiesContextTestExecutionListener
|
||||
* @see org.springframework.test.context.transaction.TransactionalTestExecutionListener
|
||||
|
|
@ -73,20 +73,20 @@ public @interface TestExecutionListeners {
|
|||
* <code>DirtiesContextTestExecutionListener</code>, <strong>and</strong>
|
||||
* <code>TransactionalTestExecutionListener</code>, in that order.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <pre class="code">
|
||||
* @TestExecutionListeners({ DependencyInjectionTestExecutionListener.class,
|
||||
* DirtiesContextTestExecutionListener.class })
|
||||
* DirtiesContextTestExecutionListener.class })
|
||||
* public abstract class AbstractBaseTest {
|
||||
* // ...
|
||||
* // ...
|
||||
* }
|
||||
*
|
||||
*
|
||||
* @TestExecutionListeners(TransactionalTestExecutionListener.class)
|
||||
* public class TransactionalTest extends AbstractBaseTest {
|
||||
* // ...
|
||||
* // ...
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* If <code>inheritListeners</code> is set to <code>false</code>, the
|
||||
* listeners for the annotated class will <em>shadow</em> and effectively
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* 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");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -33,14 +33,13 @@ import java.lang.annotation.Target;
|
|||
* The <code>@AfterTransaction</code> methods of superclasses will be
|
||||
* executed after those of the current class.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @since 2.5
|
||||
* @see org.springframework.transaction.annotation.Transactional
|
||||
*/
|
||||
@Target( { ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface AfterTransaction {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* 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");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -33,14 +33,13 @@ import java.lang.annotation.Target;
|
|||
* The <code>@BeforeTransaction</code> methods of superclasses will be
|
||||
* executed before those of the current class.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @since 2.5
|
||||
* @see org.springframework.transaction.annotation.Transactional
|
||||
*/
|
||||
@Target( { ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface BeforeTransaction {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* 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");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -29,16 +29,16 @@ import org.springframework.transaction.PlatformTransactionManager;
|
|||
/**
|
||||
* TransactionConfiguration defines class-level metadata for configuring
|
||||
* transactional tests.
|
||||
*
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @since 2.5
|
||||
* @see ContextConfiguration
|
||||
* @see TransactionalTestExecutionListener
|
||||
*/
|
||||
@Documented
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@Inherited
|
||||
@Documented
|
||||
public @interface TransactionConfiguration {
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue