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

Polishing test annotation declarations and JavaDoc.

上级 a1b3b875
......@@ -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 {
/**
......
/*
* 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 {
}
/*
* 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
* &#064;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;
......
/*
* 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 {
/**
......
/*
* 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
* &quot;base-context.xml&quot; <strong>and</strong>
* &quot;extended-context.xml&quot;, in that order. Beans defined in
* &quot;extended-context.xml&quot; may therefore override those defined in
......@@ -70,12 +70,12 @@ public @interface ContextConfiguration {
* <pre class="code">
* &#064;ContextConfiguration(&quot;base-context.xml&quot;)
* public class BaseTest {
* // ...
* // ...
* }
*
* &#064;ContextConfiguration(&quot;extended-context.xml&quot;)
* 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>&#064;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>&#064;TestExecutionListeners</code> will be used in conjunction with
* {@link ContextConfiguration &#064;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">
* &#064;TestExecutionListeners({ DependencyInjectionTestExecutionListener.class,
* DirtiesContextTestExecutionListener.class })
* DirtiesContextTestExecutionListener.class })
* public abstract class AbstractBaseTest {
* // ...
* // ...
* }
*
*
* &#064;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
......
/*
* 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>&#064;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 {
}
/*
* 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>&#064;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 {
}
/*
* 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 {
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册