Hi Thierry

TeleporterRule extends ExternalResource
ExternalResource implements TestRule

>From the documentation of TestRule[0]:
- "[...] TestRules can do everything that could be done previously
with methods annotated with Before, After, BeforeClass, or AfterClass,
[...]"
- "[...] Rule annotates method-level TestRules, and ClassRule
annotates class-level TestRules. [...]"

Why don't you give it a try?! And then report back whether it worked ;)

Regards
Julian

[0] http://junit.org/javadoc/latest/org/junit/rules/TestRule.html

On Thu, Dec 3, 2015 at 11:58 AM, Thierry Yge <[email protected]> wrote:
> Hi Julian,
>
> currently the teleporter is a method rule, so that is the point, maybe we
> need a teleporter rule that also applies at classrule level.
>
> Or maybe I am wrong here :)
>
> Regards,
> -Thierry
>
> On Thu, 3 Dec 2015, 10:17 a.m. Julian Sedding <[email protected]> wrote:
>
>> Hi Thierry
>>
>> I haven't tried it, but would imagine that annotating the rule with
>> @ClassRule should do the trick?
>>
>> Regards
>> Julian
>>
>> On Thu, Dec 3, 2015 at 9:44 AM, Thierry Yge <[email protected]> wrote:
>> > Hi Bertrand,
>> >
>> > I see that the TeleporterRule always create the same package, and at the
>> > end if you have multiple test in the same test class (which is usually
>> the
>> > case), and so eachtime it run a test from that class, it does create the
>> > tinybundle , send / install it on target sling instance, run the test and
>> > uninstall the bundle etc...
>> >
>> > That is a lot of round trip. Is there a way to instruct the Teleporter to
>> > do the tinybundle like in a "before class", and then run the test as
>> usual,
>> > then uninstall only at the end of the test ?
>> >
>> > At least if we could limit the number of round trip that would be nice,
>> to
>> > improve tests execution time.
>> >
>> > Any idea if that is already possible to achieve ?
>> >
>> > Best regards,
>> > -Thierry
>>

Reply via email to