Arquillian A fresh look at enterprise testing [bmajsak@jug-bern ~]$ - - PowerPoint PPT Presentation

arquillian
SMART_READER_LITE
LIVE PREVIEW

Arquillian A fresh look at enterprise testing [bmajsak@jug-bern ~]$ - - PowerPoint PPT Presentation

Arquillian A fresh look at enterprise testing [bmajsak@jug-bern ~]$ whoami twitter: @majson github: bartoszmajsak gmail: bartosz.majsak@gmail.com Integration Containers Deployment Alt+Shift+X, T Alt+Shift+X, N public class


slide-1
SLIDE 1

Arquillian

A fresh look at enterprise testing

slide-2
SLIDE 2

[bmajsak@jug-bern ~]$ whoami twitter: @majson github: bartoszmajsak gmail: bartosz.majsak@gmail.com

slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7

Integration

slide-8
SLIDE 8

Containers

slide-9
SLIDE 9

Deployment

slide-10
SLIDE 10

Alt+Shift+X, T Alt+Shift+X, N

slide-11
SLIDE 11
slide-12
SLIDE 12

public class FluidOunceConverterTestCase { @Deployment public static JavaArchive createDeployment() { return ShrinkWrap.create(JavaArchive.class, "test.jar") .addClasses(FluidOunceConverter.class, FluidOunceConverterBean.class); } @EJB FluidOunceConverter converter; @Test public void shouldConvertFluidOuncesToMillilitres() { // given double ouncesToConvert = 8d; double expectedMillilitres = 236.588237d; // when double ouncesInMl = converter.convertToMillilitres(ouncesToConvert); // then assertThat(ouncesInMl).isEqualTo(expectedMillilitres); } }

slide-13
SLIDE 13

@RunWith(Arquillian.class) public class FluidOunceConverterTestCase { @Deployment public static JavaArchive createDeployment() { return ShrinkWrap.create(JavaArchive.class, "test.jar") .addClasses(FluidOunceConverter.class, FluidOunceConverterBean.class); } @EJB FluidOunceConverter converter; @Test public void shouldConvertFluidOuncesToMillilitres() { // given double ouncesToConvert = 8d; double expectedMillilitres = 236.588237d; // when double ouncesInMl = converter.convertToMillilitres(ouncesToConvert); // then assertThat(ouncesInMl).isEqualTo(expectedMillilitres); } }

slide-14
SLIDE 14
slide-15
SLIDE 15
slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18

@Before public void setUp() throws Exception { String baseUrl = "http://beeradvisor-bmajsak.rhcloud.com/"; selenium = new WebDriverBackedSelenium(new FirefoxDriver(), baseUrl); } @Test public void testSearch() throws Exception { selenium.open("/search.xhtml"); selenium.type("id=advisor:beerSearch", "strongest"); selenium.keyPress("id=advisor:beerSearch", "\\13"); for (int second = 0; ; second++) { if (second >= 60) fail("timeout"); try { if (selenium.isElementPresent("end_of_history")) break; } catch (Exception e) {} Thread.sleep(1000); } assertEquals("End of history", selenium.getTable("id=beer-results-table.1.0")); }

slide-19
SLIDE 19

Page Objects

slide-20
SLIDE 20

Scenario “Finding all Swiss beers”

Given “I'm on the main page” When “I enter 'from Switzerland' ” Then “I should see Appenzeller and Bügel on the list”

slide-21
SLIDE 21

Extending Arquillian

slide-22
SLIDE 22
  • Extend deployment package
  • Enrich test class / method
  • Observe / intercept events
  • Communicate between client and container
slide-23
SLIDE 23
slide-24
SLIDE 24

Arquillian Extensions

  • Persistence
  • Drone / Graphene
  • Android
  • Jacoco
  • Byteman
  • Performance
  • JSFUnit
  • Spock
  • JBehave
  • Seam 2
  • Spring
  • JRebel
slide-25
SLIDE 25
slide-26
SLIDE 26

http://arquillian.org http://github.com/arquillian

slide-27
SLIDE 27