Skip to content

The RuntimeOptionsFactory should add default feature path, glue path and formatter once #636

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

Merged

Conversation

brasmusson
Copy link
Contributor

Before #568 and the change from @Cucumber.options to @CucumberOptions, the following runner structure:

package thepackage

class BaseClass {}

@RunWith(Cucumber.class)
public class RunTest extends BaseClass {}

resulted in that the RuntimeOptions contains:

Feature paths: ["classpath:thepackage"]
Glue paths: ["classpath:thepackage"]
Formatters: [NullFormatter]

(one reason to have a runner base class could be to have @BeforeClass and @afterclass annotated methods there)

Since #568 is about using parameters from @CucumberOptions annotation from all levels of the runner inheritance hierarchy, there is no reason that the behavior when not using any @CucumberOptions annotations should not remain the same.

However, currently default feature path and default glue path are added once for each inheritance level where they are not explicitly defined (regardless whether a @CucumberOptions annotation exist on that level or not). And currently default formatter is added once for each inheritance level where the is an @CucumberOptions annotation which does not define formatters explicitly). The result is that the above runner structure result in a RuntimeOptions containing:

Feature paths: ["classpath:thepackage","classpath:thepackage"]
Glue paths: ["classpath:thepackage","classpath:thepackage"]
Formatters: [ProgressFormatter]

This PR reverts the RuntimeOptionsFactory behavior back to the original one regarding adding default feature paths, glue paths and formatters.

With this change the unique glue path work around in the TestNGCucumberRunner can be removed, and thus is neither #632 or #633 needed for that reason.

The RuntimeOptionsFactory should add default feature path, default glue
paht and default formatter once, not once per inheritance level.
@aslakhellesoy aslakhellesoy merged commit 494ec54 into cucumber:master Jun 26, 2014
aslakhellesoy added a commit that referenced this pull request Jun 26, 2014
@brasmusson brasmusson deleted the runtime-options-factory-add-default branch June 28, 2014 08:32
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants