This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(Arquillian.class) | |
public class AlternativeMailServiceIT { | |
private static final Logger LOG = LoggerFactory.getLogger(AlternativeMailServiceIT.class); | |
@Deployment | |
public static Archive createDeployment() { | |
PomEquippedResolveStage pomFile = Maven.resolver().loadPomFromFile("pom.xml"); | |
WebArchive archive = ShrinkWrap.create(WebArchive.class) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Alternative | |
public class AlternativeMailService extends MailService { | |
public static CountDownLatch latch; | |
@Override | |
public void sendMail(final String subject, final String body, final String... recipients) { | |
latch.countDown(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(Arquillian.class) | |
public class MailServiceIT { | |
private static final Logger LOG = LoggerFactory.getLogger(MailServiceIT.class); | |
@Deployment | |
public static Archive createDeployment() { | |
WebArchive archive = ShrinkWrap.create(WebArchive.class) | |
.addClass(MailService.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ApplicationScoped | |
public class MailService { | |
private static final Logger LOG = LoggerFactory.getLogger(MailService.class); | |
public void sendMail(String subject, String body, String... recipients) { | |
LOG.info("sendMail: \n" + "subject: \n" + subject + "body: \n" + body); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<arquillian xmlns="http://jboss.org/schema/arquillian" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> | |
<container qualifier="chameleon" default="true"> | |
<configuration> | |
<property name="chameleonTarget">wildfly:9.0.0.Final:managed</property> | |
<property name="serverConfig">standalone-full.xml</property> | |
<property name="javaVmArguments">-Xmx512m -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n</property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project ...> | |
<properties> | |
... | |
<version.junit>4.12</version.junit> | |
<version.assertj>3.1.0</version.assertj> | |
<version.arquillian>1.1.8.Final</version.arquillian> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExceptionHandlingTest { | |
@Rule | |
public ExpectedException thrown = ExpectedException.none(); | |
@Test(expected = IndexOutOfBoundsException.class) | |
public void shouldFailForInvalidIndex() throws Exception { | |
new ArrayList<>().get(0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@FixMethodOrder(JVM) | |
public class FixMethodOrderJVMTest { | |
private static final Logger LOG = LoggerFactory.getLogger(FixMethodOrderJVMTest.class); | |
@Rule | |
public TestName name = new TestName(); | |
@Test | |
public void methodB() throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@FixMethodOrder(NAME_ASCENDING) | |
public class FixMethodOrderNameAscendingTest { | |
private static final Logger LOG = LoggerFactory.getLogger(FixMethodOrderNameAscendingTest.class); | |
@Rule | |
public TestName name = new TestName(); | |
@Test | |
public void methodB() throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MethodOrderInheritanceTest extends MethodOrderTest { | |
private static final Logger LOG = LoggerFactory.getLogger(MethodOrderInheritanceTest.class); | |
@Test | |
public void methodAChild() throws Exception { | |
LOG.info("@Test methodAChild()"); | |
} | |
@Test |