- http://blog.eisele.net 12 Frameworks Build IDE Server Client EE Spring DI Maven Ant Gradle Eclipse NetBeans IntelliJ GlassFish Tomcat AS7 IE Chrome FF … … … … … Code Source Test Other …
- http://blog.eisele.net 16 Guiding Principles Tests should be portable to any supported container Tests should be executable from IDE and build tool Should extend or integrate existing test frameworks https://docs.jboss.org/author/display/ARQ/Reference+Guide
- http://blog.eisele.net 29 Graphene https://docs.jboss.org/author/display/ARQ/Graphene …brings power of Selenium and AJAX into Arquillian framework. @RunWith(Arquillian.class) public class TestLogin { @Drone WebDriver browser; @Page HomePage homePage; @Test(expects = LoginFailedException.class) public void testLoginFailed(){ homePage.login("non-existent", "user"); }
- http://blog.eisele.net 37 Spring https://github.com/arquillian/arquillian-extension-spring …bringing Spring 2 and 3 to Arquillian. • Injection of Spring beans into test classes • Configuration from both XML and Java-based config • Injecting beans configured in web application (e.g. DispatcherServlet) for tests annotated with @SpringWebConfiguration • Support for both Spring(@Autowired, @Qualifier, @Required) and JSR-330(@Inject, @Named) annotations • Bean initialization support (@PostConstruct) • Auto packaging the spring-context and spring-web artifacts.
- http://blog.eisele.net 47 @Test public void testBundleContextInjection() { assertNotNull("BundleContext injected", context); assertEquals("System Bundle ID", 0, context.getBundle().getBundleId()); } @Test public void testBundleInjection(@ArquillianResource Bundle bundle) { // Assert that the bundle is injected assertNotNull("Bundle injected", bundle); // Assert that the bundle is in state RESOLVED // Note when the test bundle contains the test case it // must be resolved already when this test method is called assertEquals("Bundle RESOLVED", Bundle.RESOLVED, bundle.getState()); // Start the bundle bundle.start(); assertEquals("Bundle ACTIVE", Bundle.ACTIVE, bundle.getState()); https://github.com/arquillian/arquillian-container-osgi
- http://blog.eisele.net 49 iOS Platform https://github.com/arquillian/arquillian-extension-ios …brings Native and WebDriver based testing to iOS devices.
- http://blog.eisele.net 50 QUnit automates the QUnit JavaScript testing on Web Applications @RunWith(QUnitRunner.class) @QUnitResources("src/test/resources/assets") public class QUnitRunnerTestCase { @QUnitTest("tests/ticketmonster/qunit-tests-dom.html") @InSequence(1) public void qunitDomTest() { // empty body - only the annotations are used }