Arquillian Extensions
Upcoming SlideShare
Loading in...5
×
 

Arquillian Extensions

on

  • 756 views

 

Statistics

Views

Total Views
756
Views on SlideShare
756
Embed Views
0

Actions

Likes
0
Downloads
6
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Arquillian Extensions Arquillian Extensions Presentation Transcript

  • EXTENSIONS, WHICH YOU HAVE TO TAKE WITH YOU TO A DESERTED ISLAND Michał Matłoka / @mmatloka
  • ABOUT ME
  • EXAMPLE SITUATION Company with traditions JPA JSF No tests Kajtek
  • JBOSS ARQUILLIAN Manages the lifecycle of the container (or containers) Deploys archive (or archives) to the container (or containers) Executes the tests inside (or against) the container Captures the results and returnes them to the test runner for reporting
  • CONTAINER ADAPTERS JBoss AS/WildFly GlassFish WebLogic WebSphere Jetty Tomcat OSGi Resin OpenShift Cloudbees ...
  • CONTAINER TYPES Embedded Managed Remote
  • JBOSS ARQUILLIAN @uWt(rulincas RnihAqila.ls) pbi casSmTs { ulc ls oeet @elyet Dpomn pbi sai Acie? cetDpomn( {rtr ..} ulc ttc rhv<> raeelyet) eun . @net Ijc piaeSmtigsmtig rvt oehn oehn; @et Ts pbi vi sol.( { ulc od hud.) .. . } }
  • SHRINKWRAP Bundle the dependent classes and resources into an archive Wbrhv wbrhv =SrnWa.raeWbrhv.ls) eAcie eAcie hikrpcet(eAciecas .dCasUe.ls) adls(srcas .dAMnfsRsuc(mtAstISAC,"en.m"; adsaieteoreEpyse.NTNE basxl) Wbrhv wbrhv =SrnWa.raeWbrhv.ls) eAcie eAcie hikrpcet(eAciecas .dCassUe.ls,.. adlse(srcas .) .dAMnfsRsuc(mtAstISAC,"en.m"; adsaieteoreEpyse.NTNE basxl) Wbrhv wbrhv =SrnWa.raeWbrhv.ls) eAcie eAcie hikrpcet(eAciecas .dPcaeUe.ls.ePcae) adakg(srcasgtakg() .dAMnfsRsuc(mtAstISAC,"en.m"; adsaieteoreEpyse.NTNE basxl)
  • SHRINKWRAP RESOLVER Fl[ fls=Mvnrsle( ie] ie ae.eovr) .eov(GAV) rsle"::" .ihrniiiy) wtTastvt( .sie) aFl(; Fl[ fls=Mvnrsle( ie] ie ae.eovr) .odoFoFl(/aht/o.m" laPmrmie"pt/opmxl) .eov(GA) rsle":" .ihrniiiy) wtTastvt( .sie) aFl(; Fl[ fls=Mvnrsle( ie] ie ae.eovr) .odoFoFl(/aht/o.m" laPmrmie"pt/opmxl) .motutmDpnece( iprRnieeednis) .eov(.ihrniiiy) rsle)wtTastvt( .sie) aFl(; Wbrhv wbrhv =SrnWa.raeMvnmotrcas eAcie eAcie hikrpcet(aeIpre.ls) .odoFoFl(/aht/o.m" laPmrmie"pt/opmxl) .motulOtu( iprBidupt) .sWbrhv.ls) a(eAciecas; Wbrhv wbrhv =SrnWa eAcie eAcie hikrp .raeEbdeGalIpre.ls) cet(meddrdemotrcas .oPoetietr(i) frrjcDrcoydr .motulOtu( iprBidupt) .sWbrhv.ls) a(eAciecas;
  • SHRINKWRAP DESCRIPTORS The goal is to provide most of the Java EE deployment descriptors. Each descriptor follows the same API style and allows to manipulate all elements as the specification describes.
  • SHRINKWRAP DESCRIPTORS - PERSISTENCE.XML <essec> pritne <essec-ntnm=map> pritneui ae"yp" <rvdroghbraeebHbraeessec<poie> poie>r.ient.j.ientPritne/rvdr <t-aasuc>aa/ealD<jadt-ore jadt-orejv:DfutS/t-aasuc> <rpris poete> <rprynm=hbraedaet vle"r.ient.ilc.SLilc poet ae"ient.ilc" au=oghbraedaetHQDae <rprynm=hbraehmdlat"vle"raedo" poet ae"ient.b2d.uo au=cet-rp> <poet>/rpry<poete> /rpry<poet>/rpris <pritneui> /essec-nt <pritne /essec>
  • SHRINKWRAP DESCRIPTORS - CODE fnlPritneecitrpritne=Dsrpos ia essecDsrpo essec ecitr .raePritneecitrcas cet(essecDsrpo.ls) .raeessecUi( cetPritnent) .ae"yp" nm(map) .rvdr"r.ient.j.ientPritne) poie(oghbraeebHbraeessec" .tDtSuc(jv:DfutS) jaaaore"aa/ealD" .eOCetPoete( gtrraerpris) .raerpry)nm(hbraedaet) cetPoet(.ae"ient.ilc" .au(oghbraedaetHQDaet)u( vle"r.ient.ilc.SLilc".p) .raerpry)nm(hbraehmdlat" cetPoet(.ae"ient.b2d.uo) .au(cet-rp)u( vle"raedo".p) .p)u( u(.p)
  • ARQUILLIAN PERSISTENCE EXTENSION Wrapping each test in the seperated transaction Database seeding using: DBUnit (XML, XLS, YAML, JSON), SQL scripts DB state comparing with dataset at the end of the test Eviction JPA second level cache between test method invocation
  • ARQUILLIAN PERSISTENCE EXTENSION - EXAMPLE PART I @et Ts @snDtSt"aaesuesyl) Uigaae(dtst/sr.m" @hudacDtSt"aaesepce-sr.m" SolMthaae(dtst/xetduesyl) pbi vi solCagUePswr( trw Ecpin{ ulc od hudhnesrasod) hos xeto / gvn / ie fnlSrn epcePswr ="uiPak" ia tig xetdasod lbelci; fnlUe ue =e.idUe.ls,2) ia sr sr mfn(srcas L; / we / hn ue.ePswr(xetdasod; srstasodepcePswr) e.eg(sr; mmreue) / te / hn asrTa(srgtasod).sqaT(xetdasod; sethtue.ePswr()iEuloepcePswr) }
  • ARQUILLIAN PERSISTENCE EXTENSION - EXAMPLE PART II ue: sr -i:1 d frtae Jh isnm: on lsnm:Sih atae mt uenm:dod srae ove pswr:pswr asod asod -i:2 d frtae Cak isnm: lr lsnm:Kn atae et uenm:spra srae uemn pswr:kytnt asod rpoie
  • ARQUILLIAN DRONE Integrates WebDriver with Arquillian Interaction with deployments and containers provided by Arquillian Configuration kept in arquillian.xml Compatible with WebDriver (Selenium 2), Selenium 1 and Selenium Grids
  • ARQUILLIAN DRONE - EXAMPLE @uWt(rulincas RnihAqila.ls) pbi casWbrvret{ ulc ls eDieTs @elyettsal =fle Dpomn(etbe as) pbi sai Wbrhv cetDpomn( .. ulc ttc eAcie raeelyet) . @rulineore AqilaRsuc ULcnetah R otxPt; @rn Doe Wbrvrdie; eDie rvr @et Ts pbi vi solNtoi( { ulc od hudoLgn) die.idlmn(yi(lgnomlgn).lc(; rvrfnEeetB.d"oiFr:oi")cik) .. . } }
  • ARQUILLIAN GRAPHENE Extensions for WebDriver PageObjects and PageFragments AJAX support
  • ARQUILLIAN GRAPHENE - EXAMPLE PART I @uWt(rulincas RnihAqila.ls) pbi casTsLgn{ ulc ls etoi @rn Doe Wbrvrbosr eDie rwe; @ae Pg HmPg hmPg; oeae oeae @etepcs=Lgnaldxeto.ls) Ts(xet oiFieEcpincas pbi vi tsLgnald){ ulc od etoiFie( } hmPg.oi(nneitn" "sr) oeaelgn"o-xset, ue"; } }
  • ARQUILLIAN GRAPHENE - EXAMPLE PART II pbi casHmPg { ulc ls oeae @idy"lgnfr" FnB(.oi-om) Lgnilglgnilg oiDao oiDao; @idy"sac" FnB(.erh) AtcmltCmoetfltxSac; uoopeeopnn uleterh pbi vi lgnSrn ue,Srn pswr)trw Lgnaldxeto { ulc od oi(tig sr tig asod hos oiFieEcpin lgnilgstsrue) oiDao.eUe(sr; lgnilgstasodpswr) oiDao.ePswr(asod; lgnilglgn) oiDao.oi(; } .. . }
  • ARQUILLIAN GRAPHENE - EXAMPLE PART III pbi casLgnilg{ ulc ls oiDao @idy FnB piaeWblmn ueNm; rvt eEeet srae @idyi ="oi" FnB(d lgn) piaeWblmn lgnutn rvt eEeet oiBto; .. .. }
  • ARQUILLIAN GRAPHENE - AJAX Gahn.atjx)utl)eeetwblmnOB)i(. rpeewiAa(.ni(.lmn(eEeetry.s) .s)nt)peet) i(.o(.rsn(; .nbe(; eald) .eetd) slce(; .iil(; vsbe)
  • ARQUILLIAN WARP Using Warp, you can initiate an HTTP request using a client-side testing tool such as WebDriver and, in the same request cycle, execute in-container server-side tests
  • ARQUILLIAN WARP Includes support for JSF JAX-RS (REST) Spring MVC
  • ARQUILLIAN WARP - EXAMPLE PART I @uWt(rulincas RnihAqila.ls) @apet WrTs @uACin Rnslet pbi casBscet{ ulc ls aiTs @elyet Dpomn .. . @rulineore AqilaRsuc ULcnetah R otxPt; @et Ts pbi vi sol..){ ulc od hud.( Wr ap .ntaeAtvt) iiit(ciiy .bev(bevr osreOsre) .npc(npcin; isetIseto) } }
  • ARQUILLIAN WARP - EXAMPLE PART II @et Ts pbi vi solMkPoeRqet){ ulc od hudaerpreus( Wr.ntaenwAtvt( { apiiit(e ciiy) @vrie Oerd pbi vi prom){ ulc od efr( bosrnvgt(.ocnetah+"cr"; rwe.aiae)t(otxPt /at) } }.ru(.bev(eus(.r(.nsih"cr") )gop)osrerqet)ui)edWt(/at) .npc(npcin; isetiseto) }
  • ARQUILLIAN WARP REST - EXAMPLEPART III - REST Iseto iseto =nwIseto( { npcin npcin e npcin) piaesai fnlln sraVrinI =1; rvt ttc ia og eilesoUD L @rulineore AqilaRsuc piaeRsCnetrsCnet rvt etotx etotx; @feSrlt Atreve pbi vi tsGttcs){ ulc od eteSok( asrTa(etotx.eHtRqet)gtehd).sqaT(tpehdGT; sethtrsCnetgttpeus(.eMto()iEuloHtMto.E) asrTa(etotx.eHtRsos(.eSauCd()iEuloRsos.t sethtrsCnetgttpepne)gtttsoe).sqaT(epneSa asrTa(etotx.eHtRsos(.eCnetye).sqaT(apiai sethtrsCnetgttpepne)gtotnTp()iEulo"plcto Ls ls =(it rsCnetgttpepne)gtniy) it it Ls) etotx.eHtRsos(.eEtt(; asrTa(itsz()iEulo1; sethtls.ie).sqaT() } }
  • ARQUILLIAN DROIDIUM Includes container adapter Device and emulator management Can create AVD (Android Virtual Device) Arquillian Droidium Web - Selenium integration Arquillian Droidium Native - Selendroid integration Can take screeshots Early Alpha
  • ARQUILLIAN DROIDIUM - EXAMPLE @uWt(rulincas RnihAqila.ls) @uACin Rnslet pbi casDoduWbetae{ ulc ls riimeTsCs @elyet Dpomn @agtCnanr"bsa" Tresotie(joss) pbi sai Acie? gtelyet){ ulc ttc rhv<> eDpomn( rtr SrnWa eun hikrp .raermiFl(eAciecas nwFl(so.a") cetFoZpieWbrhv.ls, e ie"hpwr); } @et Ts @prtODpomn(joss) Oeaenelyet"bsa" pbi vi ts0(DoeAdodrvrdie, ulc od et1@rn nriDie rvr @rulineoreULdpomnUL { AqilaRsuc R elyetR) L die.e(elyetR.otig); rvrgtdpomnULtSrn() asrTu(rvrgtaeore)cnan(So") setredie.ePgSuc(.otis"hp); } }
  • ARQUILLIAN DROIDIUM - EXAMPLE @uWt(rulincas RnihAqila.ls) @uACin Rnslet pbi casDoduSlnriTsCs { ulc ls riimeedodetae @elyet Dpomn @ntuetbe Isrmnal pbi sai Acie? gtelyet){ ulc ttc rhv<> eDpomn( rtr SrnWa eun hikrp .raermiFl(aarhv.ls,nwFl(so.p") cetFoZpieJvAciecas e ie"hpak); } @et Ts pbi vi eape@rulineoreAdodeieadod ulc od xml(AqilaRsuc nriDvc nri, @rn Wbrvrdie){ Doe eDie rvr adodgtciiyaaePoie(.eAtvtMngr) nri.eAtvtMngrrvdr)gtciiyaae( .trAtvt(cmso.oecenciiy) satciiy"o.hpHmSreAtvt" Wblmn bto =die eEeet utn rvr .idlmn(yi(crBto") fnEeetB.d"atutn); .. } . }
  • ARQUILLIAN PERFORMANCE - EXAMPLE @efracTs(eutTrsod2 Promneetrslshehl=) / cek i rslshehl *nwie<odie / hcs f eutTrsod eTm lTm @uWt(rulincas RnihAqila.ls) pbi casRcmedtoBidnTs { ulc ls eomnainuliget @elyet Dpomn pbi sai JvAciecetDpomn( { ulc ttc aarhv raeelyet) rtr .. eun . } @netRcmedtoSriercmedtoSrie Ijc eomnainevc eomnainevc; @et Ts @efrac(ie2)/ tmoti m Promnetm=0 / ieu n s pbi vi dHrWr( trw Ecpin{ ulc od oadok) hos xeto .. . } }
  • OTHER EXTENSIONS Extension Byteman Google Guice Extension GWT Testing extension Extension Jacoco Extension JRebel screenRecorder Spring Framework Extension arquillian-ios-aggregator arquillian-extension-qunit Spock Arquillian Extension ShrinkWrap DSL
  • TAKE AWAYS ShrinkWrap - archives ShrinkWrap Resolver - maven, gradle ShrinkWrap Descriptors - fluent API code generation from XSD Arquillian Persistence Extension - DB Arquillian Drone - WebDriver integration - UI Arquillian Graphene - extended WebDriver - better UI Arquillian Warp - client-side request, server-side test REST, Spring MVC... Arquillian Droidium - Android Browser, Android UI Arquillian Performance - timeouts, execution time comparision
  • MATERIALS & HELP http://arquillian.org http://arquillian.org/guides/ https://docs.jboss.org/author/display/ARQ/Reference+Guide https://github.com/arquillian/ https://github.com/shrinkwrap/ https://community.jboss.org/ http://jira.jboss.org/ irc.freenode.net - #arquillian, #jbosstesting
  • http://meninblack.wikia.com/
  • THE END QUESTIONS? mmatloka @ gmail.com https://github.com/mmatloka/presentations