Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

AEM project archetype use of it.launcher and it.tests in project structure


Level 4

As per reference link, it.launcher and it.tests are related to server side unit tests.  When we are running maven command (mvn clean install -PautoInstallPackage), it just runs the jUnit tests inside core bundle.

I tried to search for logs of AEM, don't find any of log statements from server side unit tests in logs.

What is the use of it.launcher and it.tests folders and when are these tests run on server (Do we need to have some extra configuration for these), these don't seem to be running while installing package on AEM.



0 Replies


Level 10

You can test your AEM Java code by using the Test class that is generated for you when you build an Adobe Maven 11+ Archetype project.

For example, assume you create a project named AEM633. Once you build this project, you will have a class named TestHelloWorldModel located in this package: (under src\test\java) 

All of the POM dependencies are setup for you. Create a simple interface in the Core package named Foo.


public interface Foo {

public String getName();


Then create an implementation class that uses a @Component annotation in the same package.


import org.osgi.service.component.annotations.Component;


public class FooImpl implements Foo{

public String getName()


  return "Scott" ;



This is about the most basic AEM class that you can build. It has one method that returns a static value for the getName method. Now the question is how can we test this method?

The answer is to use the TestHelloWorldModel class that already exists. You can create a Foo object and then test the getName method. See the bold code below.


import static org.junit.Assert.assertNotNull;

import static org.junit.Assert.assertTrue;

import static org.mockito.Mockito.mock;

import static org.mockito.Mockito.when;

import java.util.UUID;

import junitx.util.PrivateAccessor;


import org.junit.Before;

import org.junit.Test;




* Simple JUnit test verifying the HelloWorldModel


public class TestHelloWorldModel {


    private HelloWorldModel hello;


    private Foo myFoo; 


    private String slingId;




    public void setup() throws Exception {

        SlingSettingsService settings = mock(SlingSettingsService.class);

        slingId = UUID.randomUUID().toString();


        hello = new HelloWorldModel();

        PrivateAccessor.setField(hello, "settings", settings);



        myFoo = new FooImpl();





    public void testGetMessage() throws Exception {

        // some very basic junit tests

        String msg = hello.getMessage();


        assertTrue(msg.length() > 0);






    public void testFooMessage() throws Exception {


        //custom service

        String msgFoo = myFoo.getName() ;


        assertTrue(msgFoo.length() > 0);



When you build the Maven project (for example, mvn clean install), you can see the Test results that are written to this file:



Level 4

Hello smacdonald2008​,

Thank you for your response. The way you shared is one way to test the Model classes (inside core folder). it.launcher and it.tests folders are still not clear, what is the use in project structure and when they are run.




Level 1

Hi! I'm leaving some info for any who need answers to these AEM modules (mainly to explain ui.launcher & ui.tests better)

Screenshot 2022-07-21 131737.png