SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
How to
automatically unit and integration test
your Digital Factory modules
#jahiaone
Benjamin Papež, QA Architect
© 2002 - 2015 Jahia Solutions Group SA
Motivation to automate
Test automation saves time and money
Fast feedback on continuous integration
Repetitive manual regression tests are
boring and make testers lose focus
Easier to reproduce certain bugs
Allows for faster upgrades or refactoring
© 2002 - 2015 Jahia Solutions Group SA
Unit tests
 Narrow in scope
 No dependencies on
code outside the tested
unit (use mocks/stubs)
 Runs very fast
 Easy to start in
development environment
Integration tests
 Test how parts of the
system work together
 Easier to write
(dependent services are
available)
 Run slower
 Usually need some setup,
deployment, configuration
© 2002 - 2015 Jahia Solutions Group SA
Unit versus integration tests
Digital factory automated
core tests overview
78 unit tests (2 minutes)
1712 integration tests (50 minutes)
209 functional tests - Selenium (11 hours, however
together with setup/deployment its 23 hours)
Automated performance test (3 hours)
Sonar static source code analysis (25 minutes)
© 2002 - 2015 Jahia Solutions Group SA
Unit tests
 Developers traditionally
develop integration tests
 Tested classes very often
have dependencies (JCR,
other services, Spring)
 Mocking/stubbing takes
time
Integration tests
 Not part of the build
 They run for a long time
and it takes time to setup
the environment, so
developers are not
running them locally
© 2002 - 2015 Jahia Solutions Group SA
Where are the problems
Integration tests with Spring
spring-test module allows for integration testing
without deployment to application server
Spring application context is available
Database and JCR access is available
Its slower than unit tests, but much faster than with
starting up a remote application server and
deploying to it
With automated configuration tests are run directly
on compiling modules or within IDE like unit tests
© 2002 - 2015 Jahia Solutions Group SA
module-test-framework
(from 7.1 onwards)
 Copies temporary files needed to startup the repository
 Overrides and starts the Jahia Spring application context with
main core services started and unimportant ones mocked
 Runs all Quartz schedulers as RAM schedulers
 Registers nodetypes, rules and import XML files of the current
module (you can have additional such files for test)
 Ability to deploy a site (however without templates)
 No OSGI, no JSP / UI testing, no access to other modules or
its content (e.g. systemsite)
© 2002 - 2015 Jahia Solutions Group SA
module-test-framework
(from 7.1 onwards)
To use that framework define a test
dependency in your module‘s pom.xml
© 2002 - 2015 Jahia Solutions Group SA
<dependencies>
<dependency>
<groupId>org.jahia.test</groupId>
<artifactId>module-test-framework</artifactId>
<version>7.1.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
How to write tests (1)
TestNG:
© 2002 - 2015 Jahia Solutions Group SA
import org.jahia.test.framework.AbstractTestNGTest;
import org.jahia.test.utils.TestHelper;
…
public class FacetedQueryTest extends AbstractTestNGTest {
@BeforeClass
public void oneTimeSetUp() throws Exception {
JahiaSite site = TestHelper.createSite(TESTSITE_NAME);
…
}
@AfterClass
public void oneTimeTearDown() throws Exception {
TestHelper.deleteSite(TESTSITE_NAME);
}
@Test
public void testSimpleFacets() throws Exception {
JCRSessionWrapper session = JCRSessionFactory.getInstance().
getCurrentUserSession(Constants.EDIT_WORKSPACE,
Locale.ENGLISH);
…
How to write tests (2)
JUnit: instead of static @BeforeClass, @AfterClass use:
© 2002 - 2015 Jahia Solutions Group SA
import org.jahia.test.framework.AbstractJUnitTest;
import org.jahia.test.utils.TestHelper;
…
public class FacetedQueryJUnitTest extends AbstractJUnitTest {
@Override
public void beforeClassSetup() throws Exception {
super.beforeClassSetup();
JahiaSite site = TestHelper.createSite(TESTSITE_NAME);
…
}
@Override
public void afterClassSetup() throws Exception {
super.afterClassSetup();
TestHelper.deleteSite(TESTSITE_NAME);
}
@Test
public void testSimpleFacets() throws Exception {
JCRSessionWrapper session = JCRSessionFactory.getInstance().
getCurrentUserSession(Constants.EDIT_WORKSPACE, Locale.ENGLISH);
…
How to execute tests (1)
Unit tests or integration tests with Spring:
Maven:
unit-tests profile is defined in jahia-parent pom.xml
Eclipse/IDEA - directly run or debug test class
with Junit/TestNG plugin
© 2002 - 2015 Jahia Solutions Group SA
your-module-path> mvn install -P unit-tests
How to execute tests (2)
Integration-tests running on remote
application server
Deploy JAR with test module (jahia-test-module)
Test classes need to be configured in Spring
© 2002 - 2015 Jahia Solutions Group SA
<bean class="org.jahia.test.bin.TestBean">
<property name="priority" value="56"/>
<property name="testCases">
<list>
<value>org.jahia.modules.external.test.db.ExternalDatabaseProviderTest</value>
</list>
</property>
</bean>
How to execute tests (3)
Maven (see http://subversion.jahia.org/svn/jahia/trunk/README)
All tests:
Single tests:
plugin uses url set in <jahia.test.url> parameter in
your settings.xml file
or test servlet URL
© 2002 - 2015 Jahia Solutions Group SA
mvn jahia:test surefire-report:report-only
mvn -Dtest=org.jahia.services.stuff.MyTest jahia:test surefire-report:report-only
http://<server:port>/<context>/cms/test/
http://<server:port>/<context>/cms/test/org.jahia.services.stuff.MyTest
Examples
 Unit-tests with Mockito:
 checkout jcrestapi module
https://github.com/Jahia/jcrestapi.git
src/test/org/jahia/modules/jcrestapi/accessors/
 checkout taglib module
http://subversion.jahia.org/svn/jahia/trunk/taglib/
src/test/org/jahia/taglibs/jcr/node/NodeComparatorTest.java
 Integration-test with Spring:
 checkout facets module
https://github.com/Jahia/facets.git
src/test/org/jahia/test/services/query/FacetedQueryTest.java
 checkout core module
http://subversion.jahia.org/svn/jahia/trunk/core/
src/test/org/jahia/services/tags/TaggingTest.java
© 2002 - 2015 Jahia Solutions Group SA
What lies ahead?
Creating/converting more tests to be run
during compilation
Enhancing the test framework
Provide different Spring context profiles
Evaluating Spring boot (Spring v4)
Providing reusable mocks and stubs if
requested
© 2002 - 2015 Jahia Solutions Group SA
Conclusion
 Start automating tests, either as
 Unit tests (with mocking/stubbing all dependencies)
 Integration tests with Spring
 Integration tests running on remote server
 Functional tests with Selenium
(attend JahiaOne presentation tomorrow)
 If you detect a Digital factory bug through your automated
test, send it to us
 It will help us recreate and fix the bug
 Test will be included in our build process to ensure it will not
occur again
© 2002 - 2015 Jahia Solutions Group SA
Questions
???
© 2002 - 2015 Jahia Solutions Group SA
Testing will eradicate bugs!
Thank you for your attention
#jahiaone
© 2002 - 2014 Jahia Solutions Group SA

Contenu connexe

Tendances

AngularJS for Web and Mobile
 AngularJS for Web and Mobile AngularJS for Web and Mobile
AngularJS for Web and MobileRocket Software
 
5 Essentials for Simplifiied Release Management and Continuous Delivery
5 Essentials for Simplifiied Release Management and Continuous Delivery5 Essentials for Simplifiied Release Management and Continuous Delivery
5 Essentials for Simplifiied Release Management and Continuous DeliverySalesforce Developers
 
VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...
VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...
VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...VMworld
 
Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법
Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법
Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법Mee Nam Lee
 
V mware horizon view™ accelerator service
V mware horizon view™ accelerator serviceV mware horizon view™ accelerator service
V mware horizon view™ accelerator servicesolarisyougood
 
Salesforce Release Management - Best Practices and Tools for Deployment
Salesforce Release Management - Best Practices and Tools for DeploymentSalesforce Release Management - Best Practices and Tools for Deployment
Salesforce Release Management - Best Practices and Tools for DeploymentSalesforce Developers
 
Methodologies 3: Using Spira for Waterfall
Methodologies 3: Using Spira for WaterfallMethodologies 3: Using Spira for Waterfall
Methodologies 3: Using Spira for WaterfallInflectra
 
Building Applications Using the U2 Toolkit for .NET
Building Applications Using the U2 Toolkit for .NETBuilding Applications Using the U2 Toolkit for .NET
Building Applications Using the U2 Toolkit for .NETRocket Software
 
SpiraPlan Overview Presentation (2021)
SpiraPlan Overview Presentation (2021)SpiraPlan Overview Presentation (2021)
SpiraPlan Overview Presentation (2021)Inflectra
 
JahiaOne - Upgrade to Jahia7 in 10 minutes
JahiaOne - Upgrade to Jahia7 in 10 minutesJahiaOne - Upgrade to Jahia7 in 10 minutes
JahiaOne - Upgrade to Jahia7 in 10 minutesJahia Solutions Group
 
Don't Let Your Users be Your Testers - Lunch & Learn
Don't Let Your Users be Your Testers - Lunch & LearnDon't Let Your Users be Your Testers - Lunch & Learn
Don't Let Your Users be Your Testers - Lunch & LearnAdam Sandman
 
ITIL, Release Management and Automation
ITIL, Release Management and AutomationITIL, Release Management and Automation
ITIL, Release Management and AutomationIBM UrbanCode Products
 
SQADAYS 21 Moscow 2017
SQADAYS 21 Moscow 2017SQADAYS 21 Moscow 2017
SQADAYS 21 Moscow 2017Adam Sandman
 
Upgrading to Oracle SOA 12.1 & 12.2 - Practical Steps and Project Experiences
Upgrading to Oracle SOA 12.1 & 12.2 - Practical Steps and Project ExperiencesUpgrading to Oracle SOA 12.1 & 12.2 - Practical Steps and Project Experiences
Upgrading to Oracle SOA 12.1 & 12.2 - Practical Steps and Project ExperiencesBruno Alves
 
Oracle SOA Suite 11g Troubleshooting Methodology
Oracle SOA Suite 11g Troubleshooting MethodologyOracle SOA Suite 11g Troubleshooting Methodology
Oracle SOA Suite 11g Troubleshooting MethodologyRevelation Technologies
 
Alexyj Kovaliov "Waterfalling to Agile"
Alexyj Kovaliov "Waterfalling to Agile" Alexyj Kovaliov "Waterfalling to Agile"
Alexyj Kovaliov "Waterfalling to Agile" Agile Lietuva
 
Managing Change With A Sensible Sandbox Architecture
Managing Change With A Sensible Sandbox ArchitectureManaging Change With A Sensible Sandbox Architecture
Managing Change With A Sensible Sandbox ArchitectureAlexander Sutherland
 
Introduce yourself to java 17
Introduce yourself to java 17Introduce yourself to java 17
Introduce yourself to java 17ankitbhandari32
 

Tendances (20)

AngularJS for Web and Mobile
 AngularJS for Web and Mobile AngularJS for Web and Mobile
AngularJS for Web and Mobile
 
5 Essentials for Simplifiied Release Management and Continuous Delivery
5 Essentials for Simplifiied Release Management and Continuous Delivery5 Essentials for Simplifiied Release Management and Continuous Delivery
5 Essentials for Simplifiied Release Management and Continuous Delivery
 
VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...
VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...
VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...
 
Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법
Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법
Oracle Cloud에서 애플리케이션을 개발하고 테스트하는 손쉬운 방법
 
V mware horizon view™ accelerator service
V mware horizon view™ accelerator serviceV mware horizon view™ accelerator service
V mware horizon view™ accelerator service
 
Salesforce Release Management - Best Practices and Tools for Deployment
Salesforce Release Management - Best Practices and Tools for DeploymentSalesforce Release Management - Best Practices and Tools for Deployment
Salesforce Release Management - Best Practices and Tools for Deployment
 
Methodologies 3: Using Spira for Waterfall
Methodologies 3: Using Spira for WaterfallMethodologies 3: Using Spira for Waterfall
Methodologies 3: Using Spira for Waterfall
 
Building Applications Using the U2 Toolkit for .NET
Building Applications Using the U2 Toolkit for .NETBuilding Applications Using the U2 Toolkit for .NET
Building Applications Using the U2 Toolkit for .NET
 
JavaCro'15 - Managing Java at Scale Security and Compatibility Applications -...
JavaCro'15 - Managing Java at Scale Security and Compatibility Applications -...JavaCro'15 - Managing Java at Scale Security and Compatibility Applications -...
JavaCro'15 - Managing Java at Scale Security and Compatibility Applications -...
 
SpiraPlan Overview Presentation (2021)
SpiraPlan Overview Presentation (2021)SpiraPlan Overview Presentation (2021)
SpiraPlan Overview Presentation (2021)
 
JahiaOne - Upgrade to Jahia7 in 10 minutes
JahiaOne - Upgrade to Jahia7 in 10 minutesJahiaOne - Upgrade to Jahia7 in 10 minutes
JahiaOne - Upgrade to Jahia7 in 10 minutes
 
Don't Let Your Users be Your Testers - Lunch & Learn
Don't Let Your Users be Your Testers - Lunch & LearnDon't Let Your Users be Your Testers - Lunch & Learn
Don't Let Your Users be Your Testers - Lunch & Learn
 
ITIL, Release Management and Automation
ITIL, Release Management and AutomationITIL, Release Management and Automation
ITIL, Release Management and Automation
 
SQADAYS 21 Moscow 2017
SQADAYS 21 Moscow 2017SQADAYS 21 Moscow 2017
SQADAYS 21 Moscow 2017
 
Upgrading to Oracle SOA 12.1 & 12.2 - Practical Steps and Project Experiences
Upgrading to Oracle SOA 12.1 & 12.2 - Practical Steps and Project ExperiencesUpgrading to Oracle SOA 12.1 & 12.2 - Practical Steps and Project Experiences
Upgrading to Oracle SOA 12.1 & 12.2 - Practical Steps and Project Experiences
 
Em13c features- HotSos 2016
Em13c features- HotSos 2016Em13c features- HotSos 2016
Em13c features- HotSos 2016
 
Oracle SOA Suite 11g Troubleshooting Methodology
Oracle SOA Suite 11g Troubleshooting MethodologyOracle SOA Suite 11g Troubleshooting Methodology
Oracle SOA Suite 11g Troubleshooting Methodology
 
Alexyj Kovaliov "Waterfalling to Agile"
Alexyj Kovaliov "Waterfalling to Agile" Alexyj Kovaliov "Waterfalling to Agile"
Alexyj Kovaliov "Waterfalling to Agile"
 
Managing Change With A Sensible Sandbox Architecture
Managing Change With A Sensible Sandbox ArchitectureManaging Change With A Sensible Sandbox Architecture
Managing Change With A Sensible Sandbox Architecture
 
Introduce yourself to java 17
Introduce yourself to java 17Introduce yourself to java 17
Introduce yourself to java 17
 

Similaire à JahiaOne 2015 - How to automatically unit and integration test your Digital Factory modules

Turbocharge Your Automation Framework to Shorten Regression Execution Time
Turbocharge Your Automation Framework to Shorten Regression Execution TimeTurbocharge Your Automation Framework to Shorten Regression Execution Time
Turbocharge Your Automation Framework to Shorten Regression Execution TimeJosiah Renaudin
 
03 test specification and execution
03   test specification and execution03   test specification and execution
03 test specification and executionClemens Reijnen
 
XML2Selenium Technical Presentation
XML2Selenium Technical PresentationXML2Selenium Technical Presentation
XML2Selenium Technical Presentationjazzteam
 
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.Richard Langlois P. Eng.
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Appschrisb206 chrisb206
 
Test Director Ppt Training
Test Director Ppt TrainingTest Director Ppt Training
Test Director Ppt Trainingshrikantg
 
Интеграция решения по тестированию производительности в существующий фреймвор...
Интеграция решения по тестированию производительности в существующий фреймвор...Интеграция решения по тестированию производительности в существующий фреймвор...
Интеграция решения по тестированию производительности в существующий фреймвор...COMAQA.BY
 
Automated Testing on Web Applications
Automated Testing on Web ApplicationsAutomated Testing on Web Applications
Automated Testing on Web ApplicationsSamuel Borg
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With SeleniumMarakana Inc.
 
The 2014 Decision Makers Guide to Java Web Frameworks
The 2014 Decision Makers Guide to Java Web FrameworksThe 2014 Decision Makers Guide to Java Web Frameworks
The 2014 Decision Makers Guide to Java Web FrameworksKunal Ashar
 
DevOps CI Automation Continuous Integration
DevOps CI Automation Continuous IntegrationDevOps CI Automation Continuous Integration
DevOps CI Automation Continuous IntegrationIRJET Journal
 
Overview of Lab Management and TFS
Overview of Lab Management and TFSOverview of Lab Management and TFS
Overview of Lab Management and TFSChris Kadel, MBA
 
How to Build and Maintain Quality Drupal Sites with Automated Testing
How to Build and Maintain Quality Drupal Sites with Automated TestingHow to Build and Maintain Quality Drupal Sites with Automated Testing
How to Build and Maintain Quality Drupal Sites with Automated TestingAcquia
 
Incorporating Performance Testing in Agile Development Process
Incorporating Performance Testing in Agile Development ProcessIncorporating Performance Testing in Agile Development Process
Incorporating Performance Testing in Agile Development ProcessMichael Vax
 
Simple test drupal7_presentation_la_drupal_jul21-2010
Simple test drupal7_presentation_la_drupal_jul21-2010Simple test drupal7_presentation_la_drupal_jul21-2010
Simple test drupal7_presentation_la_drupal_jul21-2010Miguel Hernandez
 
Microsoft Testing Tour - Setting up a Test Environment
Microsoft Testing Tour - Setting up a Test EnvironmentMicrosoft Testing Tour - Setting up a Test Environment
Microsoft Testing Tour - Setting up a Test EnvironmentAngela Dugan
 

Similaire à JahiaOne 2015 - How to automatically unit and integration test your Digital Factory modules (20)

Test ng for testers
Test ng for testersTest ng for testers
Test ng for testers
 
Turbocharge Your Automation Framework to Shorten Regression Execution Time
Turbocharge Your Automation Framework to Shorten Regression Execution TimeTurbocharge Your Automation Framework to Shorten Regression Execution Time
Turbocharge Your Automation Framework to Shorten Regression Execution Time
 
03 test specification and execution
03   test specification and execution03   test specification and execution
03 test specification and execution
 
XML2Selenium Technical Presentation
XML2Selenium Technical PresentationXML2Selenium Technical Presentation
XML2Selenium Technical Presentation
 
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
 
Test Director Ppt Training
Test Director Ppt TrainingTest Director Ppt Training
Test Director Ppt Training
 
Интеграция решения по тестированию производительности в существующий фреймвор...
Интеграция решения по тестированию производительности в существующий фреймвор...Интеграция решения по тестированию производительности в существующий фреймвор...
Интеграция решения по тестированию производительности в существующий фреймвор...
 
Automated Testing on Web Applications
Automated Testing on Web ApplicationsAutomated Testing on Web Applications
Automated Testing on Web Applications
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 
The 2014 Decision Makers Guide to Java Web Frameworks
The 2014 Decision Makers Guide to Java Web FrameworksThe 2014 Decision Makers Guide to Java Web Frameworks
The 2014 Decision Makers Guide to Java Web Frameworks
 
DevOps CI Automation Continuous Integration
DevOps CI Automation Continuous IntegrationDevOps CI Automation Continuous Integration
DevOps CI Automation Continuous Integration
 
Overview of Lab Management and TFS
Overview of Lab Management and TFSOverview of Lab Management and TFS
Overview of Lab Management and TFS
 
How to Build and Maintain Quality Drupal Sites with Automated Testing
How to Build and Maintain Quality Drupal Sites with Automated TestingHow to Build and Maintain Quality Drupal Sites with Automated Testing
How to Build and Maintain Quality Drupal Sites with Automated Testing
 
Incorporating Performance Testing in Agile Development Process
Incorporating Performance Testing in Agile Development ProcessIncorporating Performance Testing in Agile Development Process
Incorporating Performance Testing in Agile Development Process
 
Simple test drupal7_presentation_la_drupal_jul21-2010
Simple test drupal7_presentation_la_drupal_jul21-2010Simple test drupal7_presentation_la_drupal_jul21-2010
Simple test drupal7_presentation_la_drupal_jul21-2010
 
V-TEST
V-TESTV-TEST
V-TEST
 
Maven advanced
Maven advancedMaven advanced
Maven advanced
 
Microsoft Testing Tour - Setting up a Test Environment
Microsoft Testing Tour - Setting up a Test EnvironmentMicrosoft Testing Tour - Setting up a Test Environment
Microsoft Testing Tour - Setting up a Test Environment
 
Testing In Java
Testing In JavaTesting In Java
Testing In Java
 

Plus de Jahia Solutions Group

The Road ahead: What we see as the future of digital. By Elie Auvray
The Road ahead: What we see as the future of digital. By Elie AuvrayThe Road ahead: What we see as the future of digital. By Elie Auvray
The Road ahead: What we see as the future of digital. By Elie AuvrayJahia Solutions Group
 
Monitoring and Data-Driven Decision Making with Daniel Maher
Monitoring and Data-Driven Decision Making with Daniel MaherMonitoring and Data-Driven Decision Making with Daniel Maher
Monitoring and Data-Driven Decision Making with Daniel MaherJahia Solutions Group
 
The ultimate search of the perfect customer experience By Brian Solis
The ultimate search of the perfect customer experience By Brian SolisThe ultimate search of the perfect customer experience By Brian Solis
The ultimate search of the perfect customer experience By Brian SolisJahia Solutions Group
 
Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...
Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...
Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...Jahia Solutions Group
 
Data for Dummies by Dan Katz, CDO at Safran
Data for Dummies by Dan Katz, CDO at SafranData for Dummies by Dan Katz, CDO at Safran
Data for Dummies by Dan Katz, CDO at SafranJahia Solutions Group
 
Content and commerce: The perfect combo. By Catherine Barba
Content and commerce: The perfect combo. By Catherine BarbaContent and commerce: The perfect combo. By Catherine Barba
Content and commerce: The perfect combo. By Catherine BarbaJahia Solutions Group
 
The power of great customer experience in today’s world. Olivier Mourrieras &...
The power of great customer experience in today’s world. Olivier Mourrieras &...The power of great customer experience in today’s world. Olivier Mourrieras &...
The power of great customer experience in today’s world. Olivier Mourrieras &...Jahia Solutions Group
 
Making Digital simpler. Occam’s Razor, Horses, Zebras, and Evolution
Making Digital simpler. Occam’s Razor, Horses, Zebras, and EvolutionMaking Digital simpler. Occam’s Razor, Horses, Zebras, and Evolution
Making Digital simpler. Occam’s Razor, Horses, Zebras, and EvolutionJahia Solutions Group
 
Elasticsearch powered EDP by Cedric Mailleux
Elasticsearch powered EDP by Cedric MailleuxElasticsearch powered EDP by Cedric Mailleux
Elasticsearch powered EDP by Cedric MailleuxJahia Solutions Group
 
Jahia Cloud Offerings by Julian Maurel & Abass Safoutou
Jahia Cloud Offerings by Julian Maurel & Abass SafoutouJahia Cloud Offerings by Julian Maurel & Abass Safoutou
Jahia Cloud Offerings by Julian Maurel & Abass SafoutouJahia Solutions Group
 
Learn how to go headless with Jahia DX by Serge Huber
Learn how to go headless with Jahia DX by Serge HuberLearn how to go headless with Jahia DX by Serge Huber
Learn how to go headless with Jahia DX by Serge HuberJahia Solutions Group
 
Making the life of patients easier in the healthcare sector thanks to digital...
Making the life of patients easier in the healthcare sector thanks to digital...Making the life of patients easier in the healthcare sector thanks to digital...
Making the life of patients easier in the healthcare sector thanks to digital...Jahia Solutions Group
 
Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...
Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...
Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...Jahia Solutions Group
 
Strategy for content with local and global sites by Romain Gauthier
Strategy for content with local and global sites by Romain GauthierStrategy for content with local and global sites by Romain Gauthier
Strategy for content with local and global sites by Romain GauthierJahia Solutions Group
 
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO JahiaApache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO JahiaJahia Solutions Group
 
Personalisation and Headless in a business context by Lars Petersen
Personalisation and Headless in a business context by Lars PetersenPersonalisation and Headless in a business context by Lars Petersen
Personalisation and Headless in a business context by Lars PetersenJahia Solutions Group
 
Digital Revolution from Silo to Platform by Gilles Babinet
Digital Revolution from Silo to Platform by Gilles BabinetDigital Revolution from Silo to Platform by Gilles Babinet
Digital Revolution from Silo to Platform by Gilles BabinetJahia Solutions Group
 
A customer journey with AI by Xavier Vaccari, Softeam Group
A customer journey with AI by Xavier Vaccari, Softeam GroupA customer journey with AI by Xavier Vaccari, Softeam Group
A customer journey with AI by Xavier Vaccari, Softeam GroupJahia Solutions Group
 
Using CX to unlock Total Experience by David Balko, Tribal
Using CX to unlock Total Experience by David Balko, TribalUsing CX to unlock Total Experience by David Balko, Tribal
Using CX to unlock Total Experience by David Balko, TribalJahia Solutions Group
 
AI-monitor & Marketing Factory, customer case study by Valerie Voci
AI-monitor & Marketing Factory, customer case study by Valerie VociAI-monitor & Marketing Factory, customer case study by Valerie Voci
AI-monitor & Marketing Factory, customer case study by Valerie VociJahia Solutions Group
 

Plus de Jahia Solutions Group (20)

The Road ahead: What we see as the future of digital. By Elie Auvray
The Road ahead: What we see as the future of digital. By Elie AuvrayThe Road ahead: What we see as the future of digital. By Elie Auvray
The Road ahead: What we see as the future of digital. By Elie Auvray
 
Monitoring and Data-Driven Decision Making with Daniel Maher
Monitoring and Data-Driven Decision Making with Daniel MaherMonitoring and Data-Driven Decision Making with Daniel Maher
Monitoring and Data-Driven Decision Making with Daniel Maher
 
The ultimate search of the perfect customer experience By Brian Solis
The ultimate search of the perfect customer experience By Brian SolisThe ultimate search of the perfect customer experience By Brian Solis
The ultimate search of the perfect customer experience By Brian Solis
 
Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...
Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...
Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...
 
Data for Dummies by Dan Katz, CDO at Safran
Data for Dummies by Dan Katz, CDO at SafranData for Dummies by Dan Katz, CDO at Safran
Data for Dummies by Dan Katz, CDO at Safran
 
Content and commerce: The perfect combo. By Catherine Barba
Content and commerce: The perfect combo. By Catherine BarbaContent and commerce: The perfect combo. By Catherine Barba
Content and commerce: The perfect combo. By Catherine Barba
 
The power of great customer experience in today’s world. Olivier Mourrieras &...
The power of great customer experience in today’s world. Olivier Mourrieras &...The power of great customer experience in today’s world. Olivier Mourrieras &...
The power of great customer experience in today’s world. Olivier Mourrieras &...
 
Making Digital simpler. Occam’s Razor, Horses, Zebras, and Evolution
Making Digital simpler. Occam’s Razor, Horses, Zebras, and EvolutionMaking Digital simpler. Occam’s Razor, Horses, Zebras, and Evolution
Making Digital simpler. Occam’s Razor, Horses, Zebras, and Evolution
 
Elasticsearch powered EDP by Cedric Mailleux
Elasticsearch powered EDP by Cedric MailleuxElasticsearch powered EDP by Cedric Mailleux
Elasticsearch powered EDP by Cedric Mailleux
 
Jahia Cloud Offerings by Julian Maurel & Abass Safoutou
Jahia Cloud Offerings by Julian Maurel & Abass SafoutouJahia Cloud Offerings by Julian Maurel & Abass Safoutou
Jahia Cloud Offerings by Julian Maurel & Abass Safoutou
 
Learn how to go headless with Jahia DX by Serge Huber
Learn how to go headless with Jahia DX by Serge HuberLearn how to go headless with Jahia DX by Serge Huber
Learn how to go headless with Jahia DX by Serge Huber
 
Making the life of patients easier in the healthcare sector thanks to digital...
Making the life of patients easier in the healthcare sector thanks to digital...Making the life of patients easier in the healthcare sector thanks to digital...
Making the life of patients easier in the healthcare sector thanks to digital...
 
Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...
Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...
Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...
 
Strategy for content with local and global sites by Romain Gauthier
Strategy for content with local and global sites by Romain GauthierStrategy for content with local and global sites by Romain Gauthier
Strategy for content with local and global sites by Romain Gauthier
 
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO JahiaApache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
 
Personalisation and Headless in a business context by Lars Petersen
Personalisation and Headless in a business context by Lars PetersenPersonalisation and Headless in a business context by Lars Petersen
Personalisation and Headless in a business context by Lars Petersen
 
Digital Revolution from Silo to Platform by Gilles Babinet
Digital Revolution from Silo to Platform by Gilles BabinetDigital Revolution from Silo to Platform by Gilles Babinet
Digital Revolution from Silo to Platform by Gilles Babinet
 
A customer journey with AI by Xavier Vaccari, Softeam Group
A customer journey with AI by Xavier Vaccari, Softeam GroupA customer journey with AI by Xavier Vaccari, Softeam Group
A customer journey with AI by Xavier Vaccari, Softeam Group
 
Using CX to unlock Total Experience by David Balko, Tribal
Using CX to unlock Total Experience by David Balko, TribalUsing CX to unlock Total Experience by David Balko, Tribal
Using CX to unlock Total Experience by David Balko, Tribal
 
AI-monitor & Marketing Factory, customer case study by Valerie Voci
AI-monitor & Marketing Factory, customer case study by Valerie VociAI-monitor & Marketing Factory, customer case study by Valerie Voci
AI-monitor & Marketing Factory, customer case study by Valerie Voci
 

Dernier

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Dernier (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

JahiaOne 2015 - How to automatically unit and integration test your Digital Factory modules

  • 1. How to automatically unit and integration test your Digital Factory modules #jahiaone Benjamin Papež, QA Architect © 2002 - 2015 Jahia Solutions Group SA
  • 2. Motivation to automate Test automation saves time and money Fast feedback on continuous integration Repetitive manual regression tests are boring and make testers lose focus Easier to reproduce certain bugs Allows for faster upgrades or refactoring © 2002 - 2015 Jahia Solutions Group SA
  • 3. Unit tests  Narrow in scope  No dependencies on code outside the tested unit (use mocks/stubs)  Runs very fast  Easy to start in development environment Integration tests  Test how parts of the system work together  Easier to write (dependent services are available)  Run slower  Usually need some setup, deployment, configuration © 2002 - 2015 Jahia Solutions Group SA Unit versus integration tests
  • 4. Digital factory automated core tests overview 78 unit tests (2 minutes) 1712 integration tests (50 minutes) 209 functional tests - Selenium (11 hours, however together with setup/deployment its 23 hours) Automated performance test (3 hours) Sonar static source code analysis (25 minutes) © 2002 - 2015 Jahia Solutions Group SA
  • 5. Unit tests  Developers traditionally develop integration tests  Tested classes very often have dependencies (JCR, other services, Spring)  Mocking/stubbing takes time Integration tests  Not part of the build  They run for a long time and it takes time to setup the environment, so developers are not running them locally © 2002 - 2015 Jahia Solutions Group SA Where are the problems
  • 6. Integration tests with Spring spring-test module allows for integration testing without deployment to application server Spring application context is available Database and JCR access is available Its slower than unit tests, but much faster than with starting up a remote application server and deploying to it With automated configuration tests are run directly on compiling modules or within IDE like unit tests © 2002 - 2015 Jahia Solutions Group SA
  • 7. module-test-framework (from 7.1 onwards)  Copies temporary files needed to startup the repository  Overrides and starts the Jahia Spring application context with main core services started and unimportant ones mocked  Runs all Quartz schedulers as RAM schedulers  Registers nodetypes, rules and import XML files of the current module (you can have additional such files for test)  Ability to deploy a site (however without templates)  No OSGI, no JSP / UI testing, no access to other modules or its content (e.g. systemsite) © 2002 - 2015 Jahia Solutions Group SA
  • 8. module-test-framework (from 7.1 onwards) To use that framework define a test dependency in your module‘s pom.xml © 2002 - 2015 Jahia Solutions Group SA <dependencies> <dependency> <groupId>org.jahia.test</groupId> <artifactId>module-test-framework</artifactId> <version>7.1.0.0</version> <scope>test</scope> </dependency> </dependencies>
  • 9. How to write tests (1) TestNG: © 2002 - 2015 Jahia Solutions Group SA import org.jahia.test.framework.AbstractTestNGTest; import org.jahia.test.utils.TestHelper; … public class FacetedQueryTest extends AbstractTestNGTest { @BeforeClass public void oneTimeSetUp() throws Exception { JahiaSite site = TestHelper.createSite(TESTSITE_NAME); … } @AfterClass public void oneTimeTearDown() throws Exception { TestHelper.deleteSite(TESTSITE_NAME); } @Test public void testSimpleFacets() throws Exception { JCRSessionWrapper session = JCRSessionFactory.getInstance(). getCurrentUserSession(Constants.EDIT_WORKSPACE, Locale.ENGLISH); …
  • 10. How to write tests (2) JUnit: instead of static @BeforeClass, @AfterClass use: © 2002 - 2015 Jahia Solutions Group SA import org.jahia.test.framework.AbstractJUnitTest; import org.jahia.test.utils.TestHelper; … public class FacetedQueryJUnitTest extends AbstractJUnitTest { @Override public void beforeClassSetup() throws Exception { super.beforeClassSetup(); JahiaSite site = TestHelper.createSite(TESTSITE_NAME); … } @Override public void afterClassSetup() throws Exception { super.afterClassSetup(); TestHelper.deleteSite(TESTSITE_NAME); } @Test public void testSimpleFacets() throws Exception { JCRSessionWrapper session = JCRSessionFactory.getInstance(). getCurrentUserSession(Constants.EDIT_WORKSPACE, Locale.ENGLISH); …
  • 11. How to execute tests (1) Unit tests or integration tests with Spring: Maven: unit-tests profile is defined in jahia-parent pom.xml Eclipse/IDEA - directly run or debug test class with Junit/TestNG plugin © 2002 - 2015 Jahia Solutions Group SA your-module-path> mvn install -P unit-tests
  • 12. How to execute tests (2) Integration-tests running on remote application server Deploy JAR with test module (jahia-test-module) Test classes need to be configured in Spring © 2002 - 2015 Jahia Solutions Group SA <bean class="org.jahia.test.bin.TestBean"> <property name="priority" value="56"/> <property name="testCases"> <list> <value>org.jahia.modules.external.test.db.ExternalDatabaseProviderTest</value> </list> </property> </bean>
  • 13. How to execute tests (3) Maven (see http://subversion.jahia.org/svn/jahia/trunk/README) All tests: Single tests: plugin uses url set in <jahia.test.url> parameter in your settings.xml file or test servlet URL © 2002 - 2015 Jahia Solutions Group SA mvn jahia:test surefire-report:report-only mvn -Dtest=org.jahia.services.stuff.MyTest jahia:test surefire-report:report-only http://<server:port>/<context>/cms/test/ http://<server:port>/<context>/cms/test/org.jahia.services.stuff.MyTest
  • 14. Examples  Unit-tests with Mockito:  checkout jcrestapi module https://github.com/Jahia/jcrestapi.git src/test/org/jahia/modules/jcrestapi/accessors/  checkout taglib module http://subversion.jahia.org/svn/jahia/trunk/taglib/ src/test/org/jahia/taglibs/jcr/node/NodeComparatorTest.java  Integration-test with Spring:  checkout facets module https://github.com/Jahia/facets.git src/test/org/jahia/test/services/query/FacetedQueryTest.java  checkout core module http://subversion.jahia.org/svn/jahia/trunk/core/ src/test/org/jahia/services/tags/TaggingTest.java © 2002 - 2015 Jahia Solutions Group SA
  • 15. What lies ahead? Creating/converting more tests to be run during compilation Enhancing the test framework Provide different Spring context profiles Evaluating Spring boot (Spring v4) Providing reusable mocks and stubs if requested © 2002 - 2015 Jahia Solutions Group SA
  • 16. Conclusion  Start automating tests, either as  Unit tests (with mocking/stubbing all dependencies)  Integration tests with Spring  Integration tests running on remote server  Functional tests with Selenium (attend JahiaOne presentation tomorrow)  If you detect a Digital factory bug through your automated test, send it to us  It will help us recreate and fix the bug  Test will be included in our build process to ensure it will not occur again © 2002 - 2015 Jahia Solutions Group SA
  • 17. Questions ??? © 2002 - 2015 Jahia Solutions Group SA
  • 18. Testing will eradicate bugs! Thank you for your attention #jahiaone © 2002 - 2014 Jahia Solutions Group SA