patterntesting.runtime.annotation
Annotation Type RunTestOn
@Documented
@Target(value={METHOD,TYPE})
@Retention(value=RUNTIME)
public @interface RunTestOn
You have a test which should be run only on Linux or another operationg
system? Then you can use this annotation to run a single test (put the
annotation in front of the test method) or all tests in this class (put
the annotation in front of the class) on the given platform.
- Since:
- 1.0 (27.01.2010)
- Author:
- oliver
- See Also:
SkipTestOn
|
Optional Element Summary |
String[] |
host
With this attribute you can express that the test should be run on
the given host(s). |
String[] |
javaVendor
You want the test to be run on a special vendor VM? |
String[] |
javaVersion
You want the test to be run on a special version of the VM, e.g. on
version "1.6.0_17" because you know that on this version there is a bug
that caused your test not to work? |
String[] |
osArch
You want the test only to be run on the Intel architecture? |
String[] |
osName
Should a test be run only on a single platform e.g. on Linux? |
String[] |
osVersion
You want the test only to be run on a special version of the
operating system? |
String[] |
property
You have some tests that runs only if you are online? |
String[] |
user
Does the test should be run only for user "Bob" because he is the only
one who has access to a secret webservice? |
String[] |
value
Here you can define the name of the operating system or version of the
JDK for which a test should be executed. |
value
public abstract String[] value
- Here you can define the name of the operating system or version of the
JDK for which a test should be executed. But it is better to use the
attributes "osName" or "javaVersion" here because otherwise
PatternTesting tries to guess what you mean.
Since 1.2 wildcards (*, ?) are supported.
- See Also:
osName(),
javaVersion()
- Default:
- ""
osName
public abstract String[] osName
- Should a test be run only on a single platform e.g. on Linux?
Use "Linux" and the test will run only on the Linux platform.
Instead of "Linux" you can use any other operation system. The
format must be the same as returned by the system property "os.name".
Valid values are:
- "Linux"
- "Mac OS X" (for Mac),
- "Windows XP"
- and others
(see "http://lopica.sourceforge.net/os.html").
Multiple values like { "Linux", "Mac OS X" } are allowed.
If no operation system is given you will get an IllegalArgumentException.
The format of this attribute must be the same as returned by system
property "os.name".
Since 1.2 wildcards (*, ?) are supported.
- Default:
- ""
osArch
public abstract String[] osArch
- You want the test only to be run on the Intel architecture?
Then you can use this attribute to limit it on this platform.
You can define a single platform like
"x86_64" for an
Intel-Mac with 64 bit or multiple platform like
{ "x86_32", "x86_64" } for Intel Mac with 42 or 64 bit.
The format of this attribute must be the same as returned by the ystem
property "os.arch".
Since 1.2 wildcards (*, ?) are supported.
- Default:
- ""
osVersion
public abstract String[] osVersion
- You want the test only to be run on a special version of the
operating system? Use this attribute to limit it.
In contradiction to the other attributes the real version must start
with the given version. I.e. if you define "10.6" as version this would
match only real version "10.6.1" or "10.6.2".
You can't define a range of versions. But several versions are
allowed. So if you want to run the tests in version 10.6.1 till 10.6.3
define { "10.6.1", "10.6.2", "10.6.3" } as values.
Since 1.2 wildcards (*, ?) are supported.
- Default:
- ""
host
public abstract String[] host
- With this attribute you can express that the test should be run on
the given host(s). You can define the host by its name or by its
IP address.
Since 1.2 wildcards (*, ?) are supported.
- Default:
- ""
javaVersion
public abstract String[] javaVersion
- You want the test to be run on a special version of the VM, e.g. on
version "1.6.0_17" because you know that on this version there is a bug
that caused your test not to work? Then use this attribute.
You can't define a range of executed versions. But you regex (regular
expressions) are allowed. And you can define more than one version
(or regex).
The format of this attribute must be the same as returned by the
system property "java.version".
Since 1.2 wildcards (*, ?) are supported.
- Default:
- ""
javaVendor
public abstract String[] javaVendor
- You want the test to be run on a special vendor VM? Use this attribute
here. The format of this attribute must be the same as returned by the
system property "java.vendor".
Valid values are:
Since 1.2 wildcards (*, ?) are supported.
- Default:
- ""
user
public abstract String[] user
- Does the test should be run only for user "Bob" because he is the only
one who has access to a secret webservice?
Use
user="bob" to run this test only for his account.
Yep, the new boss of the team, Bill, is also allow to call this
webservice. Ok, use user={"bob", "bill"} skip the test for
both accounts.
Since 1.2 wildcards (*, ?) are supported.
- Since:
- 1.1
- Default:
- ""
property
public abstract String[] property
- You have some tests that runs only if you are online? Define a
property (e.g.
property="online").
If this property is set (and its value is
not "false") the test will be executed if you start the JavaVM with
java -Donline ... or java -Donline=true ....
You can control more than property with this attribute. Then all
properties must be "true" to run the test.
Wildcards (*, ?) are not yet supported for system properties.
- Default:
- ""
Copyright © 2002–2014 PatternTesting Team. All rights reserved.