Skip to main content
Oct 16, 2015 2:27 AM UTC
Solved

sling server side testing

I am trying to run server side unit testing as advised in the advance developer guide.

I am able to see my Test class under the URL" http://localhost:4502/system/sling/junit/tset.com.test.TestableClassTest.html " 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
joerghoh
joerghohAccepted solution
Adobe Employee
Oct 16, 2015 2:27 AM UTC

Hi,

Have you used the annotation "@TestReference" instead of the "@Reference" annotation in your unittests? Can you provide the sourcecode for your test class?

kind regards,
Jörg

2 replies

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
Oct 16, 2015 2:27 AM UTC

Hi,

Have you used the annotation "@TestReference" instead of the "@Reference" annotation in your unittests? Can you provide the sourcecode for your test class?

kind regards,
Jörg

Translate
Lokesh_Shivalingaiah
Level 10
Oct 16, 2015 2:27 AM UTC

instead of using annotation @reference to inject the repository, use BundleContext and that should work. refer [1]

[1] bundleContext.getServiceReference(ResourceResolverFactory.class.getName());

Translate