Think again
You can’t fix what you can’t run
You can’t fix what you can’t debug
You can’t fix what you can’t test
You can’t develop if you can’t test
The purpose of automated testing is to enable change.
Verifying correctness is just a nice side-effect.
Jeremy Norris
Not testing is painful & time consuming
Testing eliminates this pain and sacrifice
Testing rulez!
1
Tests should be portable across compatible environments
2
Tests should be executable from the IDE and the build tool
3
The test platform should reuse existing frameworks and tools
arquillian - the enterprise test platform
⌖ arquillian.org
Designed for humans
IDE friendly ☺
Can be fully automated
Continuous integration, FTW! ∞
Provides a component model for testing
Dependency injection, yeah! ⤞
Isolates the code under test
Tame that classpath ⋔
this is the secret to making Java enterprise testing child’s play
@RunWith(Arquillian.class)
public class GreeterTest {
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class, "test.jar")
.addClass(Greeter.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}
@Inject
Greeter greeter;
@Test
public void should_create_greeting() {
Assert.assertEquals(
"Hello, Earthling!", greeter.createGreeting("Earthling"));
}
}
arquillian - the extensible test platform
Reject complex, jacked up test suites
Tests are the new "Hello, World!"
arquillian - a learning test platform
Real tests increase certainty
Real tests build confidence
Real tests increase robustness
Testing with mocks only proves you know how to write mocks
Java enterprise testing + arquillian =
child’s play