Re: [VOTE] Release Apache Sling Testing OSGi Mock 2.3.8

2018-03-20 Thread Daniel Klco
+1

On Tue, Mar 20, 2018 at 1:07 PM, Carsten Ziegeler 
wrote:

> +1
>
>
> Stefan Seifert wrote
> > Hi,
> >
> > We solved 1 issues in this release:
> > https://issues.apache.org/jira/browse/SLING/fixforversion/12342273
> >
> > There is 1 unsolved issue:
> > https://issues.apache.org/jira/browse/SLING-7284
> >
> > Staging repository:
> > https://repository.apache.org/content/repositories/orgapachesling-1889/
> >
> > You can use this UNIX script to download the release and verify the
> signatures:
> > https://gitbox.apache.org/repos/asf?p=sling-tooling-
> release.git;a=blob;f=check_staged_release.sh;hb=HEAD
> >
> > Usage:
> > sh check_staged_release.sh 1889 /tmp/sling-staging
> >
> > Please vote to approve this release:
> >
> >   [ ] +1 Approve the release
> >   [ ]  0 Don't care
> >   [ ] -1 Don't release, because ...
> >
> > This majority vote is open for at least 72 hours.
> >
> > stefan
> >
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziege...@apache.org
>


Re: [VOTE] Release Apache Sling Testing OSGi Mock 2.3.8

2018-03-20 Thread Carsten Ziegeler
+1


Stefan Seifert wrote
> Hi,
> 
> We solved 1 issues in this release:
> https://issues.apache.org/jira/browse/SLING/fixforversion/12342273
> 
> There is 1 unsolved issue:
> https://issues.apache.org/jira/browse/SLING-7284
> 
> Staging repository:
> https://repository.apache.org/content/repositories/orgapachesling-1889/
> 
> You can use this UNIX script to download the release and verify the 
> signatures:
> https://gitbox.apache.org/repos/asf?p=sling-tooling-release.git;a=blob;f=check_staged_release.sh;hb=HEAD
> 
> Usage:
> sh check_staged_release.sh 1889 /tmp/sling-staging
> 
> Please vote to approve this release:
> 
>   [ ] +1 Approve the release
>   [ ]  0 Don't care
>   [ ] -1 Don't release, because ...
> 
> This majority vote is open for at least 72 hours.
> 
> stefan
> 
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


[jira] [Updated] (SLING-7551) Summarize CI and PR activity in a weekly email

2018-03-20 Thread Robert Munteanu (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Munteanu updated SLING-7551:
---
Description: 
With 250+ repos and Jenkins jobs we are getting a lot of noise related to build 
failures, PR comments, and it gets easy to forget what is failing and what 
needs attention. I propose sending weekly emails for:

* Failing CI Jobs
* Open PRs

The emails would go on dev@sling.apache.org, for maximum visibility.

*Failing CI Jobs*

The email would include all jobs that

- have failed at least once last week _or_
- have failed at least once and last status is not successful

The output would be plain-text and include a simple ASCII representation of the 
last 10 builds, e.g.

{noformat}
1. sling-ide-tooling-1.8
[...!..]
More: https://builds.apache.org/job/sling-ide-tooling-1.8/
{noformat}

Where '.' is a successful build and '!' is an unstable/failing one.

*Open PRs*

The email would include all open pull requests.

For each repository we would have a simple plain-text listing of all pull 
requests, e.g.:

{noformat}
1. sling-site:

PR #2: Update manipulating-content-the-slingpostservlet-servlets-post.md
Age: 41 days
https://github.com/apache/sling-site/pull/2

PR #4: Do something else with the site
Age: 12 days
https://github.com/apache/sling-site/pull/4
{noformat}

_edit_: formatting

  was:
With 250+ repos and Jenkins jobs we are getting a lot of noise related to build 
failures, PR comments, and it gets easy to forget what is failing and what 
needs attention. I propose sending weekly emails for:

* Failing CI Jobs
* Open PRs

The emails would go on dev@sling.apache.org, for maximum visibility.

** Failing CI Jobs **

The email would include all jobs that

- have failed at least once last week _or_
- have failed at least once and last status is not successful

The output would be plain-text and include a simple ASCII representation of the 
last 10 builds, e.g.

{noformat}
1. sling-ide-tooling-1.8
[...!..]
More: https://builds.apache.org/job/sling-ide-tooling-1.8/
{noformat}

Where '.' is a successful build and '!' is an unstable/failing one.

** Open PRs **

The email would include all open pull requests.

For each repository we would have a simple plain-text listing of all pull 
requests, e.g.:

{noformat}
1. sling-site:

PR #2: Update manipulating-content-the-slingpostservlet-servlets-post.md
Age: 41 days
https://github.com/apache/sling-site/pull/2

PR #4: Do something else with the site
Age: 12 days
https://github.com/apache/sling-site/pull/4
{noformat}


> Summarize CI and PR activity in a weekly email
> --
>
> Key: SLING-7551
> URL: https://issues.apache.org/jira/browse/SLING-7551
> Project: Sling
>  Issue Type: Task
>  Components: Build and Source Control
>Reporter: Robert Munteanu
>Priority: Major
>
> With 250+ repos and Jenkins jobs we are getting a lot of noise related to 
> build failures, PR comments, and it gets easy to forget what is failing and 
> what needs attention. I propose sending weekly emails for:
> * Failing CI Jobs
> * Open PRs
> The emails would go on dev@sling.apache.org, for maximum visibility.
> *Failing CI Jobs*
> The email would include all jobs that
> - have failed at least once last week _or_
> - have failed at least once and last status is not successful
> The output would be plain-text and include a simple ASCII representation of 
> the last 10 builds, e.g.
> {noformat}
> 1. sling-ide-tooling-1.8
> [...!..]
> More: https://builds.apache.org/job/sling-ide-tooling-1.8/
> {noformat}
> Where '.' is a successful build and '!' is an unstable/failing one.
> *Open PRs*
> The email would include all open pull requests.
> For each repository we would have a simple plain-text listing of all pull 
> requests, e.g.:
> {noformat}
> 1. sling-site:
> PR #2: Update manipulating-content-the-slingpostservlet-servlets-post.md
> Age: 41 days
> https://github.com/apache/sling-site/pull/2
> PR #4: Do something else with the site
> Age: 12 days
> https://github.com/apache/sling-site/pull/4
> {noformat}
> _edit_: formatting



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (SLING-7552) SlingPostServlet error handling still insufficient

2018-03-20 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SLING-7552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jörg Hoh updated SLING-7552:

Affects Version/s: Servlets Post 2.3.24
  Component/s: Servlets

> SlingPostServlet error handling still insufficient
> --
>
> Key: SLING-7552
> URL: https://issues.apache.org/jira/browse/SLING-7552
> Project: Sling
>  Issue Type: Improvement
>  Components: Servlets
>Affects Versions: Servlets Post 2.3.24
>Reporter: Jörg Hoh
>Priority: Major
>
> At the moment the default errorhandling of Sling [1] cannot be used for 
> errors caused and handled by the SlingPostServlet itself. It will always 
> return its own custom output without the chance of customizing it. Although 
> Antonio and Justing worked in SLING-2156 to improve this situation, it still 
> requires extra work (implementing a PostResponseWithErrorHandling). It would 
> be better if the output could be customized by the "standard error handling".
>  
> How to reproduce:
>  * create an error handling script in 
> /apps/sling/servlet/errorhandler/default.jsp which creates some random output.
>  * Validate this script config by doing a request which causes some exception 
> (do not use the SlingPostServlet here)
>  * Do a POST to the Sling instance which results in an exception (e.g. due to 
> insufficient permissions.
>  * The output of the second call is completely determined by the 
> SlingPostServlet, the default error handling does not kick in.
> Proposed solution:
> * The SlingPostServlet should not swallow the exception and handle it by 
> itself, but rather re-throw it, so the standard error handling is triggered.
>  
> [1] http://sling.apache.org/documentation/the-sling-engine/errorhandling.html



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (SLING-7552) SlingPostServlet error handling still insufficient

2018-03-20 Thread JIRA
Jörg Hoh created SLING-7552:
---

 Summary: SlingPostServlet error handling still insufficient
 Key: SLING-7552
 URL: https://issues.apache.org/jira/browse/SLING-7552
 Project: Sling
  Issue Type: Improvement
Reporter: Jörg Hoh


At the moment the default errorhandling of Sling [1] cannot be used for errors 
caused and handled by the SlingPostServlet itself. It will always return its 
own custom output without the chance of customizing it. Although Antonio and 
Justing worked in SLING-2156 to improve this situation, it still requires extra 
work (implementing a PostResponseWithErrorHandling). It would be better if the 
output could be customized by the "standard error handling".

 

How to reproduce:
 * create an error handling script in 
/apps/sling/servlet/errorhandler/default.jsp which creates some random output.
 * Validate this script config by doing a request which causes some exception 
(do not use the SlingPostServlet here)
 * Do a POST to the Sling instance which results in an exception (e.g. due to 
insufficient permissions.
 * The output of the second call is completely determined by the 
SlingPostServlet, the default error handling does not kick in.

Proposed solution:

* The SlingPostServlet should not swallow the exception and handle it by 
itself, but rather re-throw it, so the standard error handling is triggered.

 

[1] http://sling.apache.org/documentation/the-sling-engine/errorhandling.html



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


SLING-7551 - Summarize CI and PR activity in a weekly email

2018-03-20 Thread Robert Munteanu
Hi,

I for one am starting to be overwhelmed by the amount of Github and
Jenkins notifications we receive. Some of those are actionable, some of
those are ignorable, and some of those are duplicates :-)

To make it easier to get an overview of the module's activities, I
propose that we get weekly summary emails for:

- failing Jenkins modules
- open Github PRs

I've added my proposal at SLING-7551 [1], comments welcome.

I don't have a plan to work on it this week, but will try to do so in
the near future.

Thanks,

Robert


[1]: https://issues.apache.org/jira/browse/SLING-7551


[jira] [Updated] (SLING-7551) Summarize CI and PR activity in a weekly email

2018-03-20 Thread Robert Munteanu (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Munteanu updated SLING-7551:
---
Description: 
With 250+ repos and Jenkins jobs we are getting a lot of noise related to build 
failures, PR comments, and it gets easy to forget what is failing and what 
needs attention. I propose sending weekly emails for:

* Failing CI Jobs
* Open PRs

The emails would go on dev@sling.apache.org, for maximum visibility.

** Failing CI Jobs **

The email would include all jobs that

- have failed at least once last week _or_
- have failed at least once and last status is not successful

The output would be plain-text and include a simple ASCII representation of the 
last 10 builds, e.g.

{noformat}
1. sling-ide-tooling-1.8
[...!..]
More: https://builds.apache.org/job/sling-ide-tooling-1.8/
{noformat}

Where '.' is a successful build and '!' is an unstable/failing one.

** Open PRs **

The email would include all open pull requests.

For each repository we would have a simple plain-text listing of all pull 
requests, e.g.:

{noformat}
1. sling-site:

PR #2: Update manipulating-content-the-slingpostservlet-servlets-post.md
Age: 41 days
https://github.com/apache/sling-site/pull/2

PR #4: Do something else with the site
Age: 12 days
https://github.com/apache/sling-site/pull/4
{noformat}

  was:
With 250+ repos and Jenkins jobs we are getting a lot of noise related to build 
failures, PR comments, and it gets easy to forget what is failing and what 
needs attention. I propose sending weekly emails for:

* Failing CI Jobs
* Open PRs

** Failing CI Jobs **

The email would include all jobs that

- have failed at least once last week _or_
- have failed at least once and last status is not successful

The output would be plain-text and include a simple ASCII representation of the 
last 10 builds, e.g.

{noformat}
1. sling-ide-tooling-1.8
[...!..]
More: https://builds.apache.org/job/sling-ide-tooling-1.8/
{noformat}

** Open PRs **

The email would include all open pull requests.

For each repository we would have a simple plain-text listing of all pull 
requests, e.g.:

{noformat}
1. sling-site:

PR #2: Update manipulating-content-the-slingpostservlet-servlets-post.md
Age: 41 days
https://github.com/apache/sling-site/pull/2

PR #4: Do something else with the site
Age: 12 days
https://github.com/apache/sling-site/pull/4
{noformat}


> Summarize CI and PR activity in a weekly email
> --
>
> Key: SLING-7551
> URL: https://issues.apache.org/jira/browse/SLING-7551
> Project: Sling
>  Issue Type: Task
>  Components: Build and Source Control
>Reporter: Robert Munteanu
>Priority: Major
>
> With 250+ repos and Jenkins jobs we are getting a lot of noise related to 
> build failures, PR comments, and it gets easy to forget what is failing and 
> what needs attention. I propose sending weekly emails for:
> * Failing CI Jobs
> * Open PRs
> The emails would go on dev@sling.apache.org, for maximum visibility.
> ** Failing CI Jobs **
> The email would include all jobs that
> - have failed at least once last week _or_
> - have failed at least once and last status is not successful
> The output would be plain-text and include a simple ASCII representation of 
> the last 10 builds, e.g.
> {noformat}
> 1. sling-ide-tooling-1.8
> [...!..]
> More: https://builds.apache.org/job/sling-ide-tooling-1.8/
> {noformat}
> Where '.' is a successful build and '!' is an unstable/failing one.
> ** Open PRs **
> The email would include all open pull requests.
> For each repository we would have a simple plain-text listing of all pull 
> requests, e.g.:
> {noformat}
> 1. sling-site:
> PR #2: Update manipulating-content-the-slingpostservlet-servlets-post.md
> Age: 41 days
> https://github.com/apache/sling-site/pull/2
> PR #4: Do something else with the site
> Age: 12 days
> https://github.com/apache/sling-site/pull/4
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (SLING-7551) Summarize CI and PR activity in a weekly email

2018-03-20 Thread Robert Munteanu (JIRA)
Robert Munteanu created SLING-7551:
--

 Summary: Summarize CI and PR activity in a weekly email
 Key: SLING-7551
 URL: https://issues.apache.org/jira/browse/SLING-7551
 Project: Sling
  Issue Type: Task
  Components: Build and Source Control
Reporter: Robert Munteanu


With 250+ repos and Jenkins jobs we are getting a lot of noise related to build 
failures, PR comments, and it gets easy to forget what is failing and what 
needs attention. I propose sending weekly emails for:

* Failing CI Jobs
* Open PRs

** Failing CI Jobs **

The email would include all jobs that

- have failed at least once last week _or_
- have failed at least once and last status is not successful

The output would be plain-text and include a simple ASCII representation of the 
last 10 builds, e.g.

{noformat}
1. sling-ide-tooling-1.8
[...!..]
More: https://builds.apache.org/job/sling-ide-tooling-1.8/
{noformat}

** Open PRs **

The email would include all open pull requests.

For each repository we would have a simple plain-text listing of all pull 
requests, e.g.:

{noformat}
1. sling-site:

PR #2: Update manipulating-content-the-slingpostservlet-servlets-post.md
Age: 41 days
https://github.com/apache/sling-site/pull/2

PR #4: Do something else with the site
Age: 12 days
https://github.com/apache/sling-site/pull/4
{noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7545) Groovy Scripting Engine not loading in Apache Sling 10

2018-03-20 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406431#comment-16406431
 ] 

Bertrand Delacretaz commented on SLING-7545:


Thanks [~kwin], I was wondering about that indeed, should have asked.

I have removed the {{BundleListener.class}} element of the services annotation, 
in commit 0339ac9

> Groovy Scripting Engine not loading in Apache Sling 10
> --
>
> Key: SLING-7545
> URL: https://issues.apache.org/jira/browse/SLING-7545
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Core 2.0.54
>Reporter: Ben Fortuna
>Assignee: Bertrand Delacretaz
>Priority: Major
> Fix For: Scripting Core 2.0.56
>
>
> With the latest release of Apache Sling (10) the Groovy Scripting engine is 
> no longer loading.
> The impact is that scripts with a (*.groovy) extension aren't rendering.
> This works with Apache Sling 9, so I believe there was a change in the Apache 
> Sling Scripting Core that broke the Groovy implementation.
>  
> How to reproduce:
> Load groovy-all JAR into Apache Sling as a bundle, under the url 
> [http://localhost:8080/system/console/status-slingscripting] the following 
> should display:
> {code:java}
> Groovy Scripting Engine 2.0
> -
> - Language : Groovy, 2.4.14
> - Extensions : groovy
> - MIME Types : application/x-groovy
> - Names : groovy, Groovy{code}
>  
> This works with Apache Sling 9, not with Sling 10



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7545) Groovy Scripting Engine not loading in Apache Sling 10

2018-03-20 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406404#comment-16406404
 ] 

Konrad Windszus commented on SLING-7545:


[~bdelacretaz] I don't think that a {{BundleListener}} should be registered as 
a regular service 
(https://github.com/apache/sling-org-apache-sling-scripting-core/blob/7f6145e79666c49844c49e9ce0d49d7954713a88/src/main/java/org/apache/sling/scripting/core/impl/jsr223/SlingScriptEngineManager.java#L60)
 as the registration according to the Javadoc should be only done via 
getBundleContext().addBundleListener(); WDYT?

> Groovy Scripting Engine not loading in Apache Sling 10
> --
>
> Key: SLING-7545
> URL: https://issues.apache.org/jira/browse/SLING-7545
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Core 2.0.54
>Reporter: Ben Fortuna
>Assignee: Bertrand Delacretaz
>Priority: Major
> Fix For: Scripting Core 2.0.56
>
>
> With the latest release of Apache Sling (10) the Groovy Scripting engine is 
> no longer loading.
> The impact is that scripts with a (*.groovy) extension aren't rendering.
> This works with Apache Sling 9, so I believe there was a change in the Apache 
> Sling Scripting Core that broke the Groovy implementation.
>  
> How to reproduce:
> Load groovy-all JAR into Apache Sling as a bundle, under the url 
> [http://localhost:8080/system/console/status-slingscripting] the following 
> should display:
> {code:java}
> Groovy Scripting Engine 2.0
> -
> - Language : Groovy, 2.4.14
> - Extensions : groovy
> - MIME Types : application/x-groovy
> - Names : groovy, Groovy{code}
>  
> This works with Apache Sling 9, not with Sling 10



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


Re: [VOTE] Release Apache Sling Testing OSGi Mock 2.3.8

2018-03-20 Thread David Bosschaert
+1

David

On 20 March 2018 at 11:36, Stefan Seifert  wrote:

> Hi,
>
> We solved 1 issues in this release:
> https://issues.apache.org/jira/browse/SLING/fixforversion/12342273
>
> There is 1 unsolved issue:
> https://issues.apache.org/jira/browse/SLING-7284
>
> Staging repository:
> https://repository.apache.org/content/repositories/orgapachesling-1889/
>
> You can use this UNIX script to download the release and verify the
> signatures:
> https://gitbox.apache.org/repos/asf?p=sling-tooling-
> release.git;a=blob;f=check_staged_release.sh;hb=HEAD
>
> Usage:
> sh check_staged_release.sh 1889 /tmp/sling-staging
>
> Please vote to approve this release:
>
>   [ ] +1 Approve the release
>   [ ]  0 Don't care
>   [ ] -1 Don't release, because ...
>
> This majority vote is open for at least 72 hours.
>
> stefan
>
>


Re: [VOTE] Release Apache Sling Testing OSGi Mock 2.3.8

2018-03-20 Thread Radu Cotescu
+1

On Tue, 20 Mar 2018 at 12:36 Stefan Seifert  wrote:

> Please vote to approve this release:
>
>   [ ] +1 Approve the release
>   [ ]  0 Don't care
>   [ ] -1 Don't release, because ...
>
> This majority vote is open for at least 72 hours.
>
> stefan
>
>


Re: [VOTE] Release Apache Sling Testing OSGi Mock 2.3.8

2018-03-20 Thread Robert Munteanu
On Tue, 2018-03-20 at 11:36 +, Stefan Seifert wrote:
> Please vote to approve this release:

+1

Robert

signature.asc
Description: This is a digitally signed message part


[jira] [Comment Edited] (SLING-7545) Groovy Scripting Engine not loading in Apache Sling 10

2018-03-20 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406299#comment-16406299
 ] 

Bertrand Delacretaz edited comment on SLING-7545 at 3/20/18 1:18 PM:
-

Thank you [~fortuna] for verfiying, marking this fixed.

Digging deeper it looks like this bug has been introduced by the following 
commit for SLING-7134 - I'll add a comment there to verify that fixing this one 
does not cause trouble there.

[https://github.com/apache/sling-org-apache-sling-scripting-core/commit/2e15bd4f230d390ceadc9481627156bb3b6caaa3#diff-502d0f72184777e3bfd2f0e1dca75eff]

IIUC this means that scripting-core V 2.0.52 also has this bug.


was (Author: bdelacretaz):
Thank you [~fortuna] for verfiying, marking this fixed.

Digging deeper it looks like this bug has been introduced by the following 
commit for SLING-7134 - I'll add a comment there to verify that fixing this one 
does not cause trouble there.

https://github.com/apache/sling-org-apache-sling-scripting-core/commit/2e15bd4f230d390ceadc9481627156bb3b6caaa3#diff-502d0f72184777e3bfd2f0e1dca75eff

> Groovy Scripting Engine not loading in Apache Sling 10
> --
>
> Key: SLING-7545
> URL: https://issues.apache.org/jira/browse/SLING-7545
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Core 2.0.54
>Reporter: Ben Fortuna
>Assignee: Bertrand Delacretaz
>Priority: Major
> Fix For: Scripting Core 2.0.56
>
>
> With the latest release of Apache Sling (10) the Groovy Scripting engine is 
> no longer loading.
> The impact is that scripts with a (*.groovy) extension aren't rendering.
> This works with Apache Sling 9, so I believe there was a change in the Apache 
> Sling Scripting Core that broke the Groovy implementation.
>  
> How to reproduce:
> Load groovy-all JAR into Apache Sling as a bundle, under the url 
> [http://localhost:8080/system/console/status-slingscripting] the following 
> should display:
> {code:java}
> Groovy Scripting Engine 2.0
> -
> - Language : Groovy, 2.4.14
> - Extensions : groovy
> - MIME Types : application/x-groovy
> - Names : groovy, Groovy{code}
>  
> This works with Apache Sling 9, not with Sling 10



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7134) Script execution order is not deterministic on Java 9 and nashorn engine is missing in java8

2018-03-20 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406304#comment-16406304
 ] 

Bertrand Delacretaz commented on SLING-7134:


Note that IIUC the changes of this ticket caused the SLING-7545 issue, as the 
script engine manager was not listening to bundle events anymore.

 

Hopefully fixing SLING-7545 doesn't cause trouble here - all tests pass after 
that fix.

> Script execution order is not deterministic on Java 9 and nashorn engine is 
> missing in java8
> 
>
> Key: SLING-7134
> URL: https://issues.apache.org/jira/browse/SLING-7134
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting, Servlets
>Reporter: Robert Munteanu
>Assignee: Karl Pauls
>Priority: Major
> Fix For: Scripting Core 2.0.52, Servlets Resolver 2.4.20
>
> Attachments: scripting-engines-java-9.png
>
>
> When starting up the Sling launchpad with Java 9 and accessing 
> http://localhost:8080/bin/browser.html I get an empty page and the following 
> stack trace in the error log
> {noformat}18.09.2017 23:50:44.656 *ERROR* [127.0.0.1 [1505767840754] GET 
> /bin/browser.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcesso
> rImpl service: Uncaught SlingException
> jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "window" is not 
> defined
> at 
> jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
> at 
> jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)
> at 
> jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291)
> at 
> jdk.scripting.nashorn/jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1615)
> at 
> jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1$\^eval\_.:program(:5)
> at 
> jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:652)
> at 
> jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
> at 
> jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:517)
> at 
> jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:420)
> at 
> jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.access$300(NashornScriptEngine.java:72)
> at 
> jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine$3.eval(NashornScriptEngine.java:513)
> at 
> org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:386)
> at 
> org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)
> at 
> org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)
> at 
> org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552)
> at 
> org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)
> at 
> org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)
> at 
> org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282)
> at 
> org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:322)
> at 
> org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatcher.java:211)
> at 
> org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:104)
> at 
> org.apache.sling.scripting.jsp.taglib.IncludeTagHandler.dispatch(IncludeTagHandler.java:54)
> at 
> org.apache.sling.scripting.jsp.taglib.AbstractDispatcherTagHandler.doEndTag(AbstractDispatcherTagHandler.java:129)
> at 
> org.apache.jsp.libs.composum.nodes.console.components.codeeditor.editdialog.editdialog_jsp._jspx_meth_sling_005finclude_005f0(edi
> tdialog_jsp.java:128)
> at 
> org.apache.jsp.libs.composum.nodes.console.components.codeeditor.editdialog.editdialog_jsp._jspService(editdialog_jsp.java:99)
> at 
> org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
> at 
> org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
> at 
> org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
> at 
> 

[jira] [Resolved] (SLING-7545) Groovy Scripting Engine not loading in Apache Sling 10

2018-03-20 Thread Bertrand Delacretaz (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bertrand Delacretaz resolved SLING-7545.

Resolution: Fixed
  Assignee: Bertrand Delacretaz

Thank you [~fortuna] for verfiying, marking this fixed.

Digging deeper it looks like this bug has been introduced by the following 
commit for SLING-7134 - I'll add a comment there to verify that fixing this one 
does not cause trouble there.

https://github.com/apache/sling-org-apache-sling-scripting-core/commit/2e15bd4f230d390ceadc9481627156bb3b6caaa3#diff-502d0f72184777e3bfd2f0e1dca75eff

> Groovy Scripting Engine not loading in Apache Sling 10
> --
>
> Key: SLING-7545
> URL: https://issues.apache.org/jira/browse/SLING-7545
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Core 2.0.54
>Reporter: Ben Fortuna
>Assignee: Bertrand Delacretaz
>Priority: Major
> Fix For: Scripting Core 2.0.56
>
>
> With the latest release of Apache Sling (10) the Groovy Scripting engine is 
> no longer loading.
> The impact is that scripts with a (*.groovy) extension aren't rendering.
> This works with Apache Sling 9, so I believe there was a change in the Apache 
> Sling Scripting Core that broke the Groovy implementation.
>  
> How to reproduce:
> Load groovy-all JAR into Apache Sling as a bundle, under the url 
> [http://localhost:8080/system/console/status-slingscripting] the following 
> should display:
> {code:java}
> Groovy Scripting Engine 2.0
> -
> - Language : Groovy, 2.4.14
> - Extensions : groovy
> - MIME Types : application/x-groovy
> - Names : groovy, Groovy{code}
>  
> This works with Apache Sling 9, not with Sling 10



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7545) Groovy Scripting Engine not loading in Apache Sling 10

2018-03-20 Thread Ben Fortuna (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406245#comment-16406245
 ] 

Ben Fortuna commented on SLING-7545:


[~rombert] Sling 9 uses version 2.0.46, which does work.

[~bdelacretaz] I've built and installed from master branch and it works. Just 
had to restart the Groovy bundle after installing.

> Groovy Scripting Engine not loading in Apache Sling 10
> --
>
> Key: SLING-7545
> URL: https://issues.apache.org/jira/browse/SLING-7545
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Core 2.0.54
>Reporter: Ben Fortuna
>Priority: Major
> Fix For: Scripting Core 2.0.56
>
>
> With the latest release of Apache Sling (10) the Groovy Scripting engine is 
> no longer loading.
> The impact is that scripts with a (*.groovy) extension aren't rendering.
> This works with Apache Sling 9, so I believe there was a change in the Apache 
> Sling Scripting Core that broke the Groovy implementation.
>  
> How to reproduce:
> Load groovy-all JAR into Apache Sling as a bundle, under the url 
> [http://localhost:8080/system/console/status-slingscripting] the following 
> should display:
> {code:java}
> Groovy Scripting Engine 2.0
> -
> - Language : Groovy, 2.4.14
> - Extensions : groovy
> - MIME Types : application/x-groovy
> - Names : groovy, Groovy{code}
>  
> This works with Apache Sling 9, not with Sling 10



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (SLING-7545) Groovy Scripting Engine not loading in Apache Sling 10

2018-03-20 Thread Bertrand Delacretaz (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bertrand Delacretaz updated SLING-7545:
---
Fix Version/s: Scripting Core 2.0.56

> Groovy Scripting Engine not loading in Apache Sling 10
> --
>
> Key: SLING-7545
> URL: https://issues.apache.org/jira/browse/SLING-7545
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Core 2.0.54
>Reporter: Ben Fortuna
>Priority: Major
> Fix For: Scripting Core 2.0.56
>
>
> With the latest release of Apache Sling (10) the Groovy Scripting engine is 
> no longer loading.
> The impact is that scripts with a (*.groovy) extension aren't rendering.
> This works with Apache Sling 9, so I believe there was a change in the Apache 
> Sling Scripting Core that broke the Groovy implementation.
>  
> How to reproduce:
> Load groovy-all JAR into Apache Sling as a bundle, under the url 
> [http://localhost:8080/system/console/status-slingscripting] the following 
> should display:
> {code:java}
> Groovy Scripting Engine 2.0
> -
> - Language : Groovy, 2.4.14
> - Extensions : groovy
> - MIME Types : application/x-groovy
> - Names : groovy, Groovy{code}
>  
> This works with Apache Sling 9, not with Sling 10



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7545) Groovy Scripting Engine not loading in Apache Sling 10

2018-03-20 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406192#comment-16406192
 ] 

Bertrand Delacretaz commented on SLING-7545:


I think this commit fixes this:

https://github.com/apache/sling-org-apache-sling-scripting-core/commit/7f6145e79666c49844c49e9ce0d49d7954713a88

For some reason the {{SlingScriptEngineManager}} was not registered as a 
{{BundleListener}} anymore but that's needed to correctly handle scripting 
bundles like {{groovy-all.jar}}.

[~fortuna] could you try with this fix? You'll need to build the master branch 
of https://github.com/apache/sling-org-apache-sling-scripting-core for that.

> Groovy Scripting Engine not loading in Apache Sling 10
> --
>
> Key: SLING-7545
> URL: https://issues.apache.org/jira/browse/SLING-7545
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Core 2.0.54
>Reporter: Ben Fortuna
>Priority: Major
>
> With the latest release of Apache Sling (10) the Groovy Scripting engine is 
> no longer loading.
> The impact is that scripts with a (*.groovy) extension aren't rendering.
> This works with Apache Sling 9, so I believe there was a change in the Apache 
> Sling Scripting Core that broke the Groovy implementation.
>  
> How to reproduce:
> Load groovy-all JAR into Apache Sling as a bundle, under the url 
> [http://localhost:8080/system/console/status-slingscripting] the following 
> should display:
> {code:java}
> Groovy Scripting Engine 2.0
> -
> - Language : Groovy, 2.4.14
> - Extensions : groovy
> - MIME Types : application/x-groovy
> - Names : groovy, Groovy{code}
>  
> This works with Apache Sling 9, not with Sling 10



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[VOTE] Release Apache Sling Testing OSGi Mock 2.3.8

2018-03-20 Thread Stefan Seifert
Hi,

We solved 1 issues in this release:
https://issues.apache.org/jira/browse/SLING/fixforversion/12342273

There is 1 unsolved issue:
https://issues.apache.org/jira/browse/SLING-7284

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1889/

You can use this UNIX script to download the release and verify the signatures:
https://gitbox.apache.org/repos/asf?p=sling-tooling-release.git;a=blob;f=check_staged_release.sh;hb=HEAD

Usage:
sh check_staged_release.sh 1889 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.

stefan



[jira] [Updated] (SLING-7284) Extend OsgiServiceUtil#invokeBindUnbindMethod to support more DS 1.3+ method signatures

2018-03-20 Thread Stefan Seifert (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Seifert updated SLING-7284:
--
Fix Version/s: (was: Testing OSGi Mock 2.3.8)
   Testing OSGi Mock 2.3.10

> Extend OsgiServiceUtil#invokeBindUnbindMethod to support more DS 1.3+ method 
> signatures
> ---
>
> Key: SLING-7284
> URL: https://issues.apache.org/jira/browse/SLING-7284
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Affects Versions: Testing OSGi Mock 1.0.0
>Reporter: Radu Cotescu
>Priority: Major
> Fix For: Testing OSGi Mock 2.3.10
>
>
> The 
> {{org.apache.sling.testing.mock.osgi.OsgiServiceUtil#invokeBindUnbindMethod}} 
> should be extended to support more DS 1.3+ method signatures. 
> For more details check 
> https://github.com/apache/felix/blob/a4755e768329a29252b1d7d8e52537941768606d/scr/src/main/java/org/apache/felix/scr/impl/inject/BindMethod.java#L86.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7550) MockBundleContext does not get service references when class is null and filter is non-null

2018-03-20 Thread Stefan Seifert (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406132#comment-16406132
 ] 

Stefan Seifert commented on SLING-7550:
---

i can do a release today

> MockBundleContext does not get service references when class is null and 
> filter is non-null
> ---
>
> Key: SLING-7550
> URL: https://issues.apache.org/jira/browse/SLING-7550
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Affects Versions: Testing OSGi Mock 2.3.6
>Reporter: Sufyan Haroon
>Assignee: Stefan Seifert
>Priority: Major
> Fix For: Testing OSGi Mock 2.3.8
>
>
> When invoking BundleContext 
> [api|https://osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html#getServiceReferences(java.lang.String,
>  java.lang.String)], when the class parameter is specified as null and filter 
> param is non-null, it is expected to return reference of all services which 
> satisfy the filter regardless of their class. 
> When the same api is invoked in MockBundleContext, it does not returns any 
> service references when class param is null and filter param is non-null. 
> MockBundleContextshould behave is a way which is similar to original 
> implementation



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7550) MockBundleContext does not get service references when class is null and filter is non-null

2018-03-20 Thread Sufyan Haroon (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406075#comment-16406075
 ] 

Sufyan Haroon commented on SLING-7550:
--

[~sseif...@pro-vision.de], thanks for merging it. Can you please let me know 
when can I expect a release for this component?

> MockBundleContext does not get service references when class is null and 
> filter is non-null
> ---
>
> Key: SLING-7550
> URL: https://issues.apache.org/jira/browse/SLING-7550
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Affects Versions: Testing OSGi Mock 2.3.6
>Reporter: Sufyan Haroon
>Assignee: Stefan Seifert
>Priority: Major
> Fix For: Testing OSGi Mock 2.3.8
>
>
> When invoking BundleContext 
> [api|https://osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html#getServiceReferences(java.lang.String,
>  java.lang.String)], when the class parameter is specified as null and filter 
> param is non-null, it is expected to return reference of all services which 
> satisfy the filter regardless of their class. 
> When the same api is invoked in MockBundleContext, it does not returns any 
> service references when class param is null and filter param is non-null. 
> MockBundleContextshould behave is a way which is similar to original 
> implementation



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7545) Groovy Scripting Engine not loading in Apache Sling 10

2018-03-20 Thread Robert Munteanu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406076#comment-16406076
 ] 

Robert Munteanu commented on SLING-7545:


[~fortuna] - does rolling back to an older version work? If it does, which is 
the newest version that works?

> Groovy Scripting Engine not loading in Apache Sling 10
> --
>
> Key: SLING-7545
> URL: https://issues.apache.org/jira/browse/SLING-7545
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Core 2.0.54
>Reporter: Ben Fortuna
>Priority: Major
>
> With the latest release of Apache Sling (10) the Groovy Scripting engine is 
> no longer loading.
> The impact is that scripts with a (*.groovy) extension aren't rendering.
> This works with Apache Sling 9, so I believe there was a change in the Apache 
> Sling Scripting Core that broke the Groovy implementation.
>  
> How to reproduce:
> Load groovy-all JAR into Apache Sling as a bundle, under the url 
> [http://localhost:8080/system/console/status-slingscripting] the following 
> should display:
> {code:java}
> Groovy Scripting Engine 2.0
> -
> - Language : Groovy, 2.4.14
> - Extensions : groovy
> - MIME Types : application/x-groovy
> - Names : groovy, Groovy{code}
>  
> This works with Apache Sling 9, not with Sling 10



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (SLING-7550) MockBundleContext does not get service references when class is null and filter is non-null

2018-03-20 Thread Stefan Seifert (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Seifert resolved SLING-7550.
---
Resolution: Fixed

thanks - i've merged it!

> MockBundleContext does not get service references when class is null and 
> filter is non-null
> ---
>
> Key: SLING-7550
> URL: https://issues.apache.org/jira/browse/SLING-7550
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Affects Versions: Testing OSGi Mock 2.3.6
>Reporter: Sufyan Haroon
>Assignee: Stefan Seifert
>Priority: Major
> Fix For: Testing OSGi Mock 2.3.8
>
>
> When invoking BundleContext 
> [api|https://osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html#getServiceReferences(java.lang.String,
>  java.lang.String)], when the class parameter is specified as null and filter 
> param is non-null, it is expected to return reference of all services which 
> satisfy the filter regardless of their class. 
> When the same api is invoked in MockBundleContext, it does not returns any 
> service references when class param is null and filter param is non-null. 
> MockBundleContextshould behave is a way which is similar to original 
> implementation



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7550) MockBundleContext does not get service references when class is null and filter is non-null

2018-03-20 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406043#comment-16406043
 ] 

ASF GitHub Bot commented on SLING-7550:
---

stefanseifert closed pull request #2: SLING-7550 Return services even when 
class param is null in
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/2
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java 
b/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
index 7a2e87d..095d3dc 100644
--- 
a/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
+++ 
b/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
@@ -93,7 +93,7 @@ public void unregister() {
 
 boolean matches(final String clazz, final String filter) throws 
InvalidSyntaxException {
 // ignore filter for now
-return this.clazzes.contains(clazz)
+return (clazz == null || this.clazzes.contains(clazz))
 && (filter == null || new 
FilterImpl(filter).match(properties));
 }
 
diff --git 
a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java 
b/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
index 1760ced..e031f72 100644
--- 
a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
+++ 
b/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
@@ -297,6 +297,18 @@ public void testGetServiceOrderWithoutRanking() {
 
 bundleContext.ungetService(ref);
 }
+
+@Test
+public void testGetServicesWithNoClassOnlyFilter() throws 
InvalidSyntaxException {
+bundleContext.registerService(String.class, "service1", 
testProperty());
+bundleContext.registerService(Long.class, new Long(2), testProperty());
+bundleContext.registerService(Integer.class, new Integer(9), 
testProperty());
+
+// should return service with lowest service id = which was registered 
first
+ServiceReference[] refs = 
bundleContext.getServiceReferences((String)null, "(prop1=value1)");
+assertNotNull(refs);
+assertEquals(3, refs.length);
+}
 
 private static Dictionary ranking(final Integer 
serviceRanking) {
 Dictionary props = new Hashtable();
@@ -305,5 +317,11 @@ public void testGetServiceOrderWithoutRanking() {
 }
 return props;
 }
+
+private static Dictionary testProperty() {
+Dictionary props = new Hashtable();
+props.put("prop1", "value1");
+return props;
+}
 
 }


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> MockBundleContext does not get service references when class is null and 
> filter is non-null
> ---
>
> Key: SLING-7550
> URL: https://issues.apache.org/jira/browse/SLING-7550
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Affects Versions: Testing OSGi Mock 2.3.6
>Reporter: Sufyan Haroon
>Assignee: Stefan Seifert
>Priority: Major
> Fix For: Testing OSGi Mock 2.3.8
>
>
> When invoking BundleContext 
> [api|https://osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html#getServiceReferences(java.lang.String,
>  java.lang.String)], when the class parameter is specified as null and filter 
> param is non-null, it is expected to return reference of all services which 
> satisfy the filter regardless of their class. 
> When the same api is invoked in MockBundleContext, it does not returns any 
> service references when class param is null and filter param is non-null. 
> MockBundleContextshould behave is a way which is similar to original 
> implementation



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] stefanseifert closed pull request #2: SLING-7550 Return services even when class param is null in

2018-03-20 Thread GitBox
stefanseifert closed pull request #2: SLING-7550 Return services even when 
class param is null in
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/2
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java 
b/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
index 7a2e87d..095d3dc 100644
--- 
a/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
+++ 
b/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
@@ -93,7 +93,7 @@ public void unregister() {
 
 boolean matches(final String clazz, final String filter) throws 
InvalidSyntaxException {
 // ignore filter for now
-return this.clazzes.contains(clazz)
+return (clazz == null || this.clazzes.contains(clazz))
 && (filter == null || new 
FilterImpl(filter).match(properties));
 }
 
diff --git 
a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java 
b/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
index 1760ced..e031f72 100644
--- 
a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
+++ 
b/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
@@ -297,6 +297,18 @@ public void testGetServiceOrderWithoutRanking() {
 
 bundleContext.ungetService(ref);
 }
+
+@Test
+public void testGetServicesWithNoClassOnlyFilter() throws 
InvalidSyntaxException {
+bundleContext.registerService(String.class, "service1", 
testProperty());
+bundleContext.registerService(Long.class, new Long(2), testProperty());
+bundleContext.registerService(Integer.class, new Integer(9), 
testProperty());
+
+// should return service with lowest service id = which was registered 
first
+ServiceReference[] refs = 
bundleContext.getServiceReferences((String)null, "(prop1=value1)");
+assertNotNull(refs);
+assertEquals(3, refs.length);
+}
 
 private static Dictionary ranking(final Integer 
serviceRanking) {
 Dictionary props = new Hashtable();
@@ -305,5 +317,11 @@ public void testGetServiceOrderWithoutRanking() {
 }
 return props;
 }
+
+private static Dictionary testProperty() {
+Dictionary props = new Hashtable();
+props.put("prop1", "value1");
+return props;
+}
 
 }


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Assigned] (SLING-7550) MockBundleContext does not get service references when class is null and filter is non-null

2018-03-20 Thread Stefan Seifert (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Seifert reassigned SLING-7550:
-

Assignee: Stefan Seifert

> MockBundleContext does not get service references when class is null and 
> filter is non-null
> ---
>
> Key: SLING-7550
> URL: https://issues.apache.org/jira/browse/SLING-7550
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Affects Versions: Testing OSGi Mock 2.3.6
>Reporter: Sufyan Haroon
>Assignee: Stefan Seifert
>Priority: Major
> Fix For: Testing OSGi Mock 2.3.8
>
>
> When invoking BundleContext 
> [api|https://osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html#getServiceReferences(java.lang.String,
>  java.lang.String)], when the class parameter is specified as null and filter 
> param is non-null, it is expected to return reference of all services which 
> satisfy the filter regardless of their class. 
> When the same api is invoked in MockBundleContext, it does not returns any 
> service references when class param is null and filter param is non-null. 
> MockBundleContextshould behave is a way which is similar to original 
> implementation



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7550) MockBundleContext does not get service references when class is null and filter is non-null

2018-03-20 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406024#comment-16406024
 ] 

ASF GitHub Bot commented on SLING-7550:
---

sufyanharoon opened a new pull request #2: SLING-7550 Return services even when 
class param is null in
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/2
 
 
   MockBundleContext.getServiceReferences api


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> MockBundleContext does not get service references when class is null and 
> filter is non-null
> ---
>
> Key: SLING-7550
> URL: https://issues.apache.org/jira/browse/SLING-7550
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Affects Versions: Testing OSGi Mock 2.3.6
>Reporter: Sufyan Haroon
>Priority: Major
> Fix For: Testing OSGi Mock 2.3.8
>
>
> When invoking BundleContext 
> [api|https://osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html#getServiceReferences(java.lang.String,
>  java.lang.String)], when the class parameter is specified as null and filter 
> param is non-null, it is expected to return reference of all services which 
> satisfy the filter regardless of their class. 
> When the same api is invoked in MockBundleContext, it does not returns any 
> service references when class param is null and filter param is non-null. 
> MockBundleContextshould behave is a way which is similar to original 
> implementation



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] sufyanharoon opened a new pull request #2: SLING-7550 Return services even when class param is null in

2018-03-20 Thread GitBox
sufyanharoon opened a new pull request #2: SLING-7550 Return services even when 
class param is null in
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/2
 
 
   MockBundleContext.getServiceReferences api


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Updated] (SLING-7550) MockBundleContext does not get service references when class is null and filter is non-null

2018-03-20 Thread Sufyan Haroon (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sufyan Haroon updated SLING-7550:
-
Description: 
When invoking BundleContext 
[api|https://osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html#getServiceReferences(java.lang.String,
 java.lang.String)], when the class parameter is specified as null and filter 
param is non-null, it is expected to return reference of all services which 
satisfy the filter regardless of their class. 

When the same api is invoked in MockBundleContext, it does not returns any 
service references when class param is null and filter param is non-null. 
MockBundleContextshould behave is a way which is similar to original 
implementation

> MockBundleContext does not get service references when class is null and 
> filter is non-null
> ---
>
> Key: SLING-7550
> URL: https://issues.apache.org/jira/browse/SLING-7550
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Affects Versions: Testing OSGi Mock 2.3.6
>Reporter: Sufyan Haroon
>Priority: Major
> Fix For: Testing OSGi Mock 2.3.8
>
>
> When invoking BundleContext 
> [api|https://osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html#getServiceReferences(java.lang.String,
>  java.lang.String)], when the class parameter is specified as null and filter 
> param is non-null, it is expected to return reference of all services which 
> satisfy the filter regardless of their class. 
> When the same api is invoked in MockBundleContext, it does not returns any 
> service references when class param is null and filter param is non-null. 
> MockBundleContextshould behave is a way which is similar to original 
> implementation



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (SLING-7550) MockBundleContext does not get service references when class is null and filter is non-null

2018-03-20 Thread Sufyan Haroon (JIRA)
Sufyan Haroon created SLING-7550:


 Summary: MockBundleContext does not get service references when 
class is null and filter is non-null
 Key: SLING-7550
 URL: https://issues.apache.org/jira/browse/SLING-7550
 Project: Sling
  Issue Type: Bug
  Components: Testing
Affects Versions: Testing OSGi Mock 2.3.6
Reporter: Sufyan Haroon
 Fix For: Testing OSGi Mock 2.3.8






--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (SLING-7538) Request attributes not correctly reset after using data-sly-resource or data-sly-include with requestAttributes

2018-03-20 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus resolved SLING-7538.

Resolution: Invalid

> Request attributes not correctly reset after using data-sly-resource or 
> data-sly-include with requestAttributes
> ---
>
> Key: SLING-7538
> URL: https://issues.apache.org/jira/browse/SLING-7538
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting HTL Engine 1.0.20
>Reporter: Konrad Windszus
>Assignee: Radu Cotescu
>Priority: Major
>
> The option {{requestAttributes}} introduced with SLING-5812 does not 
> correctly reset the request attributes after the request dispatcher returned. 
> The reason for that is that 
> https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/3b50f91c4f600081f0585e50dfb775c4b2856b89/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java#L115
>  does only reset those reset attributes which have been previously attached 
> to the request. In fact also all attributes which have been added initially 
> through the {{requestAttributes}} option need to be removed as well. If you 
> add a new request attribute to the request this new request attribute will 
> not be removed and would still be leveraged in a subsequent call to 
> `data-sly-resource` based on the same request (even if that one doesn't even 
> set an option {{requestAttributes}}).
> The same applies to 
> https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/3b50f91c4f600081f0585e50dfb775c4b2856b89/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/IncludeRuntimeExtension.java#L73.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7538) Request attributes not correctly reset after using data-sly-resource or data-sly-include with requestAttributes

2018-03-20 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406007#comment-16406007
 ] 

Konrad Windszus commented on SLING-7538:


[~vladb] Thanks for the info. Indeed upgrading to the latest CFP fixes this. So 
definitely not a Sling issue here but rather with the AEM implementation.

> Request attributes not correctly reset after using data-sly-resource or 
> data-sly-include with requestAttributes
> ---
>
> Key: SLING-7538
> URL: https://issues.apache.org/jira/browse/SLING-7538
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting HTL Engine 1.0.20
>Reporter: Konrad Windszus
>Assignee: Radu Cotescu
>Priority: Major
>
> The option {{requestAttributes}} introduced with SLING-5812 does not 
> correctly reset the request attributes after the request dispatcher returned. 
> The reason for that is that 
> https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/3b50f91c4f600081f0585e50dfb775c4b2856b89/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java#L115
>  does only reset those reset attributes which have been previously attached 
> to the request. In fact also all attributes which have been added initially 
> through the {{requestAttributes}} option need to be removed as well. If you 
> add a new request attribute to the request this new request attribute will 
> not be removed and would still be leveraged in a subsequent call to 
> `data-sly-resource` based on the same request (even if that one doesn't even 
> set an option {{requestAttributes}}).
> The same applies to 
> https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/3b50f91c4f600081f0585e50dfb775c4b2856b89/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/IncludeRuntimeExtension.java#L73.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)