[jira] [Updated] (SLING-5712) JUnit Tests Teleporter does not (compile) work on Windows as expected

2016-05-15 Thread Emanuele Lombardi (JIRA)

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

Emanuele Lombardi updated SLING-5712:
-
Attachment: 
TEST-org.apache.sling.testing.teleporter.client.SanitizeResourceNameTest.xml

> JUnit Tests Teleporter does not (compile) work on Windows as expected
> -
>
> Key: SLING-5712
> URL: https://issues.apache.org/jira/browse/SLING-5712
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Affects Versions: JUnit Tests Teleporter 1.0.6
> Environment: Windows 7 + Cygwin
>Reporter: Emanuele Lombardi
>Assignee: Bertrand Delacretaz
>Priority: Minor
> Fix For: JUnit Tests Teleporter 1.0.8
>
> Attachments: SanitizeResourceNameTest.patch, 
> TEST-org.apache.sling.repoinit.it.RepoInitIT.xml, 
> TEST-org.apache.sling.testing.teleporter.client.ClassResourceVisitorTest.xml, 
> TEST-org.apache.sling.testing.teleporter.client.SanitizeResourceNameTest.xml, 
> tinybundle-bundle-with-back-slash-as-resource-name.jar, windows.patch
>
>
> Checked out sling trunk, the build fails on Windows 7 because of 3 failing 
> tests on Teleporter module .
> See attachment 
> "TEST-org.apache.sling.testing.teleporter.client.ClassResourceVisitorTest.xml"
> This happens because the tests expectation is to find the resources with a 
> path unix like.
> Originally I tried to fix the issue by putting as expectation in the tests 
> code like
> {code:java}
>  assertResource(new File("/somepath/two.txt").getPath(), "two");
> {code}
> instead of 
> {code:java}
>  assertResource("/somepath/two.txt", "two");
> {code}
> to have the expectation not OS dependent.
> This was a good fix for the failing tests under Teleporter module but 
> unfortunately this fix causes RepoInitIT integration test failure because the 
> resource name returned by Teleporter ClassResourceVisitor used to create test 
> bundles inside ClientSideTeleporter#buildTestBundle must use '/' style 
> slashes, not '\' because of undocumented quirks of JDK:
> see org.ops4j.pax.tinybundles.core.intern.RawBuilder#build
> adding one entry into jars using class java.util.jar.JarEntry with entry name 
> like "\name" will create a jar containing a folder with an empty name 
> containing the resource.
> Unfortunately resources in Windows are returned with a path with backslashes.
> see attachments: "TEST-org.apache.sling.repoinit.it.RepoInitIT.xml" 
> "tinybundle-bundle-with-back-slash-as-resource-name.jar"
> So I had to do a dirty fix: replace inside ClassResourceVisitor#processFile 
> all "\" with "/".
> Will be correct to do a fix inside JDK or TinyBundles library, but it depends 
> also by what is expected to have in resourcePath parameter of method 
> ClassResourceVisitor.Processor#process; a resource name with "\" or "/" 
> regardless of operating system.
> See "windows.patch"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (SLING-5712) JUnit Tests Teleporter does not (compile) work on Windows as expected

2016-05-15 Thread Emanuele Lombardi (JIRA)

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

Emanuele Lombardi updated SLING-5712:
-
Attachment: SanitizeResourceNameTest.patch

Hi,
Thanks to having applied the patch.
I did a cross-check and there is a problem into SanitizeResourceNameTest.
At line 46 
{code:java}this.basePath = File.separator + basePath
{code} should be 
{code:java}this.basePath = new File(File.separator + basePath).getAbsolutePath()
{code}
This because in Windows when a File starts with root and the 
methodgetAbsolutePath() is invoked the root is replaced by C:\ (C or your drive 
letter)

In the method ClassResourceVisitor#sanitizeResourceName if basePath is 
"\something" instead of "C:\something" we will miss 2 characters to be deleted 
when substring method is invoked on resource.getAbsolutePath() that will be 
something like C:\resourceabsolutepath.

Attached a new patch.


> JUnit Tests Teleporter does not (compile) work on Windows as expected
> -
>
> Key: SLING-5712
> URL: https://issues.apache.org/jira/browse/SLING-5712
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Affects Versions: JUnit Tests Teleporter 1.0.6
> Environment: Windows 7 + Cygwin
>Reporter: Emanuele Lombardi
>Assignee: Bertrand Delacretaz
>Priority: Minor
> Fix For: JUnit Tests Teleporter 1.0.8
>
> Attachments: SanitizeResourceNameTest.patch, 
> TEST-org.apache.sling.repoinit.it.RepoInitIT.xml, 
> TEST-org.apache.sling.testing.teleporter.client.ClassResourceVisitorTest.xml, 
> tinybundle-bundle-with-back-slash-as-resource-name.jar, windows.patch
>
>
> Checked out sling trunk, the build fails on Windows 7 because of 3 failing 
> tests on Teleporter module .
> See attachment 
> "TEST-org.apache.sling.testing.teleporter.client.ClassResourceVisitorTest.xml"
> This happens because the tests expectation is to find the resources with a 
> path unix like.
> Originally I tried to fix the issue by putting as expectation in the tests 
> code like
> {code:java}
>  assertResource(new File("/somepath/two.txt").getPath(), "two");
> {code}
> instead of 
> {code:java}
>  assertResource("/somepath/two.txt", "two");
> {code}
> to have the expectation not OS dependent.
> This was a good fix for the failing tests under Teleporter module but 
> unfortunately this fix causes RepoInitIT integration test failure because the 
> resource name returned by Teleporter ClassResourceVisitor used to create test 
> bundles inside ClientSideTeleporter#buildTestBundle must use '/' style 
> slashes, not '\' because of undocumented quirks of JDK:
> see org.ops4j.pax.tinybundles.core.intern.RawBuilder#build
> adding one entry into jars using class java.util.jar.JarEntry with entry name 
> like "\name" will create a jar containing a folder with an empty name 
> containing the resource.
> Unfortunately resources in Windows are returned with a path with backslashes.
> see attachments: "TEST-org.apache.sling.repoinit.it.RepoInitIT.xml" 
> "tinybundle-bundle-with-back-slash-as-resource-name.jar"
> So I had to do a dirty fix: replace inside ClassResourceVisitor#processFile 
> all "\" with "/".
> Will be correct to do a fix inside JDK or TinyBundles library, but it depends 
> also by what is expected to have in resourcePath parameter of method 
> ClassResourceVisitor.Processor#process; a resource name with "\" or "/" 
> regardless of operating system.
> See "windows.patch"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] sling pull request: SLING-5677 provide a default customizer levera...

2016-05-15 Thread kwin
Github user kwin closed the pull request at:

https://github.com/apache/sling/pull/139


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Test errors in TeleporterHttpClientTest

2016-05-15 Thread Konrad Windszus
I get the following errors after the fixes from 
https://issues.apache.org/jira/browse/SLING-5715:

waitForStatusWithLongTimeout(org.apache.sling.testing.teleporter.client.TeleporterHttpClientTest)
  Time elapsed: 0.026 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class 
java.net.ProxySelector
at 
sun.net.www.protocol.http.HttpURLConnection$5.run(HttpURLConnection.java:919)
at 
sun.net.www.protocol.http.HttpURLConnection$5.run(HttpURLConnection.java:917)
at java.security.AccessController.doPrivileged(Native Method)
at 
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:915)
at 
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851)
at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301)
at 
org.apache.sling.testing.teleporter.client.TeleporterHttpClient.cleanup(TeleporterHttpClient.java:206)
at 
org.apache.sling.testing.teleporter.client.TeleporterHttpClient.getHttpGetStatus(TeleporterHttpClient.java:144)
at 
org.apache.sling.testing.teleporter.client.TeleporterHttpClientTest.waitForStatusWithLongTimeout(TeleporterHttpClientTest.java:61)

repeatedGetStatus(org.apache.sling.testing.teleporter.client.TeleporterHttpClientTest)
  Time elapsed: 0.106 sec  <<< ERROR!
java.lang.ExceptionInInitializerError: null
at 
sun.nio.fs.DefaultFileSystemProvider.create(DefaultFileSystemProvider.java:67)
at 
java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(FileSystems.java:108)
at 
java.nio.file.FileSystems$DefaultFileSystemHolder.access$000(FileSystems.java:89)
at 
java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:98)
at 
java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:96)
at java.security.AccessController.doPrivileged(Native Method)
at 
java.nio.file.FileSystems$DefaultFileSystemHolder.defaultFileSystem(FileSystems.java:95)
at 
java.nio.file.FileSystems$DefaultFileSystemHolder.(FileSystems.java:90)
at java.nio.file.FileSystems.getDefault(FileSystems.java:176)
at sun.util.calendar.ZoneInfoFile$1.run(ZoneInfoFile.java:483)
at sun.util.calendar.ZoneInfoFile$1.run(ZoneInfoFile.java:478)
at java.security.AccessController.doPrivileged(Native Method)
at sun.util.calendar.ZoneInfoFile.(ZoneInfoFile.java:477)
at sun.util.calendar.ZoneInfo.getTimeZone(ZoneInfo.java:663)
at java.util.TimeZone.getTimeZone(TimeZone.java:566)
at java.util.TimeZone.getTimeZone(TimeZone.java:562)
at 
com.fasterxml.jackson.databind.util.StdDateFormat.(StdDateFormat.java:68)
at 
com.fasterxml.jackson.databind.ObjectMapper.(ObjectMapper.java:276)
at com.github.tomakehurst.wiremock.common.Json.write(Json.java:41)
at 
com.github.tomakehurst.wiremock.client.HttpAdminClient.addStubMapping(HttpAdminClient.java:67)
at 
com.github.tomakehurst.wiremock.client.WireMock.register(WireMock.java:138)
at 
com.github.tomakehurst.wiremock.client.WireMock.register(WireMock.java:134)
at 
com.github.tomakehurst.wiremock.client.WireMock.givenThat(WireMock.java:65)
at 
org.apache.sling.testing.teleporter.client.TeleporterHttpClientTest.repeatedGetStatus(TeleporterHttpClientTest.java:85)

waitForStatusWithShortTimeout(org.apache.sling.testing.teleporter.client.TeleporterHttpClientTest)
  Time elapsed: 0.003 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class 
java.net.ProxySelector
at 
sun.net.www.protocol.http.HttpURLConnection$5.run(HttpURLConnection.java:919)
at 
sun.net.www.protocol.http.HttpURLConnection$5.run(HttpURLConnection.java:917)
at java.security.AccessController.doPrivileged(Native Method)
at 
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:915)
at 
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851)
at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301)
at 
org.apache.sling.testing.teleporter.client.TeleporterHttpClient.cleanup(TeleporterHttpClient.java:206)
at 
org.apache.sling.testing.teleporter.client.TeleporterHttpClient.getHttpGetStatus(TeleporterHttpClient.java:144)
at 
org.apache.sling.testing.teleporter.client.TeleporterHttpClientTest.waitForStatusWithShortTimeout(TeleporterHttpClientTest.java:72)

Exception in thread "Thread-0" java.lang.NoClassDefFoundError: Could not 
initialize class java.util.logging.LogManager
at java.util.logging.LogManager$Cleaner.run(LogManager.java:245)

Results :

Tests in error: 
  TeleporterHttpClientTest.repeatedGetStatus:85 » ExceptionInInitializer
  TeleporterHttpClientTest.waitForStatusWithLongTimeout:61 » NoClassDefFound 
Cou...
  TeleporterHttpClientTest.waitForStatusWithShortTimeout:72 

[jira] [Resolved] (SLING-5677) Provide default customizer for executing TeleporterRule tests

2016-05-15 Thread Konrad Windszus (JIRA)

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

Konrad Windszus resolved SLING-5677.

Resolution: Fixed

> Provide default customizer for executing TeleporterRule tests
> -
>
> Key: SLING-5677
> URL: https://issues.apache.org/jira/browse/SLING-5677
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Affects Versions: JUnit Tests Teleporter 1.0.8
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
> Fix For: JUnit Tests Teleporter 1.0.8, JUnit Core 1.0.18
>
>
> Currently for executing ITs leveraging {{TeleporterRule}} there need to be a 
> Customizer referenced, otherwise those ITs would not be executed.
> There should be a DefaultCustomizer which should be used, when there is no 
> other customizer referenced, which must support the following features:
> # setting baseUrl via system property
> # setting serverCredentials via system property
> # setting timeouts via system property
> # setting the dependencyPrefix (both includes and excludes) through system 
> properties.
> For a reasoning have a look at the discussion in 
> http://www.mail-archive.com/dev@sling.apache.org/msg55723.html.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5677) Provide default customizer for executing TeleporterRule tests

2016-05-15 Thread Konrad Windszus (JIRA)

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

Konrad Windszus commented on SLING-5677:


Applied the changes towards the junit.core and junit.teleporter in 
[r1743902|https://svn.apache.org/r1743902] and the sample project leveraging 
the property based customizer in [r1743904|https://svn.aache.org/r1743904].

> Provide default customizer for executing TeleporterRule tests
> -
>
> Key: SLING-5677
> URL: https://issues.apache.org/jira/browse/SLING-5677
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Affects Versions: JUnit Tests Teleporter 1.0.8
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
> Fix For: JUnit Tests Teleporter 1.0.8, JUnit Core 1.0.18
>
>
> Currently for executing ITs leveraging {{TeleporterRule}} there need to be a 
> Customizer referenced, otherwise those ITs would not be executed.
> There should be a DefaultCustomizer which should be used, when there is no 
> other customizer referenced, which must support the following features:
> # setting baseUrl via system property
> # setting serverCredentials via system property
> # setting timeouts via system property
> # setting the dependencyPrefix (both includes and excludes) through system 
> properties.
> For a reasoning have a look at the discussion in 
> http://www.mail-archive.com/dev@sling.apache.org/msg55723.html.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (SLING-5677) Provide default customizer for executing TeleporterRule tests

2016-05-15 Thread Konrad Windszus (JIRA)

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

Konrad Windszus updated SLING-5677:
---
Fix Version/s: JUnit Core 1.0.18
   JUnit Tests Teleporter 1.0.8

> Provide default customizer for executing TeleporterRule tests
> -
>
> Key: SLING-5677
> URL: https://issues.apache.org/jira/browse/SLING-5677
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Affects Versions: JUnit Tests Teleporter 1.0.8
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
> Fix For: JUnit Tests Teleporter 1.0.8, JUnit Core 1.0.18
>
>
> Currently for executing ITs leveraging {{TeleporterRule}} there need to be a 
> Customizer referenced, otherwise those ITs would not be executed.
> There should be a DefaultCustomizer which should be used, when there is no 
> other customizer referenced, which must support the following features:
> # setting baseUrl via system property
> # setting serverCredentials via system property
> # setting timeouts via system property
> # setting the dependencyPrefix (both includes and excludes) through system 
> properties.
> For a reasoning have a look at the discussion in 
> http://www.mail-archive.com/dev@sling.apache.org/msg55723.html.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (SLING-5729) pipe expressions should allow regexp with {n} or {n,m}

2016-05-15 Thread Nicolas Peltier (JIRA)

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

Nicolas Peltier updated SLING-5729:
---
Attachment: SLING-5729.patch

failing tests + fix (enhancement of the regexp used for extracting expressions) 
in attached patch

> pipe expressions should allow regexp with {n} or {n,m}
> --
>
> Key: SLING-5729
> URL: https://issues.apache.org/jira/browse/SLING-5729
> Project: Sling
>  Issue Type: Bug
>Reporter: Nicolas Peltier
>Priority: Minor
> Attachments: SLING-5729.patch
>
>
> expressions like
> {Code}
> ${(new Regexp('/foo/bar/./../.{8}').test(path)}"
> {Code}
> can't work right now because of the rather simple regexp for extracting them



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (SLING-5729) pipe expressions should allow regexp with {n} or {n,m}

2016-05-15 Thread Nicolas Peltier (JIRA)
Nicolas Peltier created SLING-5729:
--

 Summary: pipe expressions should allow regexp with {n} or {n,m}
 Key: SLING-5729
 URL: https://issues.apache.org/jira/browse/SLING-5729
 Project: Sling
  Issue Type: Bug
Reporter: Nicolas Peltier
Priority: Minor


expressions like
{Code}
${(new Regexp('/foo/bar/./../.{8}').test(path)}"
{Code}
can't work right now because of the rather simple regexp for extracting them



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (SLING-5728) enhance filterpipe logging

2016-05-15 Thread Nicolas Peltier (JIRA)

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

Nicolas Peltier updated SLING-5728:
---
Attachment: SLING-5728.patch

fix in attached patch

> enhance filterpipe logging
> --
>
> Key: SLING-5728
> URL: https://issues.apache.org/jira/browse/SLING-5728
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Reporter: Nicolas Peltier
>Priority: Minor
> Attachments: SLING-5728.patch
>
>
> - when a filter pipe's expression fails to generate a boolean, it should 
> output the expression instead of a ClassCast exception,
> - when a filter pipe filters out a resource, it should log this in DEBUG, not 
> INFO



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (SLING-5728) enhance filterpipe logging

2016-05-15 Thread Nicolas Peltier (JIRA)
Nicolas Peltier created SLING-5728:
--

 Summary: enhance filterpipe logging
 Key: SLING-5728
 URL: https://issues.apache.org/jira/browse/SLING-5728
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Reporter: Nicolas Peltier
Priority: Minor


- when a filter pipe's expression fails to generate a boolean, it should output 
the expression instead of a ClassCast exception,
- when a filter pipe filters out a resource, it should log this in DEBUG, not 
INFO



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)