-
Type: Task
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.3.0
-
Component/s: QA / CI / Tests
-
Tags:
-
Sprint:NOS 10.10.3 - end dec, NOS 10.10.4 - begin jan
-
Story Points:0
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.
@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:
- Declare a repeatable annotation type @Tester
- Change the existing annotation type @Testers into a containing annotation type.
- Change the mechanism of retrieving the annotations in abstract build test case.
And the future Studio JSF Build Test should look like:
@Tester(ActionFeatureTester.class) @Tester(AutomationScriptingTester.class) @Tester(BrandingTester.class) ... @Tester(XmlFeatureTester.class) @Tester(WorkflowFeatureTester.class) public class StudioJSFBuildTest extends AbstractBuildTestCase { ... }
- links to