Skip to content
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

Merged
merged 16 commits into from Oct 9, 2016

Conversation

Projects
None yet
2 participants
@fhoeben
Copy link
Collaborator

commented Sep 17, 2016

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.

@amolenaar
Copy link
Collaborator

left a comment

Looks good.

@@ -18,6 +18,8 @@

ScenarioTable getScenario(String scenarioName);

ScenarioTable getScenarioByPatternMatching(String invokingString, CustomComparatorRegistry customComparatorRegistry);

This comment has been minimized.

Copy link
@amolenaar

amolenaar Sep 17, 2016

Collaborator

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) {

This comment has been minimized.

Copy link
@amolenaar

amolenaar Sep 17, 2016

Collaborator

Same method rename here.

fhoeben added some commits Sep 17, 2016

Sorting should be more efficient (according to the javadoc) when only…
… a few of the elements must be re-ordered. In this case only the scenarios added since the last time we sorted.
@fhoeben

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 17, 2016

Renamed as suggested, and added small optimization: no need to sort the scenarios for each lookup

fhoeben added some commits Sep 18, 2016

Only scenarios with inputs need to be in the list to find scenarios b…
…ased on single cell parsing (the ones without arguments are found based on their name alone)
Initial collections should have larger sizes than Java defaults (16 f…
…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.
Only maintain list of scenarios with inputs after the first time it i…
…s needed (i.e. the first time a single cell script table row is encountered)

@amolenaar amolenaar added this to the Next Release milestone Sep 28, 2016

@amolenaar amolenaar merged commit 640876b into unclebob:master Oct 9, 2016

amolenaar added a commit that referenced this pull request Oct 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.