[ https://issues.apache.org/jira/browse/DRILL-5320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sudheesh Katkam resolved DRILL-5320. ------------------------------------ Resolution: Fixed See DRILL-5319. > Refactor OptionManager for unit testing > --------------------------------------- > > Key: DRILL-5320 > URL: https://issues.apache.org/jira/browse/DRILL-5320 > Project: Apache Drill > Issue Type: Sub-task > Components: Tools, Build & Test > Affects Versions: 1.11.0 > Reporter: Paul Rogers > Assignee: Paul Rogers > Fix For: 1.11.0 > > > The {{OptionManager}} interface serves two purposes: > * Create and modify options > * Access option values > The implementations of this class are integrated with the rest of Drill, > making it difficult to use the classes in isolation in unit testing. Further, > since operators are given the full interface, the operator has the ability to > modify options, and so each unit test should either verify that no > modification is, in fact, done, or must track down modifications and test > them. > For operator and sub-operator unit tests we need a simpler interface. As it > turns out, most low-level uses of {{OptionManager}} are all read-only. This > allows a simple refactoring to enhance unit testability: create a new > super-interface {{OptionSet}}, which provides only the read-only methods. > Then, refactor low-level classes (code generation, compilers, and so on) to > use the restricted {{OptionSet}} interface. > Finally, for unit tests, create a trivial, map-based implementation that can > be populated as needed for each specific test. -- This message was sent by Atlassian JIRA (v6.3.15#6346)