arquillian 소개

40
테스트 어디까지 해봤니? arquillian을 이용한 Real Objects 테스트 전성욱 ([email protected])

Upload: -

Post on 22-Jul-2015

76 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Arquillian 소개

테스트����������� ������������������  어디까지����������� ������������������  해봤니?

arquillian을����������� ������������������  이용한����������� ������������������  Real����������� ������������������  Objects����������� ������������������  테스트

전성욱����������� ������������������  ([email protected])����������� ������������������  

Page 2: Arquillian 소개

Who����������� ������������������  am����������� ������������������  I

l SAP����������� ������������������  hybris����������� ������������������  컨설턴트����������� ������������������  

l RHQ����������� ������������������  UI����������� ������������������  한글화����������� ������������������  -����������� ������������������  Contributor

2

Page 3: Arquillian 소개

3

No tests ➡️ ➡️ #fail

Page 4: Arquillian 소개

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?

Page 5: Arquillian 소개

5

Page 6: Arquillian 소개

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

Page 7: Arquillian 소개

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

Page 8: Arquillian 소개

What����������� ������������������  is����������� ������������������  Arquillian?

8

Page 9: Arquillian 소개

A component model for your tests

Page 10: Arquillian 소개

10

Page 11: Arquillian 소개

Arquillian����������� ������������������  architecture

11

Page 12: Arquillian 소개

ShrinkWrap

12

Page 13: Arquillian 소개

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

Page 14: Arquillian 소개

Fluent����������� ������������������  archive����������� ������������������  creation

14

Page 15: Arquillian 소개

Test����������� ������������������  Runners

15

Page 16: Arquillian 소개

Containers

l remote����������� ������������������  container����������� ������������������  

l embedded����������� ������������������  container����������� ������������������  

l managed����������� ������������������  container����������� ������������������  

l https://docs.jboss.org/author/display/ARQ/Container+adapters

16

Page 17: Arquillian 소개

Arquillian

17

Page 18: Arquillian 소개

Example

Page 19: Arquillian 소개

component

19

Page 20: Arquillian 소개

Unit����������� ������������������  test����������� ������������������  class

20

Page 21: Arquillian 소개

Arquillian����������� ������������������  test����������� ������������������  class

21

Page 22: Arquillian 소개

22

Page 23: Arquillian 소개

How����������� ������������������  does����������� ������������������  this����������� ������������������  all����������� ������������������  works?

Page 24: Arquillian 소개

Setup

Maven,����������� ������������������  Gradle,����������� ������������������  Ant(+Ivy)

Page 25: Arquillian 소개

25

Page 26: Arquillian 소개

26

Page 27: Arquillian 소개

27

Page 28: Arquillian 소개

28

Page 29: Arquillian 소개

29

Page 30: Arquillian 소개

30

Page 31: Arquillian 소개

31

Page 32: Arquillian 소개

32

Page 33: Arquillian 소개

33

Page 34: Arquillian 소개

34

Page 35: Arquillian 소개

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

Page 36: Arquillian 소개

Demo

Page 37: Arquillian 소개

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

Page 38: Arquillian 소개

Q����������� ������������������  &����������� ������������������  A

Page 39: Arquillian 소개

감사합니다

Page 40: Arquillian 소개

JBoss����������� ������������������  Community����������� ������������������  (http://www.jboss.org)����������� ������������������  Korea����������� ������������������  JBoss����������� ������������������  User����������� ������������������  Group����������� ������������������  Facebook����������� ������������������  ����������� ������������������  

(https://www.facebook.com/groups/jbossusergroup/)

40