org.jboss.arquillian.container.test.api
Annotation Type ShouldThrowException
@Documented
@Retention(value=RUNTIME)
@Target(value=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 @Deployment
to be testable = false which again
will force a @RunAsClient
test run mode.
- Version:
- $Revision: $
- Author:
- Aslak Knutsen
value
public abstract Class<? extends Exception> value
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.