Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-5352

TeleporterRule test bundles should be installed once per test class only

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • JUnit Tests Teleporter 1.0.4
    • None
    • Testing
    • None

    Description

      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:

          @Rule
          public TeleporterRule classRule = TeleporterRule.forClass(SomeMoreTest.class, "Launchpad");
      

      or as follow with a ClassRule annotation:

          @ClassRule
          public static TeleporterRule classRule = TeleporterRule.forClass(SomeTest.class, "Launchpad");
      
          @Rule
          public TeleporterRule teleporterRule = classRule;
      

      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.

      Attachments

        1. teleporter_test_classrule.tgz
          1 kB
          Thierry Ygé
        2. clientsideteleporter_patch.txt
          2 kB
          Thierry Ygé
        3. clientsideteleporter_patch_v3.txt
          3 kB
          Thierry Ygé
        4. clientsideteleporter_patch_v2.txt
          3 kB
          Thierry Ygé

        Issue Links

          Activity

            People

              bdelacretaz Bertrand Delacretaz
              petitbear68 Thierry Ygé
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: