use of org.jboss.arquillian.container.test.api.ShouldThrowException in project core by weld.
the class BeanDiscoveryDecorator03Test method getDeployment.
/**
* Throw exception because of the decorator ClassicRepresentDecorator not discovered, because it has not a bean defining annotation.
*/
@Deployment
@ShouldThrowException(DeploymentException.class)
public static Archive<?> getDeployment() {
WeldSEClassPath archives = ShrinkWrap.create(WeldSEClassPath.class);
JavaArchive archive01 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL).decorators(ClassicRepresentDecorator.class, ScopedRepresentDecorator.class), "beans.xml").addClasses(Dog.class, Cat.class);
JavaArchive archive02 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ANNOTATED).decorators(ClassicRepresentDecorator.class, ScopedRepresentDecorator.class), "beans.xml").addClasses(Plant.class, Tree.class, Stone.class, ScopedRepresentDecorator.class);
JavaArchive archive03 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.NONE).decorators(ClassicRepresentDecorator.class, ScopedRepresentDecorator.class), "beans.xml").addClasses(Flat.class, House.class, ClassicRepresentDecorator.class);
archives.add(archive01);
archives.add(archive02);
archives.add(archive03);
return archives;
}
use of org.jboss.arquillian.container.test.api.ShouldThrowException in project core by weld.
the class UnproxyableTest method deploy.
@Deployment
@ShouldThrowException(DeploymentException.class)
public static JavaArchive deploy() {
BeanArchive archive = ShrinkWrap.create(BeanArchive.class, Utils.getDeploymentNameAsHash(UnproxyableTest.class));
archive.addPackage(UnproxyableTest.class.getPackage());
return archive;
}
use of org.jboss.arquillian.container.test.api.ShouldThrowException in project core by weld.
the class BeanDiscoveryInterceptor03Test method getDeployment.
/**
* Throw exception because of the interceptor ClassicInterceptor not accessible.
*/
@Deployment
@ShouldThrowException(DeploymentException.class)
public static Archive<?> getDeployment() {
WeldSEClassPath archives = ShrinkWrap.create(WeldSEClassPath.class);
JavaArchive archive01 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL).interceptors(ScopedInterceptor.class, ClassicInterceptor.class), "beans.xml").addClasses(Dog.class, Cat.class, InterceptorBindingAnnotation.class);
JavaArchive archive02 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ANNOTATED).interceptors(ScopedInterceptor.class, ClassicInterceptor.class), "beans.xml").addClasses(Plant.class, Tree.class, Stone.class, ScopedInterceptor.class);
JavaArchive archive03 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.NONE).interceptors(ScopedInterceptor.class, ClassicInterceptor.class), "beans.xml").addClasses(Flat.class, House.class, ClassicInterceptor.class);
archives.add(archive01);
archives.add(archive02);
archives.add(archive03);
return archives;
}
use of org.jboss.arquillian.container.test.api.ShouldThrowException in project core by weld.
the class ConfigurationKeyHasDifferentValuesTest method createTestArchive.
@ShouldThrowException(org.jboss.weld.exceptions.IllegalStateException.class)
@Deployment
public static Archive<?> createTestArchive() {
BeanArchive ejbJar = ShrinkWrap.create(BeanArchive.class);
ejbJar.addClass(DummySessionBean.class).addAsResource(PropertiesBuilder.newBuilder().set(ConfigurationKey.CONCURRENT_DEPLOYMENT.get(), "false").build(), "weld.properties");
WebArchive war1 = Testable.archiveToTest(ShrinkWrap.create(WebArchive.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")).addAsResource(PropertiesBuilder.newBuilder().set(ConfigurationKey.CONCURRENT_DEPLOYMENT.get(), "true").build(), "weld.properties");
WebArchive war2 = ShrinkWrap.create(WebArchive.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml").addAsResource(PropertiesBuilder.newBuilder().set(ConfigurationKey.CONCURRENT_DEPLOYMENT.get(), "false").build(), "weld.properties");
return ShrinkWrap.create(EnterpriseArchive.class, Utils.getDeploymentNameAsHash(ConfigurationKeyHasDifferentValuesTest.class, Utils.ARCHIVE_TYPE.EAR)).addAsModules(ejbJar, war1, war2);
}
use of org.jboss.arquillian.container.test.api.ShouldThrowException in project core by weld.
the class MultiwarProjectNameValidation2Test method getDeployment.
@Deployment(testable = false)
@ShouldThrowException(DeploymentException.class)
public static Archive<?> getDeployment() {
WebArchive war1 = ShrinkWrap.create(WebArchive.class).addClasses(Alpha.class, Bravo.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
WebArchive war2 = ShrinkWrap.create(WebArchive.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
return ShrinkWrap.create(EnterpriseArchive.class, Utils.getDeploymentNameAsHash(MultiwarProjectNameValidation2Test.class, Utils.ARCHIVE_TYPE.EAR)).addAsModules(war1, war2);
}
Aggregations