The Spring Framework

org.springframework.test.annotation
Annotation Type IfProfileValue


@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
@Inherited
@Documented
public @interface IfProfileValue

Test annotation to indicate that a test is enabled for a specific testing environment. If the configured ProfileValueSource returns a matching value for the provided name, the test will be enabled. This annotation can be applied at the class-level or method-level.

Example: when using SystemProfileValueSource as the ProfileValueSource implementation, you could configure a JUnit 4 test method to run only on Java VMs from Sun Microsystems as follows:

 @IfProfileValue(name="java.vendor", value="Sun Microsystems Inc.")
 @Test
 testSomething() {
     // ...
 }

Since:
2.0
Author:
Rod Johnson, Sam Brannen
See Also:
ProfileValueSource, AbstractAnnotationAwareTransactionalTests

Required Element Summary
 String name
          The name of the profile value against which to test.
 String value
          The required value of the profile value for the given name.
 

Element Detail

name

public abstract String name
The name of the profile value against which to test.


value

public abstract String value
The required value of the profile value for the given name.


The Spring Framework

Copyright © 2002-2007 The Spring Framework.