[jira] [Updated] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module
[ https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bertrand Delacretaz updated SLING-4757: --- Fix Version/s: Content Detection Support 1.0.2 > 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 > Fix For: Content Detection Support 1.0.2 > > 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] [Updated] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module
[ https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Satya Deep Maheshwari updated SLING-4757: - Attachment: content-tampering-test.patch [~bdelacretaz] [~petr.shypila] , thanks for adding these tests. I think we should have one test to check that the content aware service does not manipulate the content in anyway while detecting the mime-type. I am attaching a patch which has this test. Please review. One more thing to note is that a tika detector expects that the content stream passed to it is able to support mark/reset. Please see [1] .I think that we should update the ContentAwareMimeTypeService docs to explicitly state that the content stream passed to is should support mark/reset. [1] - https://tika.apache.org/1.7/api/org/apache/tika/detect/Detector.html#detect(java.io.InputStream,%20org.apache.tika.metadata.Metadata) > 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] [Updated] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module
[ https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Petr Shypila updated SLING-4757: Attachment: 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] [Updated] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module
[ https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Petr Shypila updated SLING-4757: Attachment: FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch I'm faced with problems during creation integration tests for these classes. I try to inject services into my test using @javax.inject.Inject annotation. However it doesn't work for me and every time my test throws ClassNotFoundException. But injection of standard org.osgi.framework.BundleContext looks like works fine. I did everything very same with org.apache.sling.i18n.it.ResourceBundleProviderIT but it still doesn't work. I have also attached a patch FileNameExtractorImpl_Injection_failed__ClassNotFoundException with this test. Could you please help me to find where the problem is? Thank you. > 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 > > > 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] [Updated] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module
[ https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Petr Shypila updated SLING-4757: Attachment: week2-part1-unit-tests.patch First patch which contains unit tests. The thing I want to notice, is that I changed a bit FileNameExtractorImplTest architecture. I've replaced TestCase extending to @Test annotations, since as I know it's more applicable practice now. Is that ok? > 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: week2-part1-unit-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] [Updated] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module
[ https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bertrand Delacretaz updated SLING-4757: --- Description: 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 was: 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 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 you "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 > 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 a
[jira] [Updated] (SLING-4757) Improve test coverage and add integration tests to the contentdetection module
[ https://issues.apache.org/jira/browse/SLING-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bertrand Delacretaz updated SLING-4757: --- Assignee: Petr Shypila > 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 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 you "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)