Annotation Type ShouldThrowException
-
@Documented @Retention(RUNTIME) @Target(METHOD) public @interface ShouldThrowException
Define that a Deployment should cause a exception during deployment. If the Container does not throw a exception, or the exception is of the wrong type, a RuntimeException will be thrown and the test failed. If the correct exception is thrown the test will execute as normal.Usage Example:
@Deployment @ShouldThrowException(WeldDeploymentException.class) public static WebArchive create() { return ShrinkWrap.create(WebArchive.class); }Adding the @ShouldThrowException annotation will force the @
Deploymentto betestable = falsewhich again will force a @RunAsClienttest run mode, unless you explicitly marktestable = true- Version:
- $Revision: $
- Author:
- Aslak Knutsen