Uploaded image for project: 'Nuxeo Studio'
  1. Nuxeo Studio
  2. NXS-5071

Improve testers logic

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0
    • Component/s: Testing
    • Tags:
    • Sprint:
      NOS 10.10.3 - end dec, NOS 10.10.4 - begin jan
    • Story Points:
      0

      Description

      Context

      In Studio, annotation @Testers can be use to define an array of ModelTester to use in a Studio integration test. It allows us to define a set of tests for a specific context. For example, Studio JSF Build Test is a set of tests organized by testers.

      com.nuxeo.studio.test.StudioJSFBuildTest.java
      @Testers({ DocumentTypeTester.class, DocumentTypeHierarchyTester.class, LifeCycleTester.class,
          ParentVocabularyTester.class, ChildVocabularyTester.class, HierarchicalVocabularyTester.class,
          TemplateFeatureTester.class, OpChainTester.class, OpRestBindingTester.class, EventFeatureTester.class,
          XmlFeatureTester.class, DeployFeatureTester.class, ActionFeatureTester.class, SchemaTester.class,
          SearchFeatureTester.class, SearchFeatureDefaultTester.class, BrandingTester.class, CompatBrandingTester.class,
          ContentViewSimpleFeatureTester.class, ContentViewComplexFeatureTester.class,
          ContentViewReferenceFeatureTester.class, ContentViewElasticsearchFeatureTester.class,
          LayoutFeatureTester.class, ResultLayoutFeatureTester.class, TabFeatureTester.class,
          WorkflowFeatureTester.class, CSVVocabularyTester.class, CSVHierarchicalVocabularyTester.class,
          AutomationScriptingTester.class, ScaffoldLayoutFeatureTester.class, ScaffoldTabFeatureTester.class,
          ScaffoldAllTabFeatureTester.class, PageProviderSimpleFeatureTester.class,
          PageProviderElasticsearchFeatureTester.class, PageProviderTrashStateFeatureTester.class,
          PageProviderTrashStateComplexFeatureTester.class })
      public class StudioJSFBuildTest extends AbstractBuildTestCase {
          ...
      }
      

      As you can see, the code formatting is hard to understand, because of the number of the testers present inside the @Testers container.

      Proposal

      Improve testers logic by introducing the Java 8 feature: repeatable annotations. Create a new annotation @Tester, which is the repeatable annotation type of container type @Testers. More precisely, 3 steps are required for such implementation:

      1. Declare a repeatable annotation type @Tester
      2. Change the existing annotation type @Testers into a containing annotation type.
      3. Change the mechanism of retrieving the annotations in abstract build test case.

      And the future Studio JSF Build Test should look like:

      com.nuxeo.studio.test.StudioJSFBuildTest.java
      @Tester(ActionFeatureTester.class)
      @Tester(AutomationScriptingTester.class)
      @Tester(BrandingTester.class)
      ...
      @Tester(XmlFeatureTester.class)
      @Tester(WorkflowFeatureTester.class)
      public class StudioJSFBuildTest extends AbstractBuildTestCase {
          ...
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours
                  3h

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.