You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Thierry Ygé (JIRA)" <ji...@apache.org> on 2016/01/07 16:00:48 UTC

[jira] [Commented] (SLING-5352) TeleporterRule test bundles should be installed once per test class only

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

Thierry Ygé commented on SLING-5352:
------------------------------------

Note that new sling junit core is available that support / embbed the updated junit 4.12, so now this can be implemented as I mentioned in my previous post https://issues.apache.org/jira/browse/SLING-5352?focusedCommentId=15049314&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15049314

It would be really great to have this improvement included in the next teleporter release :)


> TeleporterRule test bundles should be installed once per test class only
> ------------------------------------------------------------------------
>
>                 Key: SLING-5352
>                 URL: https://issues.apache.org/jira/browse/SLING-5352
>             Project: Sling
>          Issue Type: Improvement
>          Components: Testing
>    Affects Versions: JUnit Tests Teleporter 1.0.4
>            Reporter: Thierry Ygé
>            Assignee: Bertrand Delacretaz
>         Attachments: clientsideteleporter_patch.txt, clientsideteleporter_patch_v2.txt, clientsideteleporter_patch_v3.txt, teleporter_test_classrule.tgz
>
>
> Currently it's not possible to use the TeleporterRule as Rule and ClassRule annotation. 
> The idea is that BeforeClass will create the bundle and install it.
> AfterClass will uninstall it. This will optimize the processing and avoid a lot of round trip  and waits. It still allow to use it as in the original version with only Rule annotation.
> I have made some test , and will attach my suggested solution. It allow to use it as before:
> {code}
>     @Rule
>     public TeleporterRule classRule = TeleporterRule.forClass(SomeMoreTest.class, "Launchpad");
> {code}
> or as follow with a ClassRule annotation:
> {code}
>     @ClassRule
>     public static TeleporterRule classRule = TeleporterRule.forClass(SomeTest.class, "Launchpad");
>     @Rule
>     public TeleporterRule teleporterRule = classRule;
> {code}
> The changes are not so big, it only need a static field to store the bundle  symbolic name value in the case it is used with the ClassRule annotation. Then adapt the logic in the statement to differentiate between ClassRule and Rule usages.



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