16
© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Condential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Condential. Integration Testing in AEM Lydia Balazs | Senior QE Developer

Integration Testing in AEM

  • Upload
    cqcon

  • View
    1.156

  • Download
    4

Embed Size (px)

DESCRIPTION

Presentation “Integration Testing in AEM“ by Lydia Balazs at CQCON2013 in Basel on 19 and 20 June 2013.

Citation preview

Page 1: 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

Page 2: Integration Testing in AEM

© 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

Page 3: Integration Testing in AEM

© 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

Page 4: Integration Testing in AEM

© 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

Page 5: 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 – #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

Page 6: Integration Testing in AEM

© 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

Page 7: Integration Testing in AEM

© 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

Page 8: Integration Testing in AEM

© 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

Page 9: Integration Testing in AEM

© 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

Page 10: Integration Testing in AEM

© 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

Page 11: Integration Testing in AEM

© 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

Page 12: Integration Testing in AEM

© 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

Page 13: Integration Testing in AEM

© 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

Page 14: Integration Testing in AEM

© 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!

Page 15: Integration Testing in AEM

© 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

Page 16: Integration Testing in AEM

© 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential. © 2013 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.