Integration Testing in AEM
-
Upload
connectwebex -
Category
Business
-
view
1.223 -
download
4
Transcript of Integration Testing in AEM
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
Integration Testing in AEM Lydia Balazs | Senior QE Developer
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
Who am I?
2
§ > 10 years CQ / AEM experience
§ Senior Quality Engineer Developer, located in Basel
§ Service Manager Germany
§ Training
§ Senior Consultant
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
Testing successfully integrated!
3
§ Responsibility of Developers and Quality Engineers
§ Part of AEM build
§ Releases are depending on the status of the test results
§ Code Coverage
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
How did we do that?
4
§ Main responsibility: Quality Assurance team in Basel (Core team)
§ Different AEM teams work closely together
§ Core
§ Digital Asset Management (DAM)
§ Social Collaboration (SoCo)
§ Marketing Campaign Management (MCM)
§ AEM teams stick to the same process
§ AEM teams use the same infrastructure incl. Integration Testing Framework
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
Integration Testing in AEM – #e Process!
5
WRITE PRODUCT
CODE
DEV
WRITE IT
QA
DEV
COLLECT IT
MODULES
QA
EXECUTE IT
QA
PUBLISH RESULTS
QA
IT = Integration Tests DEV = Developer QA = Quality Assurance
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
WRITE [PRODUCT CODE]
§ New features
§ Optimization
§ Bug !xing
§ Refactoring
6
WRITE PRODUCT
CODE
DEV
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
WRITE [IT]
§ DEV writes IT
§ In a module which is close to his code
§ QA writes IT
§ In separate projects / modules
§ JUnit tests
§ è A JAR artifact with an “integrationtest” classi!er is built
7
WRITE IT
DEV
QA
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
COLLECT ALL [IT]
§ Maven Dependency Plugin
§ Copies or unpacks dependencies or artifacts
§ Artifacts are fetched from local or remote Maven repositories
8
COLLECT IT
MODULES
QA
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
EXECUTE ALL [IT]
§ Maven Failsafe Plugin
§ Executes integration tests in their own VM
§ Quickstart Maven Plugin
§ Designed by Adobe to generate Quickstart products
§ Has other interesting goals (wait for it)
§ Test Runner
§ A POM !le specialized in fetching IT modules, !ltering and running ITs
9
EXECUTE IT
QA
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
Quickstart Maven Plugin
§ Available in Adobe Public Maven Repository
§ Group id: com.adobe.granite.maven
§ Artifact id: quickstart-maven-plugin
§ #e interesting goals I was talking about
§ Install, start and stop multiple quickstart instances (author / publish)
§ Use random port
§ Use custom context root
§ Install bundles
10
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
Test Runner
§ Provides different pro!les to
§ Select which IT modules to collect
§ Filter ITs (by supported Java version, package name, category)
§ Select the right AEM version to install
§ Enable code coverage analysis
11
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
Test Runner - Categories
§ Non-Failing
§ Failing
§ SmokeTest
§ All [IT] marked with category “SmokeTest” are executed during each build of AEM
è Make sure that the basic functionality of the system is not broken
§ A good smoke test is fast, simple and reliable!
12
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
Test Runner
§ Execution
§ Supports AEM versions > 5.5
§ Collect the right IT modules for each supported AEM version
è Combination of different pro!les allows Jenkins Matrix Jobs (a.k.a. Multiple Con!guration Projects)
13
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
Test Runner
14
• Author URL • Publish URL • Context Root
TEST RUNNER
• Con!gure HTTP Clients • Provides simple access to
AEM HTTP API • Other testing utilities
(Custom Assertion, JSON, …)
IT FRAMEWORK • Run IT via HTTP against a
Sling instance • Scriptable tests • Run JUnit tests
contributed by OSGi bundles
Sling Testing Tools
Sling Testing Tools: h$p://sling.apache.org/documentation/development/sling-testing-tools.html
AEM is RESTful!
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.
PUBLISH RESULTS [IT]
§ Continuous Integration (Jenkins)
§ Code Coverage (Maven JaCoCo Plugin + Sonar)
§ JaCoCo is a code coverage library for Java, which has been created by the EclEmma team
15
PUBLISH RESULTS
QA
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.