0
votes

I'm trying to execute a JUnit test on an Adobe AEM instance, using the JUnit class. first created arctype maven project I've defined my testcase inside test folder and was expecting to be able to see it at this URL

http://localhost:4502/system/sling/junit/

It does not show up though.

The test runs correctly with mvn test. also mvn clean install through make a bundle

it's a very simple test case (junit4):

1
I created maven arc type project my test cases inside test folder .The test cases runs correctly with mvn test. also mvn clean install through make a bundle but It' doesn't show in localhost:4502/system/sling/junit I tried keeping the test class in main referring the example in net but it is not workingsuneel meena

1 Answers

0
votes

Your JUnit test cases are only executed during your maven builds. They will NOT be accessible over an URL.

I would suggest to use a mocking framework like JMockit, EasyMock, PowerMock or Mockito to mock the server side objects in your JUnit test cases.

The only way you can make something accessible over a URL is by creating SlingServlets. If you really want to execute those test cases using a servlet then create a servlet and call your JUnit test cases from your servlet(which I would not suggest).

Use Mocking frameworks instead.