-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Core] Deprecate Formatter interface #1407
Conversation
@@ -86,7 +86,7 @@ private void addPlugins(CucumberOptions options, List<String> args) { | |||
for (String plugin : plugins) { | |||
args.add("--plugin"); | |||
args.add(plugin); | |||
if (PluginFactory.isFormatterName(plugin)) { | |||
if (PluginFactory.isPluginName(plugin)) { | |||
pluginSpecified = true; |
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 this if statement can be removed. It connects to the null formatter. Before we were using events the null formatter was required because we had to call a method on some object. Now I believe this is no longer required.
See the Null_object_pattern.
Can you check if this is right?
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.
Will try :)
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.
Removing the if statement, changes the result of RuntimeOptionsFactoryTest.create_null_formatter_when_no_formatter_plugin_is_defined()
so that "cucumber.runtime.formatter.AnyStepDefinitionReporter" plugin is used, rather than "cucumber.runtime.formatter.NullFormatter".
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.
Okay. So now the null formatter is gone (replaced by no formatter), this test should be changed to check if no formatter is there instead.
*/ | ||
public interface ColorAware extends Formatter { | ||
public interface ColorAware extends Plugin { |
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.
Nice!
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.
\o/
* | ||
* @see EventListener | ||
* @see Plugin | ||
* @deprecated as of version 4.0.0; use {@link Plugin } or {@link EventListener } instead. |
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.
Is this "or" or "and"?
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.
Should be both, although sometimes ColorAware and/or StrictAware instead of Plugin.
*/ | ||
public interface StrictAware extends Formatter { | ||
public interface StrictAware extends Plugin { |
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.
Do you think it would be a good idea for all marker interfaces to extend from Plugin?
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.
Not sure what you mean; did I miss anything?
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.
The EventListner I believe
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.
EventListener is not a marker interface; it has a method: void setEventPublisher(EventPublisher publisher);
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.
Good one.
Would it be a good idea to make EventListener extend from Plugin?
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.
Yes. (Updated)
Some updates, based on review. Will need to look at first comment later.
|
Ideally yes, but between parallel cukes and Aslak upgrading gherkin this will be painfull. |
Ok, so let's do the renaming later (after those other PRs are merged?). |
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. |
Summary
Deprecate Formatter marker interface
Details
Deprecate Formatter marker interface and replace all usages of Formatter with Plugin and EventListener.
Motivation and Context
Fixes #1401
How Has This Been Tested?
mvn clean install
Screenshots (if appropriate):
Types of changes
Not sure
Checklist: