[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-26 Thread Satya Deep Maheshwari (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14602456#comment-14602456
 ] 

Satya Deep Maheshwari commented on SLING-4757:
--

[~bdelacretaz] [~petr.shypila], if I run the integration tests without forking 
a new thread (using -DforkCount=0 ) , the tests consistently fail on my 
computer with the below error:

{{
initializationError(org.apache.sling.commons.contentdetection.internal.it.ContentAwareMimeTypeServiceImplIT)
  Time elapsed: 0.001 sec   ERROR!
java.lang.RuntimeException: Error getting bundle list 
mvn:org.apache.sling/org.apache.sling.launchpad/7/xml/bundlelist
at java.net.URL.init(URL.java:593)
at java.net.URL.init(URL.java:483)
at java.net.URL.init(URL.java:432)
at 
org.apache.sling.paxexam.util.SlingPaxOptions.dumpMvnUrlToTmpFile(SlingPaxOptions.java:203)
at 
org.apache.sling.paxexam.util.SlingPaxOptions.slingBundleList(SlingPaxOptions.java:121)
at 
org.apache.sling.paxexam.util.SlingPaxOptions.slingLaunchpadBundles(SlingPaxOptions.java:188)
at 
org.apache.sling.paxexam.util.SlingPaxOptions.defaultLaunchpadOptions(SlingPaxOptions.java:87)
at 
org.apache.sling.commons.contentdetection.internal.it.U.paxConfig(U.java:37)
at 
org.apache.sling.commons.contentdetection.internal.it.ContentAwareMimeTypeServiceImplIT.config(ContentAwareMimeTypeServiceImplIT.java:103)
}} 

Is this replicable on your computer? I encountered this while trying to debug 
an IT for which I had to run it in a single thread.

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-26 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14602491#comment-14602491
 ] 

Bertrand Delacretaz commented on SLING-4757:


Yes I get the same error with  {{-DforkCount=0}}, probably because the mvn: URL 
protocol is not registered correctly in this case.

Why would you need  {{-DforkCount=0}} ?

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-26 Thread Petr Shypila (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14602494#comment-14602494
 ] 

Petr Shypila commented on SLING-4757:
-

Same for me. But this error appears on other modules as well(e.g. 
contentloader).

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-26 Thread Satya Deep Maheshwari (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14602559#comment-14602559
 ] 

Satya Deep Maheshwari commented on SLING-4757:
--

I need to remotely connect to the maven build while its executing the ITs to 
debug something I was trying out. By default, surefire forks a different thread 
for ITs. In order to be able to connect, I need it to run on the same thread as 
the maven build. Please see [1]

The mvn based url (i.e. mvn://...) seems to be related to 
{{java.protocol.handler.pkgsorg.ops4j.pax.url/java.protocol.handler.pkgs}}

[1] - 
http://maven.apache.org/surefire/maven-surefire-plugin/examples/debugging.html

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-26 Thread Satya Deep Maheshwari (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14602562#comment-14602562
 ] 

Satya Deep Maheshwari commented on SLING-4757:
--

And I am unable to execute the test from within the IDE (Intellij) as well as 
it fails with the same error.

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-26 Thread Petr Shypila (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14602564#comment-14602564
 ] 

Petr Shypila commented on SLING-4757:
-

Satya, I'm had very same problem.
That's how I run build to connect to remotely: 
For IT: mvn verify failsafe:integration-test -Dmaven.failsafe.debug
For Unit: mvn test surefire:test -Dmaven.surefire.debug

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-26 Thread Satya Deep Maheshwari (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14602582#comment-14602582
 ] 

Satya Deep Maheshwari commented on SLING-4757:
--

Thanks. That works perfectly!

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-26 Thread Satya Deep Maheshwari (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14602581#comment-14602581
 ] 

Satya Deep Maheshwari commented on SLING-4757:
--

Thanks. That works perfectly!

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-24 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14600102#comment-14600102
 ] 

Bertrand Delacretaz commented on SLING-4757:


In http://svn.apache.org/r1687365 I have added a BasicInitialContentIT that 
uses pax exam to install a test bundle that contains some initial content. 
[~petr.shypila] you can use this as a basis for creating more similar tests 
that use the readers for the various initial content formats (beside just json 
for this test) and also test the import options described at [1]: overwrite, 
overwriteProperties, etc.

You'll need to study the ContentBundleTestBase to understand how the test 
works. It's using a RetryRule as the installed content does not appear 
immediately after installing the test bundle, but that rule executes the 
@Before methods on every retry, so I had to use some static state to make sure 
the test bundle is installed only once.

[1] 
https://sling.apache.org/documentation/bundles/content-loading-jcr-contentloader.html

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-18 Thread Satya Deep Maheshwari (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14591701#comment-14591701
 ] 

Satya Deep Maheshwari commented on SLING-4757:
--

+1. Perhaps we can revisit this later if this gets addressed in the tika 
Detector api in future.

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-18 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14591690#comment-14591690
 ] 

Bertrand Delacretaz commented on SLING-4757:


Thanks for testing! The memory issue might be specific to my environment, but 
in the meantime I found how to increase the memory of the JVM that runs pax 
exam: I needed to increase the JVM memory of the maven-failsafe-plugin, as Pax 
Exam does not fork a new JVM.

[~satyadeep]'s test (refactored into the detectFromContent test as they were 
very similar) now passes.

I have also added a comment about InputStream mark/reset being required, and 
modified the ContentAwareMimeTypeService interface and implementation to throw 
IllegalArgumentException if that's not the case. I think it's better to fail 
loudly in this case rather than silently ignoring the contentStream (as the 
Tika detector does) which can lead to hard to troubleshoot problems.

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-18 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14591694#comment-14591694
 ] 

Bertrand Delacretaz commented on SLING-4757:


[~satyadeep] said on github :

bq.  I think there is an assumption in Tika's MagicDetector that the stream 
would always support mark/reset. Probably it should check it explicitly and not 
proceed if that's not the case.

So it looks like we agree on throwing IllegalArgumentException as indicated 
above.

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-18 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14591595#comment-14591595
 ] 

Bertrand Delacretaz commented on SLING-4757:


Thanks for your contribution, I have committed your test but had to set it to 
@Ignore as it would fail on my box (macosx, java 1.7,  export 
MAVEN_OPTS=-Xmx1G  -XX:MaxPermSize=256m) with an OutOfMemoryError: PermGen 
space.

If you remove the @Ignore in ContentAwareMimeTypeServiceImplIT, do the tests 
pass for you at revision 1686172 ?

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-18 Thread Satya Deep Maheshwari (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14591637#comment-14591637
 ] 

Satya Deep Maheshwari commented on SLING-4757:
--

The test passes on my computer (CentOS 6.5, 64 bit)/java version 1.8.0_45. 
Also tried on java 1.7.0_71-b14 and it succeeds with it as well with 
MAVEN_OPTS=-Xmx1G -XX:MaxPermSize=256m .

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-18 Thread Petr Shypila (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14591646#comment-14591646
 ] 

Petr Shypila commented on SLING-4757:
-

Bertrand, I have macosx as well. And I have this problem too. However if I run 
it as a single JUnit test through my IDE everything goes well. Sorry, that I 
didn't notice that in my report, just thought it's a problem only on my side 
and I just configured something wrong.

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-18 Thread Petr Shypila (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14591645#comment-14591645
 ] 

Petr Shypila commented on SLING-4757:
-

Bertrand, I have macosx as well. And I have this problem too. However if I run 
it as a single JUnit test through my IDE everything goes well. Sorry, that I 
didn't notice that in my report, just thought it's a problem only on my side 
and I just configured something wrong.

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 content-tampering-test.patch, week2-part1-unit-tests.patch, 
 week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-01 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14567107#comment-14567107
 ] 

Bertrand Delacretaz commented on SLING-4757:


I have committed your unit tests in revision 1682844, thanks! 
With minor changes in revision 1682845.

Made a small change to FileNameExtractorImpl in revision 1682850,  that allows 
checking the (unlikely) UnsupportedEncodingException. I said earlier that we 
want to minimize changes to the main code, but in this case it makes it more 
testable without impact on its functionality, so I think it's a valid exception.

I'll look at the integration tests later, hopefully today in 3-4 hours.

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 week2-part1-unit-tests.patch, week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-06-01 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14567455#comment-14567455
 ] 

Bertrand Delacretaz commented on SLING-4757:


I have now committed your integration tests as well, and updated various things 
to be able to use the coverage reports as per SLING-4760 (revision 1682931).

For this I had to remove the use of easymock, as this caused trouble with the 
jacoco-maven-plugin (which generates coverage reports), probably due to some 
bytecode manipulation, I haven't checked the details. Anyway, the tests look 
simpler to me in this way, and if we need mocking I usually use Mockito which 
seems to play well with jacoco-maven-plugin.

As a result, if you now run {{mvn clean install -P jacoco-report}} you get 3 
test coverage reports as described at SLING-4760 (might require doing an {{mvn 
clean install}} of the sling/parent module for now as that's referred as a 
SNAPSHOT).

Looking at the {{ContentAwareMimeTypeServiceImpl}} coverage report for example, 
we see that the unit tests do not fully test the class [1], but the integration 
tests [2] test the rest so that we get full coverage once the reports are 
merged [3].

I think that's a good example of what we'd like to achieve: close to 100% test 
coverage based on a combination of unit and integration tests, allowing us to 
use integration tests when mocking things becomes too much of a hassle.

This is a very simple module of course, so a basic example, but we'll try to 
reproduce similar results later on beefier modules. Full 100% coverage does not 
always make sense, but in this case it's easy to attain so why not.

Let me know if you can reproduce the same results in your environment, and if 
yes we can move on to improving tests in other modules. I'll discuss which 
modules to tackle next on our dev list.

[1] 
target/site/jacoco-unit/org.apache.sling.commons.contentdetection.internal/ContentAwareMimeTypeServiceImpl.html
[2] 
target/site/jacoco-it/org.apache.sling.commons.contentdetection.internal/ContentAwareMimeTypeServiceImpl.html
[3] 
target/site/jacoco-merged/org.apache.sling.commons.contentdetection.internal/ContentAwareMimeTypeServiceImpl.html

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 week2-part1-unit-tests.patch, week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-05-31 Thread Petr Shypila (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14566702#comment-14566702
 ] 

Petr Shypila commented on SLING-4757:
-

Problem was solved by changing reference's type from implementation to 
interface. 
Integration tests are presented in a second patch 
(week2-part2-integration-tests.patch).

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila
 Attachments: 
 FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch, 
 week2-part1-unit-tests.patch, week2-part2-integration-tests.patch


 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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


[jira] [Commented] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module

2015-05-28 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14562564#comment-14562564
 ] 

Bertrand Delacretaz commented on SLING-4757:


We should also check that the jacoco report takes the integration tests into 
account. I think it should be the case but we need to check it.

 Improve test coverage and add integration tests to the contentdetection module
 --

 Key: SLING-4757
 URL: https://issues.apache.org/jira/browse/SLING-4757
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Bertrand Delacretaz
Assignee: Petr Shypila

 The new SLING-4694 contentdetection module has reasonable test coverage but 
 there are some gaps, and it's also missing some integration tests to verify 
 that the services provided by the bundle are correctly made available in an 
 OSGI environment.
 I'll take this opportunity to ask our GSoC student [~petr.shypila] to expand 
 these tests, as that's a good example of what we're trying to do with his 
 tests improvement project.
 So [~petr.shypila] here's your mission ;-)
 Buliding bundles/commons/contentdetection with with -Pjacoco-report and 
 looking at target/site/jacoco/index.html shows that a few things are not 
 tested. The first step is to add the missing unit tests to improve that, 
 maybe provide a first patch with just that.
 Then, we'd like to add integration tests that start this bundle in an OSGi 
 environment and verify that the ContentAwareMimeTypeService and 
 FileNameExtractor services are available and work. No need to duplicate the 
 unit tests, just verify that the services are here and work in a simple case.
 The best way to do this is probably with Pax Exam, the 
 ResourceBundleProviderIT. is a good example of that and there are other 
 examples in our codebase if you search for *IT.java files that contain 
 pax.exam.
 As usual, try to minimize changes to the pom (except for what's directly 
 related to testing) and to non-test code.
 Feel free to ask if you have any questions of course, either here for minor 
 ones or on the dev list for larger discussions.
 [1]  
 https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java



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