sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Gonzalez (Jira)" <j...@apache.org>
Subject [jira] [Created] (SLING-9131) OSGi Mock 2.4.14 breaks getting services by highest rank
Date Sun, 23 Feb 2020 16:52:00 GMT
David Gonzalez created SLING-9131:
-------------------------------------

             Summary: OSGi Mock 2.4.14 breaks getting services by highest rank
                 Key: SLING-9131
                 URL: https://issues.apache.org/jira/browse/SLING-9131
             Project: Sling
          Issue Type: Bug
          Components: Tooling
    Affects Versions: Testing Sling Mock 2.4.0
            Reporter: David Gonzalez


This is in regard to dependency:  
{code:java}
<dependency>
    <groupId>org.apache.sling</groupId>
    <artifactId>org.apache.sling.testing.sling-mock.junit4</artifactId>
    <!-- Bumping this to 2.4.0 changes behavior in how servlet.service(..) is processed,
which breaks all servlet tests -->
    <version>2.3.10</version>
    <scope>test</scope>
</dependency> {code}
In v2.3.10, in Junit4 tests, invocations of:
{code:java}
ctx.getService(Servlet.class).service(ctx.request(), ctx.response()); {code}
Worked great, and was a nice way to test a servlet.

When upgrading the dependency to v2.4.0 the tests fail:
{code:java}
java.lang.IllegalArgumentException: Illegal initial capacity: -1java.lang.IllegalArgumentException:
Illegal initial capacity: -1
 at java.util.HashMap.<init>(HashMap.java:449) at java.util.HashMap.<init>(HashMap.java:468)
at org.apache.sling.models.impl.ExportServlet.createOptionMap(ExportServlet.java:163) at org.apache.sling.models.impl.ExportServlet.doGet(ExportServlet.java:96)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.mayService(SlingSafeMethodsServlet.java:266)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:342)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:374)
at com.adobe.aem.commons.assetshare.content.renditions.impl.AssetRenditionServletTest.doGet_InvalidParameters(AssetRenditionServletTest.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at
java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
{code}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message