View
77
Download
1
Category
Preview:
Citation preview
테스트����������� ������������������ 어디까지����������� ������������������ 해봤니?
arquillian을����������� ������������������ 이용한����������� ������������������ Real����������� ������������������ Objects����������� ������������������ 테스트
전성욱����������� ������������������ (allnewangel@gmail.com)����������� ������������������
Who����������� ������������������ am����������� ������������������ I
l SAP����������� ������������������ hybris����������� ������������������ 컨설턴트����������� ������������������
l RHQ����������� ������������������ UI����������� ������������������ 한글화����������� ������������������ -����������� ������������������ Contributor
2
3
No tests ➡️ ➡️ #fail
Unit����������� ������������������ vs����������� ������������������ Integration����������� ������������������ Tests
l Unit����������� ������������������
– Fine-grained����������� ������������������
– Simple����������� ������������������
– Single����������� ������������������ API����������� ������������������ Call����������� ������������������
– Fast,����������� ������������������ fast,����������� ������������������ fast����������� ������������������
– Easily����������� ������������������ run����������� ������������������ in����������� ������������������ an����������� ������������������ IDE
4
l Integration����������� ������������������
– Coarse-grained����������� ������������������
– Complex����������� ������������������
– Component����������� ������������������ interactions����������� ������������������
– Sloooooooooow����������� ������������������
– Run����������� ������������������ in����������� ������������������ an����������� ������������������ IDE?����������� ������������������ How?
5
What if integration testing could be...? l as����������� ������������������ easy����������� ������������������ as����������� ������������������ writing����������� ������������������ a����������� ������������������ unit����������� ������������������ test����������� ������������������
l run����������� ������������������ in����������� ������������������ the����������� ������������������ IDE����������� ������������������ (incremental����������� ������������������ builds,����������� ������������������ debugging,����������� ������������������ etc)����������� ������������������
l ramped����������� ������������������ up����������� ������������������ in����������� ������������������ phases����������� ������������������
l portable
6
Component models make life easier
7
l Component����������� ������������������ – Follows����������� ������������������ standard����������� ������������������ programming����������� ������������������ model����������� ������������������
– Encapsulates����������� ������������������ business����������� ������������������ logic����������� ������������������
– Packaged����������� ������������������ in����������� ������������������ deployable����������� ������������������ archive����������� ������������������
l Container����������� ������������������ – Host����������� ������������������ process����������� ������������������ for����������� ������������������ deployed����������� ������������������ applications����������� ������������������
– Provides����������� ������������������ services����������� ������������������ and����������� ������������������ a����������� ������������������ runtime����������� ������������������ for����������� ������������������ components����������� ������������������
– Gives����������� ������������������ you����������� ������������������ powerful����������� ������������������ mechanisms����������� ������������������ for����������� ������������������ free
What����������� ������������������ is����������� ������������������ Arquillian?
8
A component model for your tests
10
Arquillian����������� ������������������ architecture
11
ShrinkWrap
12
Benefits����������� ������������������ of����������� ������������������ ShrinkWrap
l Incremental����������� ������������������ IDE����������� ������������������ compilation����������� ������������������ – Save����������� ������������������ and����������� ������������������ re-run����������� ������������������
– Skip����������� ������������������ the����������� ������������������ build!����������� ������������������
l Simple,����������� ������������������ fluent����������� ������������������ API����������� ������������������
l Container����������� ������������������ deployment����������� ������������������ adapters����������� ������������������
l Micro����������� ������������������ deployments����������� ������������������
l Export����������� ������������������ and����������� ������������������ debugging
13
Fluent����������� ������������������ archive����������� ������������������ creation
14
Test����������� ������������������ Runners
15
Containers
l remote����������� ������������������ container����������� ������������������
l embedded����������� ������������������ container����������� ������������������
l managed����������� ������������������ container����������� ������������������
l https://docs.jboss.org/author/display/ARQ/Container+adapters
16
Arquillian
17
Example
component
19
Unit����������� ������������������ test����������� ������������������ class
20
Arquillian����������� ������������������ test����������� ������������������ class
21
22
How����������� ������������������ does����������� ������������������ this����������� ������������������ all����������� ������������������ works?
Setup
Maven,����������� ������������������ Gradle,����������� ������������������ Ant(+Ivy)
25
26
27
28
29
30
31
32
33
34
An in-container approach to integration testing
l Start����������� ������������������ or����������� ������������������ connect����������� ������������������ to����������� ������������������ a����������� ������������������ container����������� ������������������
l Package����������� ������������������ and����������� ������������������ deploy����������� ������������������ test����������� ������������������ case����������� ������������������ to����������� ������������������ container����������� ������������������
l Run����������� ������������������ test����������� ������������������ in-container����������� ������������������
l Capture����������� ������������������ and����������� ������������������ report����������� ������������������ results����������� ������������������
l Undeploy����������� ������������������ test����������� ������������������ archive
35
Demo
Pros����������� ������������������ and����������� ������������������ Cons
l Pros����������� ������������������ – Flexible����������� ������������������
– Portable����������� ������������������
– Opensource����������� ������������������
– Handy����������� ������������������ even����������� ������������������ for����������� ������������������ tests����������� ������������������
l Cons����������� ������������������ – Maven����������� ������������������ hell����������� ������������������
– one����������� ������������������ test����������� ������������������ class����������� ������������������ per����������� ������������������ @Deployment����������� ������������������
– too����������� ������������������ much����������� ������������������ capableties����������� ������������������ —―����������� ������������������ bit����������� ������������������ large����������� ������������������ learning����������� ������������������ curve
37
Q����������� ������������������ &����������� ������������������ A
감사합니다
JBoss����������� ������������������ Community����������� ������������������ (http://www.jboss.org)����������� ������������������ Korea����������� ������������������ JBoss����������� ������������������ User����������� ������������������ Group����������� ������������������ Facebook����������� ������������������ ����������� ������������������
(https://www.facebook.com/groups/jbossusergroup/)
40
Recommended