New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All scenario resolution in test context #974
All scenario resolution in test context #974
Conversation
… test context (where basic scenario finding was already)
… the test context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
@@ -18,6 +18,8 @@ | |||
|
|||
ScenarioTable getScenario(String scenarioName); | |||
|
|||
ScenarioTable getScenarioByPatternMatching(String invokingString, CustomComparatorRegistry customComparatorRegistry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think getScenarioByPattern
is a more appropriate name.
@@ -330,6 +334,11 @@ public ScenarioTable getScenario(String scenarioName) { | |||
} | |||
|
|||
@Override | |||
public ScenarioTable getScenarioByPatternMatching(String invokingString, CustomComparatorRegistry customComparatorRegistry) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same method rename here.
…to re-sort unless the list has changed.
… a few of the elements must be re-ordered. In this case only the scenarios added since the last time we sorted.
Renamed as suggested, and added small optimization: no need to sort the scenarios for each lookup |
…ased on single cell parsing (the ones without arguments are found based on their name alone)
…or hashmap and 8 for list) since the number of scenarios could be much larger and resizing collections is much more expensive than having/allocating larger ones for each test.
…s needed (i.e. the first time a single cell script table row is encountered)
…, not to determine what the arguments are
… looking at all odd cells in the row
All scenario resolution in test context
This pull request moves all scenario resolution logic to the slim test context.
Furthermore it only creates the pattern to match a single cell scenario call with parameters once, instead of each time the scenario is evaluated to determine whether it matches.