3. www.ics.ug #icsug
About us
• Martin Jinoch
jinoch@gmail.com
@mjinoch
http://jinoch.cz
• Martin Přádný
pradny@pradny.com
@mpradny
http://pradny.com
4. www.ics.ug #icsug
Why building and testing matters?
• Code changes break existing features
• Developers step on each others code
• Infrastructure changes break apps
• Application works only for happy-path
scenarios
12. www.ics.ug #icsug
Demo 1 - scenario
• XPages application – fake CMS with articles
• Computation of article expiration date
– based on article type
– logic in Java
• 3 different types of definitions and tests
– Hard-coded in Java
– In a document
– In a view
14. www.ics.ug #icsug
Automation
• Maven, Ant, Gradle, ..
– Describe and run steps to get final deliverable
• Jenkins, Teamcity, Bamboo, …
– Continuous integration
– Check-out source code
– Run periodical builds and much more
15. www.ics.ug #icsug
Headless designer
• Command line invocation of Domino Designer
• Create NSF from On Disk Project
• Enable/Disable plugins
• New feature in 9.0.1
• http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Headless_Designer_Wiki
• notes.ini parameter - DESIGNER_AUTO_ENABLED=true
• ID without password
19. www.ics.ug #icsug
Why Maven
• Standard in XPages community
• OSGi friendly with Tycho plugin
• IBM released Update Site on OpenNTF.org
– IBM Domino Update Site for Build Management
– http://openntf.org/main.nsf/project.xsp?r=project/IB
M%20Domino%20Update%20Site%20for%20Build%20
Management
• Allows building Extension Libraries
20. www.ics.ug #icsug
Jenkins (teamcity, bamboo,..)
• Continuous Integration
• Integrate with SCM (Git, SVN, …)
– Trigger build, push/pull, …
• Run build, Run tests
• Report errors
• Deploy to production
• Extensible with plugins
22. www.ics.ug #icsug
Selenium
• Web browser automation (Firefox, Chrome, IE,…)
• Selenium IDE (Firefox)
– Record tests
– Replay tests
– Export (Java, C#, ruby, Python, ..)
• Selenium server, grid
– Run tests on remote machines
• http://www.seleniumhq.org
23. www.ics.ug #icsug
Demo 2 - scenario
• Same application as in Demo 1
• Maven driven build on Jenkins
– Compile and run tests using Tycho/OSGi
– Build NSF from ODP – Maven plugin
– Run Selenium tests
• Copy NSF to server – Ant task
• Load data – calling an Agent using URL
26. www.ics.ug #icsug
Demo 2 - notes
• https://bitbucket.org/pradnik/ics.ug-demo
• mvn clean verify –P complete
• Jenkins running as a service
– Allow to interact with desktop
– SCM Poll since running as local VM (not optimal)
• Maven settings
– using Config File Provider plugin
– <notes-platform> for Domino Update Site
– <ddehd.notesdata> for Designer data directory
• Profile for just testing
• Some properties are hard coded in pom.xml
PowerMock is a framework that extend other mock libraries such as EasyMock with more powerful capabilities. PowerMock uses a custom classloader and bytecode manipulation to enable mocking of static methods, constructors, final classes and methods, private methods, removal of static initializers and more.