[jira] [Updated] (SLING-7744) MockRequestPathInfo: Add Setter for SuffixResource
[ https://issues.apache.org/jira/browse/SLING-7744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7744: --- Description: The {{org.apache.sling.servlethelpers.MockRequestPathInfo}} allows consumers to set almost every field except the {{suffixResource}}. Currently, the {{getSuffixResource()}} just throws a {{UnsupportedOperationException}}. *I propose implementing a {{setSuffixResource}} method equivalent to all the other setters in this mock.* As far as I can tell this can be easily implemented (see attached patch) and would improve usability of this mock a little bit. was: The `org.apache.sling.servlethelpers.MockRequestPathInfo` allows consumers to set almost every field except the 'suffixResource`. Currently, the `getSuffixResource()` just throws a `UnsupportedOperationException`. *I propose implementing a `setSuffixResource` method equivalent to all the other setters in this mock.* As far as I can tell this can be easily implemented (see attached patch) and would improve usability of this mock a little bit. > MockRequestPathInfo: Add Setter for SuffixResource > -- > > Key: SLING-7744 > URL: https://issues.apache.org/jira/browse/SLING-7744 > Project: Sling > Issue Type: Improvement > Components: Servlets, Testing >Reporter: Jens Lauterbach >Priority: Minor > Attachments: SLING-7744.patch > > > The {{org.apache.sling.servlethelpers.MockRequestPathInfo}} allows consumers > to set almost every field except the {{suffixResource}}. Currently, the > {{getSuffixResource()}} just throws a {{UnsupportedOperationException}}. > *I propose implementing a {{setSuffixResource}} method equivalent to all the > other setters in this mock.* > As far as I can tell this can be easily implemented (see attached patch) and > would improve usability of this mock a little bit. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (SLING-7744) MockRequestPathInfo: Add Setter for SuffixResource
[ https://issues.apache.org/jira/browse/SLING-7744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7744: --- Affects Version/s: Servlet Helpers 1.1.6 > MockRequestPathInfo: Add Setter for SuffixResource > -- > > Key: SLING-7744 > URL: https://issues.apache.org/jira/browse/SLING-7744 > Project: Sling > Issue Type: Improvement > Components: Servlets, Testing >Affects Versions: Servlet Helpers 1.1.6 >Reporter: Jens Lauterbach >Priority: Minor > Attachments: SLING-7744.patch > > > The {{org.apache.sling.servlethelpers.MockRequestPathInfo}} allows consumers > to set almost every field except the {{suffixResource}}. Currently, the > {{getSuffixResource()}} just throws a {{UnsupportedOperationException}}. > *I propose implementing a {{setSuffixResource}} method equivalent to all the > other setters in this mock.* > As far as I can tell this can be easily implemented (see attached patch) and > would improve usability of this mock a little bit. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (SLING-7744) MockRequestPathInfo: Add Setter for SuffixResource
[ https://issues.apache.org/jira/browse/SLING-7744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7744: --- Attachment: SLING-7744.patch > MockRequestPathInfo: Add Setter for SuffixResource > -- > > Key: SLING-7744 > URL: https://issues.apache.org/jira/browse/SLING-7744 > Project: Sling > Issue Type: Improvement > Components: Servlets, Testing >Reporter: Jens Lauterbach >Priority: Minor > Attachments: SLING-7744.patch > > > The `org.apache.sling.servlethelpers.MockRequestPathInfo` allows consumers to > set almost every field except the 'suffixResource`. Currently, the > `getSuffixResource()` just throws a `UnsupportedOperationException`. > *I propose implementing a `setSuffixResource` method equivalent to all the > other setters in this mock.* > As far as I can tell this can be easily implemented (see attached patch) and > would improve usability of this mock a little bit. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SLING-7195) Sling Mock Oak not working with AEM uber-jar 6.3.0
[ https://issues.apache.org/jira/browse/SLING-7195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16202193#comment-16202193 ] Jens Lauterbach commented on SLING-7195: Just for other people finding this: Even if you fix the problem described in this ticket you might get another exception. For a solution for this exception look here: http://apache-sling.73963.n3.nabble.com/sling-mocks-quot-Creating-resource-resolver-failed-quot-td4073079.html > Sling Mock Oak not working with AEM uber-jar 6.3.0 > -- > > Key: SLING-7195 > URL: https://issues.apache.org/jira/browse/SLING-7195 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock Oak 2.0.2 > Environment: AEM 6.3.0 >Reporter: Jens Lauterbach >Priority: Minor > Labels: test > Attachments: sling-7195-demo.zip > > > When running unit tests using the Sling Mock Oak repository the tests will > fail if AEMs {{uber-jar}} is present in the classpath. > This happens with the following versions: > # {{org.apache.sling:org.apache.sling.testing.sling-mock-oak:2.0.2}} > # {{com.adobe.aem:uber-jar:6.3.0}} > h2. Exception > {code} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to invoke method 'activate' for class > org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository > at > org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:66) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.newResourceResolverFactory(SlingContextImpl.java:154) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.setUp(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$100(SlingContext.java:40) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.before(SlingContext.java:127) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) > 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.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) > Caused by: java.lang.RuntimeException: Unable to invoke method 'activate' for > class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:320) > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeLifecycleMethod(OsgiServiceUtil.java:149) > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:84) > at > org.apache.sling.testing.mock.osgi.MockOsgi.activate(MockOsgi.java:169) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:155) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:140) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.setUp(ResourceResolverFactoryInitializer.java:62) > at > org.apache.sling.testing.mock.sling.MockSling.newResourceResolverFactory(MockSling.java:75) > at > org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:45) > ... 20 more > Caused by: java.lang.NoClassDefFoundError: > org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingConfigInitializer > at > org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.initialize(InitialContent.java:88) > at >
[jira] [Commented] (SLING-7195) Sling Mock Oak not working with AEM uber-jar 6.3.0
[ https://issues.apache.org/jira/browse/SLING-7195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16202137#comment-16202137 ] Jens Lauterbach commented on SLING-7195: Ok. I found out how to fix this with {{aem-mock}}. It did not work on first try because of the order of the dependencies. This works: {code} io.wcm io.wcm.testing.aem-mock 2.2.6 com.adobe.aem uber-jar apis 6.3.0 {code} This does not work: {code} com.adobe.aem uber-jar apis 6.3.0 io.wcm io.wcm.testing.aem-mock 2.2.6 {code} > Sling Mock Oak not working with AEM uber-jar 6.3.0 > -- > > Key: SLING-7195 > URL: https://issues.apache.org/jira/browse/SLING-7195 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock Oak 2.0.2 > Environment: AEM 6.3.0 >Reporter: Jens Lauterbach >Priority: Minor > Labels: test > Attachments: sling-7195-demo.zip > > > When running unit tests using the Sling Mock Oak repository the tests will > fail if AEMs {{uber-jar}} is present in the classpath. > This happens with the following versions: > # {{org.apache.sling:org.apache.sling.testing.sling-mock-oak:2.0.2}} > # {{com.adobe.aem:uber-jar:6.3.0}} > h2. Exception > {code} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to invoke method 'activate' for class > org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository > at > org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:66) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.newResourceResolverFactory(SlingContextImpl.java:154) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.setUp(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$100(SlingContext.java:40) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.before(SlingContext.java:127) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) > 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.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) > Caused by: java.lang.RuntimeException: Unable to invoke method 'activate' for > class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:320) > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeLifecycleMethod(OsgiServiceUtil.java:149) > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:84) > at > org.apache.sling.testing.mock.osgi.MockOsgi.activate(MockOsgi.java:169) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:155) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:140) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.setUp(ResourceResolverFactoryInitializer.java:62) > at > org.apache.sling.testing.mock.sling.MockSling.newResourceResolverFactory(MockSling.java:75) > at > org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:45) > ... 20 more > Caused by: java.lang.NoClassDefFoundError: > org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingConfigInitializer > at >
[jira] [Comment Edited] (SLING-7195) Sling Mock Oak not working with AEM uber-jar 6.3.0
[ https://issues.apache.org/jira/browse/SLING-7195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16202121#comment-16202121 ] Jens Lauterbach edited comment on SLING-7195 at 10/12/17 3:48 PM: -- I just checked the poms for {{io.wcm:io.wcm.testing.aem-mock:2.2.6}} and they indeed have a dependency on the {{com.adobe.aem:uber-jar}}. But sadly, the have a dependency on version {{6.2.0}} of the {{uber-jar}}. And as far as I can tell the dependency is not "propagated" to my project if I include `aem-mock` as dependency. Therefore, I would still have to have an explicit dependency on the {{uber-jar}}. Having both of them as dependency did not fix the problem. was (Author: jenslauterbach): I just checked the poms for {{io.wcm:io.wcm.testing.aem-mock:2.2.6}} and they indeed have a dependency on the {{com.adobe.aem:uber-jar}}. But sadly, the have a dependency on version {{6.2.0}} of the {{uber-jar}}. > Sling Mock Oak not working with AEM uber-jar 6.3.0 > -- > > Key: SLING-7195 > URL: https://issues.apache.org/jira/browse/SLING-7195 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock Oak 2.0.2 > Environment: AEM 6.3.0 >Reporter: Jens Lauterbach >Priority: Minor > Labels: test > Attachments: sling-7195-demo.zip > > > When running unit tests using the Sling Mock Oak repository the tests will > fail if AEMs {{uber-jar}} is present in the classpath. > This happens with the following versions: > # {{org.apache.sling:org.apache.sling.testing.sling-mock-oak:2.0.2}} > # {{com.adobe.aem:uber-jar:6.3.0}} > h2. Exception > {code} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to invoke method 'activate' for class > org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository > at > org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:66) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.newResourceResolverFactory(SlingContextImpl.java:154) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.setUp(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$100(SlingContext.java:40) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.before(SlingContext.java:127) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) > 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.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) > Caused by: java.lang.RuntimeException: Unable to invoke method 'activate' for > class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:320) > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeLifecycleMethod(OsgiServiceUtil.java:149) > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:84) > at > org.apache.sling.testing.mock.osgi.MockOsgi.activate(MockOsgi.java:169) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:155) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:140) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.setUp(ResourceResolverFactoryInitializer.java:62) > at >
[jira] [Comment Edited] (SLING-7195) Sling Mock Oak not working with AEM uber-jar 6.3.0
[ https://issues.apache.org/jira/browse/SLING-7195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16202121#comment-16202121 ] Jens Lauterbach edited comment on SLING-7195 at 10/12/17 3:45 PM: -- I just checked the poms for {{io.wcm:io.wcm.testing.aem-mock:2.2.6}} and they indeed have a dependency on the {{com.adobe.aem:uber-jar}}. But sadly, the have a dependency on version {{6.2.0}} of the {{uber-jar}}. was (Author: jenslauterbach): I just checked the poms for {{io.wcm:io.wcm.testing.aem-mock:2.2.6}} and they are indeed have a dependency on the {{com.adobe.aem:uber-jar}}. But sadly, the have a dependency on version {{6.2.0}} of the {{uber-jar}}. > Sling Mock Oak not working with AEM uber-jar 6.3.0 > -- > > Key: SLING-7195 > URL: https://issues.apache.org/jira/browse/SLING-7195 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock Oak 2.0.2 > Environment: AEM 6.3.0 >Reporter: Jens Lauterbach >Priority: Minor > Labels: test > Attachments: sling-7195-demo.zip > > > When running unit tests using the Sling Mock Oak repository the tests will > fail if AEMs {{uber-jar}} is present in the classpath. > This happens with the following versions: > # {{org.apache.sling:org.apache.sling.testing.sling-mock-oak:2.0.2}} > # {{com.adobe.aem:uber-jar:6.3.0}} > h2. Exception > {code} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to invoke method 'activate' for class > org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository > at > org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:66) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.newResourceResolverFactory(SlingContextImpl.java:154) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.setUp(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$100(SlingContext.java:40) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.before(SlingContext.java:127) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) > 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.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) > Caused by: java.lang.RuntimeException: Unable to invoke method 'activate' for > class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:320) > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeLifecycleMethod(OsgiServiceUtil.java:149) > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:84) > at > org.apache.sling.testing.mock.osgi.MockOsgi.activate(MockOsgi.java:169) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:155) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:140) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.setUp(ResourceResolverFactoryInitializer.java:62) > at > org.apache.sling.testing.mock.sling.MockSling.newResourceResolverFactory(MockSling.java:75) > at > org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:45) > ... 20 more > Caused by:
[jira] [Commented] (SLING-7195) Sling Mock Oak not working with AEM uber-jar 6.3.0
[ https://issues.apache.org/jira/browse/SLING-7195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16202121#comment-16202121 ] Jens Lauterbach commented on SLING-7195: I just checked the poms for {{io.wcm:io.wcm.testing.aem-mock:2.2.6}} and they are indeed have a dependency on the {{com.adobe.aem:uber-jar}}. But sadly, the have a dependency on version {{6.2.0}} of the {{uber-jar}}. > Sling Mock Oak not working with AEM uber-jar 6.3.0 > -- > > Key: SLING-7195 > URL: https://issues.apache.org/jira/browse/SLING-7195 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock Oak 2.0.2 > Environment: AEM 6.3.0 >Reporter: Jens Lauterbach >Priority: Minor > Labels: test > Attachments: sling-7195-demo.zip > > > When running unit tests using the Sling Mock Oak repository the tests will > fail if AEMs {{uber-jar}} is present in the classpath. > This happens with the following versions: > # {{org.apache.sling:org.apache.sling.testing.sling-mock-oak:2.0.2}} > # {{com.adobe.aem:uber-jar:6.3.0}} > h2. Exception > {code} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to invoke method 'activate' for class > org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository > at > org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:66) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.newResourceResolverFactory(SlingContextImpl.java:154) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.setUp(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$100(SlingContext.java:40) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.before(SlingContext.java:127) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) > 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.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) > Caused by: java.lang.RuntimeException: Unable to invoke method 'activate' for > class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:320) > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeLifecycleMethod(OsgiServiceUtil.java:149) > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:84) > at > org.apache.sling.testing.mock.osgi.MockOsgi.activate(MockOsgi.java:169) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:155) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:140) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.setUp(ResourceResolverFactoryInitializer.java:62) > at > org.apache.sling.testing.mock.sling.MockSling.newResourceResolverFactory(MockSling.java:75) > at > org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:45) > ... 20 more > Caused by: java.lang.NoClassDefFoundError: > org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingConfigInitializer > at > org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.initialize(InitialContent.java:88) > at >
[jira] [Updated] (SLING-7195) Sling Mock Oak not working with AEM uber-jar 6.3.0
[ https://issues.apache.org/jira/browse/SLING-7195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7195: --- Description: When running unit tests using the Sling Mock Oak repository the tests will fail if AEMs {{uber-jar}} is present in the classpath. This happens with the following versions: # {{org.apache.sling:org.apache.sling.testing.sling-mock-oak:2.0.2}} # {{com.adobe.aem:uber-jar:6.3.0}} h2. Exception {code} java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to invoke method 'activate' for class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository at org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:66) at org.apache.sling.testing.mock.sling.context.SlingContextImpl.newResourceResolverFactory(SlingContextImpl.java:154) at org.apache.sling.testing.mock.sling.context.SlingContextImpl.setUp(SlingContextImpl.java:145) at org.apache.sling.testing.mock.sling.junit.SlingContext.access$100(SlingContext.java:40) at org.apache.sling.testing.mock.sling.junit.SlingContext$1.before(SlingContext.java:127) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) 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.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) Caused by: java.lang.RuntimeException: Unable to invoke method 'activate' for class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:320) at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeLifecycleMethod(OsgiServiceUtil.java:149) at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:84) at org.apache.sling.testing.mock.osgi.MockOsgi.activate(MockOsgi.java:169) at org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:155) at org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:140) at org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.setUp(ResourceResolverFactoryInitializer.java:62) at org.apache.sling.testing.mock.sling.MockSling.newResourceResolverFactory(MockSling.java:75) at org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:45) ... 20 more Caused by: java.lang.NoClassDefFoundError: org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingConfigInitializer at org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.initialize(InitialContent.java:88) at org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.createInitialContent(InitialContent.java:61) at org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.(InitialContent.java:57) at org.apache.jackrabbit.oak.jcr.Jcr.(Jcr.java:114) at org.apache.jackrabbit.oak.jcr.Jcr.(Jcr.java:141) at org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository.activate(OakMockSlingRepository.java:75) 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:497) at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:311) ... 28 more Caused by:
[jira] [Updated] (SLING-7195) Sling Mock Oak not working with AEM uber-jar 6.3.0
[ https://issues.apache.org/jira/browse/SLING-7195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7195: --- Attachment: sling-7195-demo.zip Added demo project to help reproduce error. > Sling Mock Oak not working with AEM uber-jar 6.3.0 > -- > > Key: SLING-7195 > URL: https://issues.apache.org/jira/browse/SLING-7195 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock Oak 2.0.2 > Environment: AEM 6.3.0 >Reporter: Jens Lauterbach >Priority: Minor > Labels: test > Attachments: sling-7195-demo.zip > > > When running unit tests using the Sling Mock Oak repository the tests will > fail if AEMs {{uber-jar}} is present in the classpath. > This happens with the following versions: > # {{org.apache.sling:org.apache.sling.testing.sling-mock-oak:2.0.2}} > # {{com.adobe.aem:uber-jar:6.3.0}} > h2. Exception > {code} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to invoke method 'activate' for class > org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository > at > org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:66) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.newResourceResolverFactory(SlingContextImpl.java:154) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.setUp(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$100(SlingContext.java:40) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.before(SlingContext.java:127) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) > 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.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) > Caused by: java.lang.RuntimeException: Unable to invoke method 'activate' for > class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:320) > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeLifecycleMethod(OsgiServiceUtil.java:149) > at > org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:84) > at > org.apache.sling.testing.mock.osgi.MockOsgi.activate(MockOsgi.java:169) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:155) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:140) > at > org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.setUp(ResourceResolverFactoryInitializer.java:62) > at > org.apache.sling.testing.mock.sling.MockSling.newResourceResolverFactory(MockSling.java:75) > at > org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:45) > ... 20 more > Caused by: java.lang.NoClassDefFoundError: > org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingConfigInitializer > at > org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.initialize(InitialContent.java:88) > at > org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.createInitialContent(InitialContent.java:61) > at > org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.(InitialContent.java:57) > at
[jira] [Updated] (SLING-7195) Sling Mock Oak not working with AEM uber-jar 6.3.0
[ https://issues.apache.org/jira/browse/SLING-7195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7195: --- Description: When running unit tests using the Sling Mock Oak repository the tests will fail if AEMs {{uber-jar}} is present in the classpath. This happens with the following versions: # {{org.apache.sling:org.apache.sling.testing.sling-mock-oak:2.0.2}} # {{com.adobe.aem:uber-jar:6.3.0}} h2. Exception {code} java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to invoke method 'activate' for class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository at org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:66) at org.apache.sling.testing.mock.sling.context.SlingContextImpl.newResourceResolverFactory(SlingContextImpl.java:154) at org.apache.sling.testing.mock.sling.context.SlingContextImpl.setUp(SlingContextImpl.java:145) at org.apache.sling.testing.mock.sling.junit.SlingContext.access$100(SlingContext.java:40) at org.apache.sling.testing.mock.sling.junit.SlingContext$1.before(SlingContext.java:127) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) 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.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) Caused by: java.lang.RuntimeException: Unable to invoke method 'activate' for class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:320) at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeLifecycleMethod(OsgiServiceUtil.java:149) at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:84) at org.apache.sling.testing.mock.osgi.MockOsgi.activate(MockOsgi.java:169) at org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:155) at org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:140) at org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.setUp(ResourceResolverFactoryInitializer.java:62) at org.apache.sling.testing.mock.sling.MockSling.newResourceResolverFactory(MockSling.java:75) at org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:45) ... 20 more Caused by: java.lang.NoClassDefFoundError: org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingConfigInitializer at org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.initialize(InitialContent.java:88) at org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.createInitialContent(InitialContent.java:61) at org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.(InitialContent.java:57) at org.apache.jackrabbit.oak.jcr.Jcr.(Jcr.java:114) at org.apache.jackrabbit.oak.jcr.Jcr.(Jcr.java:141) at org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository.activate(OakMockSlingRepository.java:75) 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:497) at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:311) ... 28 more Caused by:
[jira] [Created] (SLING-7195) Sling Mock Oak not working with AEM uber-jar 6.3.0
Jens Lauterbach created SLING-7195: -- Summary: Sling Mock Oak not working with AEM uber-jar 6.3.0 Key: SLING-7195 URL: https://issues.apache.org/jira/browse/SLING-7195 Project: Sling Issue Type: Bug Components: Testing Affects Versions: Testing Sling Mock Oak 2.0.2 Environment: AEM 6.3.0 Reporter: Jens Lauterbach Priority: Minor When running unit tests using the Sling Mock Oak repository the tests will fail if AEMs {{uber-jar}} is present in the classpath. This happens with the following versions: # {{org.apache.sling:org.apache.sling.testing.sling-mock-oak:2.0.2}} # {{com.adobe.aem:uber-jar:6.3.0}} h2. Exception {code} java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to invoke method 'activate' for class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository at org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:66) at org.apache.sling.testing.mock.sling.context.SlingContextImpl.newResourceResolverFactory(SlingContextImpl.java:154) at org.apache.sling.testing.mock.sling.context.SlingContextImpl.setUp(SlingContextImpl.java:145) at org.apache.sling.testing.mock.sling.junit.SlingContext.access$100(SlingContext.java:40) at org.apache.sling.testing.mock.sling.junit.SlingContext$1.before(SlingContext.java:127) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) 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.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) Caused by: java.lang.RuntimeException: Unable to invoke method 'activate' for class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:320) at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeLifecycleMethod(OsgiServiceUtil.java:149) at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:84) at org.apache.sling.testing.mock.osgi.MockOsgi.activate(MockOsgi.java:169) at org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:155) at org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:140) at org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.setUp(ResourceResolverFactoryInitializer.java:62) at org.apache.sling.testing.mock.sling.MockSling.newResourceResolverFactory(MockSling.java:75) at org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:45) ... 20 more Caused by: java.lang.NoClassDefFoundError: org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingConfigInitializer at org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.initialize(InitialContent.java:88) at org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.createInitialContent(InitialContent.java:61) at org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.(InitialContent.java:57) at org.apache.jackrabbit.oak.jcr.Jcr.(Jcr.java:114) at org.apache.jackrabbit.oak.jcr.Jcr.(Jcr.java:141) at org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository.activate(OakMockSlingRepository.java:75) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at
[jira] [Updated] (SLING-7189) Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK
[ https://issues.apache.org/jira/browse/SLING-7189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7189: --- Attachment: sling-7189.patch Added patch to fix the issue. > Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK > > > Key: SLING-7189 > URL: https://issues.apache.org/jira/browse/SLING-7189 > Project: Sling > Issue Type: Bug > Components: Apache Sling Testing Rules >Affects Versions: Testing Sling Mock 2.2.12 >Reporter: Jens Lauterbach >Priority: Trivial > Attachments: sling-7189-code.zip, sling-7189.patch > > > When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you > get the following error if you do not have the required dependency: > {quote} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to instantiate resourcer resolver: > org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make > sure this maven dependency is included: > org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak > {quote} > The message contains the {{groupId}} and {{artifactId}} of the dependency you > are supposed to add to your project: > {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} > The problem is that this dependency does not seem to exist. I was able to > solve this issue by adding the following dependency: > {code} > > org.apache.sling > org.apache.sling.testing.sling-mock-oak > 2.0.2 > > {code} > This dependency does include the class > {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} > which is apparently the class that is supposed to be loaded by all of this. > *Therefore, I would propose to update the artifact coordinates in the error > message.* > I added a demo project that can be used to re-produce this issue: > # Extract the attached archive > # Run {{mvn clean test}} > # Error occurs > # Uncomment dependency in {{pom.xml}} > # Run {{mvn clean test}} > # Error is gone -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (SLING-7189) Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK
[ https://issues.apache.org/jira/browse/SLING-7189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7189: --- Priority: Trivial (was: Minor) > Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK > > > Key: SLING-7189 > URL: https://issues.apache.org/jira/browse/SLING-7189 > Project: Sling > Issue Type: Bug > Components: Apache Sling Testing Rules >Affects Versions: Testing Sling Mock 2.2.12 >Reporter: Jens Lauterbach >Priority: Trivial > Attachments: sling-7189-code.zip > > > When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you > get the following error if you do not have the required dependency: > {quote} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to instantiate resourcer resolver: > org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make > sure this maven dependency is included: > org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak > {quote} > The message contains the {{groupId}} and {{artifactId}} of the dependency you > are supposed to add to your project: > {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} > The problem is that this dependency does not seem to exist. I was able to > solve this issue by adding the following dependency: > {code} > > org.apache.sling > org.apache.sling.testing.sling-mock-oak > 2.0.2 > > {code} > This dependency does include the class > {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} > which is apparently the class that is supposed to be loaded by all of this. > *Therefore, I would propose to update the artifact coordinates in the error > message.* > I added a demo project that can be used to re-produce this issue: > # Extract the attached archive > # Run {{mvn clean test}} > # Error occurs > # Uncomment dependency in {{pom.xml}} > # Run {{mvn clean test}} > # Error is gone -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (SLING-7189) Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK
[ https://issues.apache.org/jira/browse/SLING-7189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7189: --- Description: When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you get the following error if you do not have the required dependency: {quote} java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to instantiate resourcer resolver: org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make sure this maven dependency is included: org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak {quote} The message contains the {{groupId}} and {{artifactId}} of the dependency you are supposed to add to your project: {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} The problem is that this dependency does not seem to exist. I was able to solve this issue by adding the following dependency: {code} org.apache.sling org.apache.sling.testing.sling-mock-oak 2.0.2 {code} This dependency does include the class {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} which is apparently the class that is supposed to be loaded by all of this. *Therefore, I would propose to update the artifact coordinates in the error message.* I added a demo project that can be used to re-produce this issue: # Extract the archive # Run {{mvn clean test}} # Error occurs # Uncomment dependency in {{pom.xml}} # Run {{mvn clean test}} # Error is gone was: When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you get the following error if you do not have the required dependency: {quote} java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to instantiate resourcer resolver: org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make sure this maven dependency is included: org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak {quote} The message contains the {{groupId}} and {{artifactId}} of the dependency you are supposed to add to your project: {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} The problem is that this dependency does not seem to exist. I was able to solve this issue by adding the following dependency: {code} org.apache.sling org.apache.sling.testing.sling-mock-oak 2.0.2 {code} This dependency does include the class {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} which is apparently the class that is supposed to be loaded by all of this. *Therefore, I would propose to update the artifact coordinates in the error message.* > Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK > > > Key: SLING-7189 > URL: https://issues.apache.org/jira/browse/SLING-7189 > Project: Sling > Issue Type: Bug > Components: Apache Sling Testing Rules >Affects Versions: Testing Sling Mock 2.2.12 >Reporter: Jens Lauterbach >Priority: Minor > Attachments: sling-7189-code.zip > > > When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you > get the following error if you do not have the required dependency: > {quote} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to instantiate resourcer resolver: > org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make > sure this maven dependency is included: > org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak > {quote} > The message contains the {{groupId}} and {{artifactId}} of the dependency you > are supposed to add to your project: > {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} > The problem is that this dependency does not seem to exist. I was able to > solve this issue by adding the following dependency: > {code} > > org.apache.sling > org.apache.sling.testing.sling-mock-oak > 2.0.2 > > {code} > This dependency does include the class > {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} > which is apparently the class that is supposed to be loaded by all of this. > *Therefore, I would propose to update the artifact coordinates in the error > message.* > I added a demo project that can be used to re-produce this issue: > # Extract the archive > # Run {{mvn clean test}} > # Error occurs > # Uncomment dependency in {{pom.xml}} > # Run {{mvn clean test}} > # Error is gone -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (SLING-7189) Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK
[ https://issues.apache.org/jira/browse/SLING-7189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7189: --- Description: When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you get the following error if you do not have the required dependency: {quote} java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to instantiate resourcer resolver: org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make sure this maven dependency is included: org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak {quote} The message contains the {{groupId}} and {{artifactId}} of the dependency you are supposed to add to your project: {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} The problem is that this dependency does not seem to exist. I was able to solve this issue by adding the following dependency: {code} org.apache.sling org.apache.sling.testing.sling-mock-oak 2.0.2 {code} This dependency does include the class {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} which is apparently the class that is supposed to be loaded by all of this. *Therefore, I would propose to update the artifact coordinates in the error message.* I added a demo project that can be used to re-produce this issue: # Extract the attached archive # Run {{mvn clean test}} # Error occurs # Uncomment dependency in {{pom.xml}} # Run {{mvn clean test}} # Error is gone was: When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you get the following error if you do not have the required dependency: {quote} java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to instantiate resourcer resolver: org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make sure this maven dependency is included: org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak {quote} The message contains the {{groupId}} and {{artifactId}} of the dependency you are supposed to add to your project: {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} The problem is that this dependency does not seem to exist. I was able to solve this issue by adding the following dependency: {code} org.apache.sling org.apache.sling.testing.sling-mock-oak 2.0.2 {code} This dependency does include the class {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} which is apparently the class that is supposed to be loaded by all of this. *Therefore, I would propose to update the artifact coordinates in the error message.* I added a demo project that can be used to re-produce this issue: # Extract the archive # Run {{mvn clean test}} # Error occurs # Uncomment dependency in {{pom.xml}} # Run {{mvn clean test}} # Error is gone > Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK > > > Key: SLING-7189 > URL: https://issues.apache.org/jira/browse/SLING-7189 > Project: Sling > Issue Type: Bug > Components: Apache Sling Testing Rules >Affects Versions: Testing Sling Mock 2.2.12 >Reporter: Jens Lauterbach >Priority: Minor > Attachments: sling-7189-code.zip > > > When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you > get the following error if you do not have the required dependency: > {quote} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to instantiate resourcer resolver: > org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make > sure this maven dependency is included: > org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak > {quote} > The message contains the {{groupId}} and {{artifactId}} of the dependency you > are supposed to add to your project: > {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} > The problem is that this dependency does not seem to exist. I was able to > solve this issue by adding the following dependency: > {code} > > org.apache.sling > org.apache.sling.testing.sling-mock-oak > 2.0.2 > > {code} > This dependency does include the class > {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} > which is apparently the class that is supposed to be loaded by all of this. > *Therefore, I would propose to update the artifact coordinates in the error > message.* > I added a demo project that can be used to re-produce this issue: > # Extract the attached archive > # Run {{mvn clean test}} > # Error occurs > # Uncomment dependency in {{pom.xml}} > # Run {{mvn clean test}} > # Error is
[jira] [Updated] (SLING-7189) Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK
[ https://issues.apache.org/jira/browse/SLING-7189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7189: --- Attachment: sling-7189-code.zip Added demo code. > Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK > > > Key: SLING-7189 > URL: https://issues.apache.org/jira/browse/SLING-7189 > Project: Sling > Issue Type: Bug > Components: Apache Sling Testing Rules >Affects Versions: Testing Sling Mock 2.2.12 >Reporter: Jens Lauterbach >Priority: Minor > Attachments: sling-7189-code.zip > > > When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you > get the following error if you do not have the required dependency: > {quote} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to instantiate resourcer resolver: > org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make > sure this maven dependency is included: > org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak > {quote} > The message contains the {{groupId}} and {{artifactId}} of the dependency you > are supposed to add to your project: > {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} > The problem is that this dependency does not seem to exist. I was able to > solve this issue by adding the following dependency: > {code} > > org.apache.sling > org.apache.sling.testing.sling-mock-oak > 2.0.2 > > {code} > This dependency does include the class > {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} > which is apparently the class that is supposed to be loaded by all of this. > *Therefore, I would propose to update the artifact coordinates in the error > message.* -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (SLING-7189) Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK
[ https://issues.apache.org/jira/browse/SLING-7189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7189: --- Description: When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you get the following error if you do not have the required dependency: {quote} java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to instantiate resourcer resolver: org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make sure this maven dependency is included: org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak {quote} The message contains the {{groupId}} and {{artifactId}} of the dependency you are supposed to add to your project: {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} The problem is that this dependency does not seem to exist. I was able to solve this issue by adding the following dependency: {code} org.apache.sling org.apache.sling.testing.sling-mock-oak 2.0.2 {code} This dependency does include the class {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} which is apparently the class that is supposed to be loaded by all of this. *Therefore, I would propose to update the artifact coordinates in the error message.* was: When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you get the following error if you do not have the required dependency: {quote} java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to instantiate resourcer resolver: org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make sure this maven dependency is included: org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak {quote} The message contains the {{groupId}} and {{artifactId}} of the dependency you are supposed to add to your project: {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} The problem is that this dependency does not seem to exist. I was able to solve this issue by adding the following dependency: {code} org.apache.sling org.apache.sling.testing.sling-mock-oak 2.0.2 {code} This dependency does include the class {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} which is apparently the class that is supposed to be loaded by all of this. > Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK > > > Key: SLING-7189 > URL: https://issues.apache.org/jira/browse/SLING-7189 > Project: Sling > Issue Type: Bug > Components: Apache Sling Testing Rules >Affects Versions: Testing Sling Mock 2.2.12 >Reporter: Jens Lauterbach >Priority: Minor > > When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you > get the following error if you do not have the required dependency: > {quote} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to instantiate resourcer resolver: > org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make > sure this maven dependency is included: > org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak > {quote} > The message contains the {{groupId}} and {{artifactId}} of the dependency you > are supposed to add to your project: > {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} > The problem is that this dependency does not seem to exist. I was able to > solve this issue by adding the following dependency: > {code} > > org.apache.sling > org.apache.sling.testing.sling-mock-oak > 2.0.2 > > {code} > This dependency does include the class > {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} > which is apparently the class that is supposed to be loaded by all of this. > *Therefore, I would propose to update the artifact coordinates in the error > message.* -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (SLING-7189) Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK
[ https://issues.apache.org/jira/browse/SLING-7189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-7189: --- Description: When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you get the following error if you do not have the required dependency: {quote} java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to instantiate resourcer resolver: org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make sure this maven dependency is included: org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak {quote} The message contains the {{groupId}} and {{artifactId}} of the dependency you are supposed to add to your project: {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} The problem is that this dependency does not seem to exist. I was able to solve this issue by adding the following dependency: {code} org.apache.sling org.apache.sling.testing.sling-mock-oak 2.0.2 {code} This dependency does include the class {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} which is apparently the class that is supposed to be loaded by all of this. > Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK > > > Key: SLING-7189 > URL: https://issues.apache.org/jira/browse/SLING-7189 > Project: Sling > Issue Type: Bug > Components: Apache Sling Testing Rules >Affects Versions: Testing Sling Mock 2.2.12 >Reporter: Jens Lauterbach >Priority: Minor > > When you create a {{SlingContext}} using {{ResourceResolverType.JCR_OAK}} you > get the following error if you do not have the required dependency: > {quote} > java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver > factory: Unable to instantiate resourcer resolver: > org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter. Make > sure this maven dependency is included: > org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak > {quote} > The message contains the {{groupId}} and {{artifactId}} of the dependency you > are supposed to add to your project: > {quote}org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak{quote} > The problem is that this dependency does not seem to exist. I was able to > solve this issue by adding the following dependency: > {code} > > org.apache.sling > org.apache.sling.testing.sling-mock-oak > 2.0.2 > > {code} > This dependency does include the class > {{org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter}} > which is apparently the class that is supposed to be loaded by all of this. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Created] (SLING-7189) Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK
Jens Lauterbach created SLING-7189: -- Summary: Misleading Artifact Coordinates message for ResourceResolverType.JCR_OAK Key: SLING-7189 URL: https://issues.apache.org/jira/browse/SLING-7189 Project: Sling Issue Type: Bug Components: Apache Sling Testing Rules Affects Versions: Testing Sling Mock 2.2.12 Reporter: Jens Lauterbach Priority: Minor -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Comment Edited] (SLING-5719) Missing isLive() test before closing ResourceResolver
[ https://issues.apache.org/jira/browse/SLING-5719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15293623#comment-15293623 ] Jens Lauterbach edited comment on SLING-5719 at 5/20/16 4:12 PM: - You can get a {{ResourceResolverFactory}} if you do something like this: {code} public class MyTest { @Rule public final SlingContext context = new SlingContext(ResourceResolverType.JCR_MOCK); @Test public void myTest() { final ResourceResolverFactory = context.getService(ResourceResolverFactory.class); } } {code} Even better: The {{ResourceResolverFactory}} is injected if you use the {{SlingContext}} method {{registerInjectActivateService()}} as long as you have the appropriate {{bind()}} and {{unbind()}} methods in the your class. was (Author: jenslauterbach): You can get a {{ResourceResolverFactory}} if you do something like this: {code} public class MyTest { @Rule public final SlingContext context = new SlingContext(ResourceResolverType.JCR_MOCK); @Test public void myTest() { final ResourceResolverFactory = context.getService(ResourceResolverFactory.class); } } {code} Even better: The {{ResourceResolverFactory}} is injected if you use the {{SlingContext}} method {{registerInjectActivateService()}} as long as you have the appropriate {{bind()}} and {{unbind()}} methods in the class. > Missing isLive() test before closing ResourceResolver > - > > Key: SLING-5719 > URL: https://issues.apache.org/jira/browse/SLING-5719 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock 1.6.2 >Reporter: Jens Lauterbach >Priority: Minor > Labels: easyfix > Attachments: resourceResolverIsLive.patch > > > I am currently writing tests that involve the {{SlingContext}} and its > {{ResourceResolver}}: > {code} > @Rule > public final SlingContext context = new > SlingContext(ResourceResolverType.JCR_MOCK); > [... code ...] > @Test > public void testSomething() { > ResourceResolver resolver = this.context.resourceResolver(); > someOtherMethod(resolver); > } > {code} > If the resolver is closed in {{someOtherMethod()}} the test will fail because > after the test runs the {{SlingContextImpl}} mehtod {{tearDown()}} is called > which will {{close()}} the resource resolver if it is not {{null}}. > The problem is that it won't test if the resource resolver {{isLive()}} which > will end in an exception and a failed test: > {quote} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:167) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.adaptTo(ResourceResolverImpl.java:718) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.tearDown(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$300(SlingContext.java:32) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.after(SlingContext.java:120) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50) > at org.junit.rules.RunRules.evaluate(RunRules.java:20) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) > at org.junit.runners.ParentRunner.run(ParentRunner.java:309) > at org.junit.runner.JUnitCore.run(JUnitCore.java:160) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) > {quote} > Github link to the line in question: > https://github.com/apache/sling/blob/4da6392078b73f0f20d3d66e87743cf4e86f4ecb/testing/mocks/sling-mock/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java#L161 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-5719) Missing isLive() test before closing ResourceResolver
[ https://issues.apache.org/jira/browse/SLING-5719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15293623#comment-15293623 ] Jens Lauterbach commented on SLING-5719: You can get a {{ResourceResolverFactory}} if you do something like this: {code} public class MyTest { @Rule public final SlingContext context = new SlingContext(ResourceResolverType.JCR_MOCK); @Test public void myTest() { final ResourceResolverFactory = context.getService(ResourceResolverFactory.class); } } {code} Even better: The {{ResourceResolverFactory}} is injected if you use the {{SlingContext}} method {{registerInjectActivateService()}} as long as you have the appropriate {{bind()}} and {{unbind()}} methods in the class. > Missing isLive() test before closing ResourceResolver > - > > Key: SLING-5719 > URL: https://issues.apache.org/jira/browse/SLING-5719 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock 1.6.2 >Reporter: Jens Lauterbach >Priority: Minor > Labels: easyfix > Attachments: resourceResolverIsLive.patch > > > I am currently writing tests that involve the {{SlingContext}} and its > {{ResourceResolver}}: > {code} > @Rule > public final SlingContext context = new > SlingContext(ResourceResolverType.JCR_MOCK); > [... code ...] > @Test > public void testSomething() { > ResourceResolver resolver = this.context.resourceResolver(); > someOtherMethod(resolver); > } > {code} > If the resolver is closed in {{someOtherMethod()}} the test will fail because > after the test runs the {{SlingContextImpl}} mehtod {{tearDown()}} is called > which will {{close()}} the resource resolver if it is not {{null}}. > The problem is that it won't test if the resource resolver {{isLive()}} which > will end in an exception and a failed test: > {quote} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:167) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.adaptTo(ResourceResolverImpl.java:718) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.tearDown(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$300(SlingContext.java:32) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.after(SlingContext.java:120) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50) > at org.junit.rules.RunRules.evaluate(RunRules.java:20) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) > at org.junit.runners.ParentRunner.run(ParentRunner.java:309) > at org.junit.runner.JUnitCore.run(JUnitCore.java:160) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) > {quote} > Github link to the line in question: > https://github.com/apache/sling/blob/4da6392078b73f0f20d3d66e87743cf4e86f4ecb/testing/mocks/sling-mock/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java#L161 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-5719) Missing isLive() test before closing ResourceResolver
[ https://issues.apache.org/jira/browse/SLING-5719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15288554#comment-15288554 ] Jens Lauterbach commented on SLING-5719: That's what I was thinking about too. Internally the {{SlingContextImpl}} already uses a {{ResourceResolverFactory}}. But I am not sure if this is something that the Sling maintainers are interested in. > Missing isLive() test before closing ResourceResolver > - > > Key: SLING-5719 > URL: https://issues.apache.org/jira/browse/SLING-5719 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock 1.6.2 >Reporter: Jens Lauterbach >Priority: Minor > Labels: easyfix > Attachments: resourceResolverIsLive.patch > > > I am currently writing tests that involve the {{SlingContext}} and its > {{ResourceResolver}}: > {code} > @Rule > public final SlingContext context = new > SlingContext(ResourceResolverType.JCR_MOCK); > [... code ...] > @Test > public void testSomething() { > ResourceResolver resolver = this.context.resourceResolver(); > someOtherMethod(resolver); > } > {code} > If the resolver is closed in {{someOtherMethod()}} the test will fail because > after the test runs the {{SlingContextImpl}} mehtod {{tearDown()}} is called > which will {{close()}} the resource resolver if it is not {{null}}. > The problem is that it won't test if the resource resolver {{isLive()}} which > will end in an exception and a failed test: > {quote} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:167) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.adaptTo(ResourceResolverImpl.java:718) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.tearDown(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$300(SlingContext.java:32) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.after(SlingContext.java:120) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50) > at org.junit.rules.RunRules.evaluate(RunRules.java:20) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) > at org.junit.runners.ParentRunner.run(ParentRunner.java:309) > at org.junit.runner.JUnitCore.run(JUnitCore.java:160) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) > {quote} > Github link to the line in question: > https://github.com/apache/sling/blob/4da6392078b73f0f20d3d66e87743cf4e86f4ecb/testing/mocks/sling-mock/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java#L161 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Comment Edited] (SLING-5719) Missing isLive() test before closing ResourceResolver
[ https://issues.apache.org/jira/browse/SLING-5719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15288523#comment-15288523 ] Jens Lauterbach edited comment on SLING-5719 at 5/18/16 6:40 AM: - You are of course totally right [~kwindszus]. Normally, only the class/method creating the resource resolver should close it. My example was a bit misleading in that I was trying to use the mocks {{resolver()}} as return value of my {{ResourceResolverFactory}}. Those of my classes that use the RRF were all meant to get their "own" RR. So in fact my classes would have been the owner. The problem of course is that the mock/unit test environment is different in that regard since the {{SlingContext}} is the owner of the RR and will try to close it after my classes under test did. Resulting in the error. So the better question is: How can I have a mock RRF? was (Author: jenslauterbach): You are of course totally right [~kwindszus]. Normally, only the class/method creating the resource resolver should close it. My example was a bit misleading in that I was trying to use the mocks {{resolver()}} as return value of my {{ResourceResolverFactory}}. Those of my classes that use the RRF were all meant to get their "own" RR. So in fact my classes would have been the owner. The problem of course is that the mock/unit test environment is different in that regard since the `SlingContext` is the owner of the RR and will try to close it after my classes under test did. Resulting in the error. So the better question is: How can I have a mock RRF? > Missing isLive() test before closing ResourceResolver > - > > Key: SLING-5719 > URL: https://issues.apache.org/jira/browse/SLING-5719 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock 1.6.2 >Reporter: Jens Lauterbach >Priority: Minor > Labels: easyfix > Attachments: resourceResolverIsLive.patch > > > I am currently writing tests that involve the {{SlingContext}} and its > {{ResourceResolver}}: > {code} > @Rule > public final SlingContext context = new > SlingContext(ResourceResolverType.JCR_MOCK); > [... code ...] > @Test > public void testSomething() { > ResourceResolver resolver = this.context.resourceResolver(); > someOtherMethod(resolver); > } > {code} > If the resolver is closed in {{someOtherMethod()}} the test will fail because > after the test runs the {{SlingContextImpl}} mehtod {{tearDown()}} is called > which will {{close()}} the resource resolver if it is not {{null}}. > The problem is that it won't test if the resource resolver {{isLive()}} which > will end in an exception and a failed test: > {quote} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:167) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.adaptTo(ResourceResolverImpl.java:718) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.tearDown(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$300(SlingContext.java:32) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.after(SlingContext.java:120) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50) > at org.junit.rules.RunRules.evaluate(RunRules.java:20) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) > at org.junit.runners.ParentRunner.run(ParentRunner.java:309) > at org.junit.runner.JUnitCore.run(JUnitCore.java:160) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) > {quote} > Github link to the line in question: >
[jira] [Commented] (SLING-5719) Missing isLive() test before closing ResourceResolver
[ https://issues.apache.org/jira/browse/SLING-5719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15288523#comment-15288523 ] Jens Lauterbach commented on SLING-5719: You are of course totally right [~kwindszus]. Normally, only the class/method creating the resource resolver should close it. My example was a bit misleading in that I was trying to use the mocks `resolver()` as return value of my `ResourceResolverFactory`. Those of my classes that use the RRF were all meant to get their "own" RR. So in fact my classes would have been the owner. The problem of course is that the mock/unit test environment is different in that regard since the `SlingContext` is the owner of the RR and will try to close it after my classes under test did. Resulting in the error. So the better question is: How can I have a mock RRF? > Missing isLive() test before closing ResourceResolver > - > > Key: SLING-5719 > URL: https://issues.apache.org/jira/browse/SLING-5719 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock 1.6.2 >Reporter: Jens Lauterbach >Priority: Minor > Labels: easyfix > Attachments: resourceResolverIsLive.patch > > > I am currently writing tests that involve the {{SlingContext}} and its > {{ResourceResolver}}: > {code} > @Rule > public final SlingContext context = new > SlingContext(ResourceResolverType.JCR_MOCK); > [... code ...] > @Test > public void testSomething() { > ResourceResolver resolver = this.context.resourceResolver(); > someOtherMethod(resolver); > } > {code} > If the resolver is closed in {{someOtherMethod()}} the test will fail because > after the test runs the {{SlingContextImpl}} mehtod {{tearDown()}} is called > which will {{close()}} the resource resolver if it is not {{null}}. > The problem is that it won't test if the resource resolver {{isLive()}} which > will end in an exception and a failed test: > {quote} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:167) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.adaptTo(ResourceResolverImpl.java:718) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.tearDown(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$300(SlingContext.java:32) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.after(SlingContext.java:120) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50) > at org.junit.rules.RunRules.evaluate(RunRules.java:20) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) > at org.junit.runners.ParentRunner.run(ParentRunner.java:309) > at org.junit.runner.JUnitCore.run(JUnitCore.java:160) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) > {quote} > Github link to the line in question: > https://github.com/apache/sling/blob/4da6392078b73f0f20d3d66e87743cf4e86f4ecb/testing/mocks/sling-mock/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java#L161 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Comment Edited] (SLING-5719) Missing isLive() test before closing ResourceResolver
[ https://issues.apache.org/jira/browse/SLING-5719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15288523#comment-15288523 ] Jens Lauterbach edited comment on SLING-5719 at 5/18/16 6:40 AM: - You are of course totally right [~kwindszus]. Normally, only the class/method creating the resource resolver should close it. My example was a bit misleading in that I was trying to use the mocks {{resolver()}} as return value of my {{ResourceResolverFactory}}. Those of my classes that use the RRF were all meant to get their "own" RR. So in fact my classes would have been the owner. The problem of course is that the mock/unit test environment is different in that regard since the `SlingContext` is the owner of the RR and will try to close it after my classes under test did. Resulting in the error. So the better question is: How can I have a mock RRF? was (Author: jenslauterbach): You are of course totally right [~kwindszus]. Normally, only the class/method creating the resource resolver should close it. My example was a bit misleading in that I was trying to use the mocks `resolver()` as return value of my `ResourceResolverFactory`. Those of my classes that use the RRF were all meant to get their "own" RR. So in fact my classes would have been the owner. The problem of course is that the mock/unit test environment is different in that regard since the `SlingContext` is the owner of the RR and will try to close it after my classes under test did. Resulting in the error. So the better question is: How can I have a mock RRF? > Missing isLive() test before closing ResourceResolver > - > > Key: SLING-5719 > URL: https://issues.apache.org/jira/browse/SLING-5719 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock 1.6.2 >Reporter: Jens Lauterbach >Priority: Minor > Labels: easyfix > Attachments: resourceResolverIsLive.patch > > > I am currently writing tests that involve the {{SlingContext}} and its > {{ResourceResolver}}: > {code} > @Rule > public final SlingContext context = new > SlingContext(ResourceResolverType.JCR_MOCK); > [... code ...] > @Test > public void testSomething() { > ResourceResolver resolver = this.context.resourceResolver(); > someOtherMethod(resolver); > } > {code} > If the resolver is closed in {{someOtherMethod()}} the test will fail because > after the test runs the {{SlingContextImpl}} mehtod {{tearDown()}} is called > which will {{close()}} the resource resolver if it is not {{null}}. > The problem is that it won't test if the resource resolver {{isLive()}} which > will end in an exception and a failed test: > {quote} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:167) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.adaptTo(ResourceResolverImpl.java:718) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.tearDown(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$300(SlingContext.java:32) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.after(SlingContext.java:120) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50) > at org.junit.rules.RunRules.evaluate(RunRules.java:20) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) > at org.junit.runners.ParentRunner.run(ParentRunner.java:309) > at org.junit.runner.JUnitCore.run(JUnitCore.java:160) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) > {quote} > Github link to the line in question: >
[jira] [Updated] (SLING-5719) Missing isLive() test before closing ResourceResolver
[ https://issues.apache.org/jira/browse/SLING-5719?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-5719: --- Description: I am currently writing tests that involve the {{SlingContext}} and its {{ResourceResolver}}: {code} @Rule public final SlingContext context = new SlingContext(ResourceResolverType.JCR_MOCK); [... code ...] @Test public void testSomething() { ResourceResolver resolver = this.context.resourceResolver(); someOtherMethod(resolver); } {code} If the resolver is closed in {{someOtherMethod()}} the test will fail because after the test runs the {{SlingContextImpl}} mehtod {{tearDown()}} is called which will {{close()}} the resource resolver if it is not {{null}}. The problem is that it won't test if the resource resolver {{isLive()}} which will end in an exception and a failed test: {quote} java.lang.IllegalStateException: Resource resolver is already closed. at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:167) at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.adaptTo(ResourceResolverImpl.java:718) at org.apache.sling.testing.mock.sling.context.SlingContextImpl.tearDown(SlingContextImpl.java:145) at org.apache.sling.testing.mock.sling.junit.SlingContext.access$300(SlingContext.java:32) at org.apache.sling.testing.mock.sling.junit.SlingContext$1.after(SlingContext.java:120) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) {quote} Github link to the line in question: https://github.com/apache/sling/blob/4da6392078b73f0f20d3d66e87743cf4e86f4ecb/testing/mocks/sling-mock/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java#L161 was: I am currently writing tests that involve the {{SlingContext}} and its {{ResourceResolver}}: {code} @Rule public final SlingContext context = new SlingContext(ResourceResolverType.JCR_MOCK); [... code ...] @Test public void testSomething() { ResourceResolver resolver = this.context.resourceResolver(); someOtherMethod(resolver); } {code} If the resolver is closed in {{someOtherMethod()}} the test will fail because after the test runs the {{SlingContextImpl}} mehtod {{tearDown()}} is called which will {{close()}} the resource resolver if it is not {{null}}. The problem is that it won't test if the resource resolver {{isLive()}} which will end in an exception and a failed test: {quote} java.lang.IllegalStateException: Resource resolver is already closed. at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:167) at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.adaptTo(ResourceResolverImpl.java:718) at org.apache.sling.testing.mock.sling.context.SlingContextImpl.tearDown(SlingContextImpl.java:145) at org.apache.sling.testing.mock.sling.junit.SlingContext.access$300(SlingContext.java:32) at org.apache.sling.testing.mock.sling.junit.SlingContext$1.after(SlingContext.java:120) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at
[jira] [Updated] (SLING-5719) Missing isLive() test before closing ResourceResolver
[ https://issues.apache.org/jira/browse/SLING-5719?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Lauterbach updated SLING-5719: --- Attachment: resourceResolverIsLive.patch I didn't know how to provide a patch but I found the GitHub Sling repo. So I created a Git patch. Maybe this helps. > Missing isLive() test before closing ResourceResolver > - > > Key: SLING-5719 > URL: https://issues.apache.org/jira/browse/SLING-5719 > Project: Sling > Issue Type: Bug > Components: Testing >Affects Versions: Testing Sling Mock 1.6.2 >Reporter: Jens Lauterbach >Priority: Minor > Labels: easyfix > Attachments: resourceResolverIsLive.patch > > > I am currently writing tests that involve the {{SlingContext}} and its > {{ResourceResolver}}: > {code} > @Rule > public final SlingContext context = new > SlingContext(ResourceResolverType.JCR_MOCK); > [... code ...] > @Test > public void testSomething() { > ResourceResolver resolver = this.context.resourceResolver(); > someOtherMethod(resolver); > } > {code} > If the resolver is closed in {{someOtherMethod()}} the test will fail because > after the test runs the {{SlingContextImpl}} mehtod {{tearDown()}} is called > which will {{close()}} the resource resolver if it is not {{null}}. > The problem is that it won't test if the resource resolver {{isLive()}} which > will end in an exception and a failed test: > {quote} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:167) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.adaptTo(ResourceResolverImpl.java:718) > at > org.apache.sling.testing.mock.sling.context.SlingContextImpl.tearDown(SlingContextImpl.java:145) > at > org.apache.sling.testing.mock.sling.junit.SlingContext.access$300(SlingContext.java:32) > at > org.apache.sling.testing.mock.sling.junit.SlingContext$1.after(SlingContext.java:120) > at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50) > at org.junit.rules.RunRules.evaluate(RunRules.java:20) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) > at org.junit.runners.ParentRunner.run(ParentRunner.java:309) > at org.junit.runner.JUnitCore.run(JUnitCore.java:160) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) > {quote} > Github link to the line in question: > https://github.com/apache/sling/blob/4da6392078b73f0f20d3d66e87743cf4e86f4ecb/testing/mocks/sling-mock/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java#L161 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Created] (SLING-5719) Missing isLive() test before closing ResourceResolver
Jens Lauterbach created SLING-5719: -- Summary: Missing isLive() test before closing ResourceResolver Key: SLING-5719 URL: https://issues.apache.org/jira/browse/SLING-5719 Project: Sling Issue Type: Bug Components: Testing Affects Versions: Testing Sling Mock 1.6.2 Reporter: Jens Lauterbach Priority: Minor I am currently writing tests that involve the {{SlingContext}} and its {{ResourceResolver}}: {code} @Rule public final SlingContext context = new SlingContext(ResourceResolverType.JCR_MOCK); [... code ...] @Test public void testSomething() { ResourceResolver resolver = this.context.resourceResolver(); someOtherMethod(resolver); } {code} If the resolver is closed in {{someOtherMethod()}} the test will fail because after the test runs the {{SlingContextImpl}} mehtod {{tearDown()}} is called which will {{close()}} the resource resolver if it is not {{null}}. The problem is that it won't test if the resource resolver {{isLive()}} which will end in an exception and a failed test: {quote} java.lang.IllegalStateException: Resource resolver is already closed. at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:167) at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.adaptTo(ResourceResolverImpl.java:718) at org.apache.sling.testing.mock.sling.context.SlingContextImpl.tearDown(SlingContextImpl.java:145) at org.apache.sling.testing.mock.sling.junit.SlingContext.access$300(SlingContext.java:32) at org.apache.sling.testing.mock.sling.junit.SlingContext$1.after(SlingContext.java:120) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) {quote} Github link to the line in question: https://github.com/apache/sling/blob/4da6392078b73f0f20d3d66e87743cf4e86f4ecb/testing/mocks/sling-mock/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java#L161 -- This message was sent by Atlassian JIRA (v6.3.4#6332)