When it fails with the:
com.my.package.sling.junit.runners.ServerSideSampleTest >
initializationError FAILED
java.lang.AssertionError: expected:<7> but was:<4>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at org.junit.Assert.assertEquals(Assert.java:542)
All of the packages are active, but the JSON response from running the tests
is:
[{
"INFO_TYPE": "test",
"description":
"initializationError(com.snidigital.wcm.platform.test.example.sling.junit.tests.JUnit4Test)",
"failure":
"initializationError(com.snidigital.wcm.platform.test.example.sling.junit.tests.JUnit4Test):
No runnable methods"
},{
"INFO_TYPE": "test",
"description":
"initializationError(com.snidigital.wcm.platform.test.example.sling.junit.tests.OsgiAwareTest)",
"failure":
"initializationError(com.snidigital.wcm.platform.test.example.sling.junit.tests.OsgiAwareTest):
No runnable methods"
},{
"INFO_TYPE": "test",
"description":
"initializationError(com.snidigital.wcm.platform.test.example.sling.junit.tests.ParametrizedJunit4Test)",
"failure":
"initializationError(com.snidigital.wcm.platform.test.example.sling.junit.tests.ParametrizedJunit4Test):
Test class should have exactly one public zero-argument constructor"
},{
"INFO_TYPE": "test",
"description":
"initializationError(com.snidigital.wcm.platform.test.example.sling.junit.tests.ParametrizedJunit4Test)",
"failure":
"initializationError(com.snidigital.wcm.platform.test.example.sling.junit.tests.ParametrizedJunit4Test):
No runnable methods"
}
]
This never happens on the first run after starting up an OSGi environment,
only the second run and later. Is the sling junit runner maintaining some
kind of state that should be cleared between test runs?
--
View this message in context:
http://apache-sling.73963.n3.nabble.com/Subsequent-runs-of-the-same-tests-fail-if-OSGi-environment-not-restarted-tp4032920p4032948.html
Sent from the Sling - Users mailing list archive at Nabble.com.