See attached file
Maven dependency according to:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.4.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
Testclass according to:
package se.shouldfailtest;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertTrue;
@RunWith(Arquillian.class)
public class ShouldFailTest {
@Deployment
public static Archive<?> createDeployment()
{
WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
return war;
}
@Before
public void preparePersistenceTest() throws Exception
{
throw new Exception("Test should fail when exception is thrown in @Before...");
}
@Test
public void shouldFail() throws Exception
{
//This test will pass in 1.1.4.Final but not in 1.1.3.Final (as expected).
assertTrue(false);
}
}