You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Pooja Kothari (JIRA)" <ji...@apache.org> on 2011/02/18 15:45:38 UTC
[jira] Created: (SLING-1984) [Patch] Support for running individual
test method in junit module and integration with eclipse runner
[Patch] Support for running individual test method in junit module and integration with eclipse runner
------------------------------------------------------------------------------------------------------
Key: SLING-1984
URL: https://issues.apache.org/jira/browse/SLING-1984
Project: Sling
Issue Type: Improvement
Components: Testing
Reporter: Pooja Kothari
Priority: Minor
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (SLING-1984) [Patch] Support for running individual
test method in junit module and integration with eclipse runner
Posted by "Pooja Kothari (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-1984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pooja Kothari updated SLING-1984:
---------------------------------
Attachment: junit-patch
> [Patch] Support for running individual test method in junit module and integration with eclipse runner
> ------------------------------------------------------------------------------------------------------
>
> Key: SLING-1984
> URL: https://issues.apache.org/jira/browse/SLING-1984
> Project: Sling
> Issue Type: Improvement
> Components: Testing
> Reporter: Pooja Kothari
> Priority: Minor
> Attachments: junit-patch
>
>
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (SLING-1984) [Patch] Support for running individual
test method in junit module and integration with eclipse runner
Posted by "Pooja Kothari (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-1984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pooja Kothari updated SLING-1984:
---------------------------------
Attachment: patch.txt
New patch with the changes suggested.
> [Patch] Support for running individual test method in junit module and integration with eclipse runner
> ------------------------------------------------------------------------------------------------------
>
> Key: SLING-1984
> URL: https://issues.apache.org/jira/browse/SLING-1984
> Project: Sling
> Issue Type: Improvement
> Components: Testing
> Reporter: Pooja Kothari
> Assignee: Bertrand Delacretaz
> Priority: Minor
> Attachments: junit-patch, patch.txt
>
>
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (SLING-1984) [Patch] Support for running
individual test method in junit module and integration with eclipse runner
Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-1984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996465#comment-12996465 ]
Bertrand Delacretaz commented on SLING-1984:
--------------------------------------------
Thanks very much for this contribution, here are my comments after reviewing it - I'll number my comments to make it easier to reply.
1. Can you confirm the use case? IIUC the goal is to allow executing tests from an IDE - for example if you execute your RemoteJUnit4Test in your IDE, it runs on a remote Sling instance and you get tests results in the IDE, exactly as if the test ran locally.
Can you also debug the tests remotely when doing that?
2. I'd rather put those new classes in a separate "junit remote" module, to keep the dependencies of the junit core module minimal, so that it can be reused in other OSGi environments. No big deal, I could do that refactoring after we apply your patch.
3. Using Logger instead of System.out or err is preferred (ExecutionRule.java)
4. Your patches to RequestInfo break the current navigation in tests, for example currently a GET on /system/sling/junit/org.apache.foo.html selects all test classes that start with "org.apache.foo". I'd like to keep this, and use request parameters only when absolutely required, which I think is the case for selecting a method in a test class.
5. Do you think OUTPUT_FORMAT_PARAMETER is needed? The extension should be sufficient to select the output format?
6. Why this change in JUnitServlet? I think it breaks things (and I should add tests for said things ;-)
final String pi = request.getPathInfo();
- if(pi == null) {
+ if(request.getParameterMap() == null) {
7. For us to apply the patch we need the "Grant license to ASF for inclusion in ASF works" checkbox to be checked when uploading a patch - if you agree and are allowed to do that, of course.
Don't be put off by the long list of comments!
I'm sure this can be very useful for people who use IDEs to run tests, but I don't usually do that so I'll need to understand the context better - again thanks, and feel free to discuss things on the Sling dev list if it's easier, see http://sling.apache.org/site/project-information.html#ProjectInformation-lists
> [Patch] Support for running individual test method in junit module and integration with eclipse runner
> ------------------------------------------------------------------------------------------------------
>
> Key: SLING-1984
> URL: https://issues.apache.org/jira/browse/SLING-1984
> Project: Sling
> Issue Type: Improvement
> Components: Testing
> Reporter: Pooja Kothari
> Assignee: Bertrand Delacretaz
> Priority: Minor
> Attachments: junit-patch
>
>
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Assigned: (SLING-1984) [Patch] Support for running
individual test method in junit module and integration with eclipse runner
Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-1984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bertrand Delacretaz reassigned SLING-1984:
------------------------------------------
Assignee: Bertrand Delacretaz
> [Patch] Support for running individual test method in junit module and integration with eclipse runner
> ------------------------------------------------------------------------------------------------------
>
> Key: SLING-1984
> URL: https://issues.apache.org/jira/browse/SLING-1984
> Project: Sling
> Issue Type: Improvement
> Components: Testing
> Reporter: Pooja Kothari
> Assignee: Bertrand Delacretaz
> Priority: Minor
> Attachments: junit-patch
>
>
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (SLING-1984) [Patch] Support for running
individual test method in junit module and integration with eclipse runner
Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-1984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999448#comment-12999448 ]
Bertrand Delacretaz commented on SLING-1984:
--------------------------------------------
Forgot the URL:
[1] http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/exported/ExampleRemoteTest.java
> [Patch] Support for running individual test method in junit module and integration with eclipse runner
> ------------------------------------------------------------------------------------------------------
>
> Key: SLING-1984
> URL: https://issues.apache.org/jira/browse/SLING-1984
> Project: Sling
> Issue Type: Improvement
> Components: Testing
> Reporter: Pooja Kothari
> Assignee: Bertrand Delacretaz
> Priority: Minor
> Attachments: junit-patch, patch.txt
>
>
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (SLING-1984) [Patch] Support for running
individual test method in junit module and integration with eclipse runner
Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-1984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999447#comment-12999447 ]
Bertrand Delacretaz commented on SLING-1984:
--------------------------------------------
Revision 1074632 contains this feature, largely based on your code but adapted to the current state of the testing tools.
With this I've been able to run the ExampleRemoteTest [1] remotely from Eclipse, by starting a Sling instance with all the bundles from sling/testing active, and setting this system property in Eclipse when running the tests:
-Dsling.remote.test.url=http://localhost:8080/system/sling/junit/
Please cross-check and again thanks for your contribution!
> [Patch] Support for running individual test method in junit module and integration with eclipse runner
> ------------------------------------------------------------------------------------------------------
>
> Key: SLING-1984
> URL: https://issues.apache.org/jira/browse/SLING-1984
> Project: Sling
> Issue Type: Improvement
> Components: Testing
> Reporter: Pooja Kothari
> Assignee: Bertrand Delacretaz
> Priority: Minor
> Attachments: junit-patch, patch.txt
>
>
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (SLING-1984) [Patch] Support for running
individual test method in junit module and integration with eclipse runner
Posted by "Pooja Kothari (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-1984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997269#comment-12997269 ]
Pooja Kothari commented on SLING-1984:
--------------------------------------
Reply to the above comments:
1. Yes, the requirement is to be able to run the test from IDE (even running a single test method). Also, we can achieve this, we will be able to run the tests from maven command using mvn test.
Yes, we can debug the test remotely.
2. Accepted.
3. Accepted.
4, 5, 6. After my changes user needs to provide the information in request parameters (since I just wanted to read *complete* information from request parameters). Other changes were done to achieve the same.
But as you said that you would like to maintain the current flow and use the request parameters only when required, I am fine with that. I will re-post the patch with only *minimal* changes required.
> [Patch] Support for running individual test method in junit module and integration with eclipse runner
> ------------------------------------------------------------------------------------------------------
>
> Key: SLING-1984
> URL: https://issues.apache.org/jira/browse/SLING-1984
> Project: Sling
> Issue Type: Improvement
> Components: Testing
> Reporter: Pooja Kothari
> Assignee: Bertrand Delacretaz
> Priority: Minor
> Attachments: junit-patch
>
>
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira