Skip to content

Instantly share code, notes, and snippets.

@milenkovicm
Created March 12, 2012 11:54
Show Gist options
  • Save milenkovicm/2021382 to your computer and use it in GitHub Desktop.
Save milenkovicm/2021382 to your computer and use it in GitHub Desktop.
[Junit] Arquillian - use of @ShouldThrowException(Exception.class) at @deployment method
package org.jboss.weld.tests.xml.broken.stereotype;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.ShouldThrowException;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.BeanArchive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(Arquillian.class)
public class BeansXmlTest {
@Deployment
@ShouldThrowException(Exception.class)
public static Archive<?> deploy() {
return ShrinkWrap.create(BeanArchive.class)
.stereotype(Foo.class)
.addPackage(BeansXmlTest.class.getPackage());
}
@Test
public void testStereotypeRespectedInBeansXml() {
//assert false; // Arquillian ShouldThrowException marks it as allowed, does not stop @Test from execution
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment