37. Server Side
Hamcrest is about expressiveness
New BSD License
String officerRank = getRankByDate(officer);
List<String> ranks = [(“Captain”, “Commander”)];
assertEquals(true, ranks.contains(officerRank));
18
39. Server Side
Hamcrest is about expressiveness
New BSD License
String officerRank = getRankByDate(officer);
assertThat(officerRank,
isOneOf(“Captain”,”Commander”));
assertThat(age, is(10));
assertThat(name, is(not(“Alex”));
assertThat(calculated, isNotANumber());
18
47. Persistence Side (SQL)
Isolation problem with Database
Insert-Delete Problem
GNU LGPL 2.1
22
48. Persistence Side (SQL)
Isolation problem with Database
Insert-Delete Problem
GNU LGPL 2.1
Define base data set
22
49. Persistence Side (SQL)
Isolation problem with Database
Insert-Delete Problem
GNU LGPL 2.1
Define base data set
@Before
DatabaseOperation.CLEAN_INSERT.execute(connection,
dataSet);
22
57. Integration Tests
Test Collaboration Between Components
Database
IO system
Special Environment Configuration
28
58. Integration Tests
Common Problems in JEE 6
CDI - @EJB, @Inject, @PersistenceContext
29
59. Integration Tests
Common Problems in JEE 6
CDI - @EJB, @Inject, @PersistenceContext
Container Lifecyle Management
Create Deployment Archive
29
60. Integration Tests
Common Problems in JEE 6
k
oc
CDI - @EJB, @Inject, @PersistenceContext
M
T
Container Lifecyle Management
NO
Create Deployment Archive
Do
29
61. Integration Tests
Arquillian brings tests to runtime
Manage Lifecycle of Container Apache License 2.0
Create/Deploy MicroDeployments
Enriching Test Classes
Run Tests Inside/Against Container
IDE Friendly
30
62. Integration Tests
Arquillian brings tests to runtime
ks
Manage Lifecycle of Container
c
Apache License 2.0
o
M Classes
Create/Deploy MicroDeployments
o r e
Enriching Test
o M
N
Run Tests Inside/Against Container
IDE Friendly
30
71. Acceptance Tests
User Story
everyday language sentence
adds business values
34
72. Acceptance Tests
User Story
everyday language sentence
adds business values
As administrator, I want to add new books
to a collection, so users can borrow them
34
74. Acceptance Tests
Acceptance Criteria
story completeness
Administrator can add new books.
Administrator can categorise books.
User can borrow books added by administrator.
35
75. Acceptance Tests
Concrete Examples
1. Create Lord of the Rings
Book.
2. Assign J.R.R Tolkien as
author.
3. Set Book Description.
4. Add Book to System.
5. Check that Book is shown
in screen.
36
100. Questions
Questions ?
How many nights I prayed for this, to let my work begin First we take Manhattan, then we take Berlin - Leonard Cohen
46
101. Questions
Questions ?
Alex Soto Bueno
asotobu@gmail.com
www.lordofthejars.com
@alexsotob
How many nights I prayed for this, to let my work begin First we take Manhattan, then we take Berlin - Leonard Cohen
46