-
Notifications
You must be signed in to change notification settings - Fork 49
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
Task/new osgi annotations #312
Task/new osgi annotations #312
Conversation
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.
For the future please create separate PR to fix only formatting and try not to mix reformatting fixes with code of the refactoring.
import org.osgi.framework.Constants; | ||
import org.osgi.service.component.annotations.*; |
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.
Please don't use *
imports.
core/worker/pom.xml
Outdated
<dependency> | ||
<groupId>org.osgi</groupId> | ||
<artifactId>org.osgi.service.metatype.annotations</artifactId> | ||
</dependency> |
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.
Dependency
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
</dependency>
is probably no longer necessary here?
description = "Url to selenium grid hub. When null local Chrome driver will be used. Local Chrome driver does not work on Linux", | ||
value = DEFAULT_SELENIUM_GRID_URL) | ||
private String seleniumGridUrl; | ||
private ChromeWebDriverFactoryConf chromeWebDriverFactoryConf; |
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.
In PRs for other modules I've seen convention of naming those properties config
. Could we please keep it also here?
public static final String PATH_DESC = "Custom path to driver binary"; | ||
|
||
public static final String SELENIUM_GRID_URL = "seleniumGridUrl"; | ||
public static final String LOG_FILE_PATH_LABEL = "Path to firefox error log"; | ||
|
||
public static final String SELENIUM_GRID_URL_LABEL = "Selenium grid URL"; |
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.
It look that those constants are only used in WebDriverProviderConf
. I believe they should be defined here.
This WebDriverHelper
look like generic class - so there should be no constants that have Firefox
or Chrome
words in it.
@@ -1,81 +1,58 @@ | |||
/** | |||
* AET | |||
* | |||
* <p> |
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.
Please remove this formatting changes form license header.
} | ||
|
||
public WebCommunicationWrapper createWebDriverWithProxy(String preferredWebDriver, String proxyName) | ||
public WebCommunicationWrapper createWebDriverWithProxy(String preferredWebDriver, |
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.
For the future could you please don't change formatting on the lines that didn't change during the refactoring?
Please create additional PR to fix only formatting.
|
||
@Property(name = DEFAULT_WEB_DRIVER_NAME, label = "Default Web Driver name", value = "ff") | ||
private String defaultWebDriverName; | ||
private WebDriverProviderConfig webDriverProviderConfig; |
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.
In PRs for other modules I've seen convention of naming those properties config
. Could we please keep it also here and other classes in this PR?
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.
You mean changing this to
private WebDriverProviderConfig config
?
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, and all other XYZConfig
fields in other services.
core/worker/pom.xml
Outdated
<dependency> | ||
<groupId>org.osgi</groupId> | ||
<artifactId>org.osgi.service.metatype.annotations</artifactId> | ||
</dependency> |
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.
You can also remove:
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.osgi</artifactId>
</dependency>
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.
No, I can't - WebDriverHelper uses PropertiesUtil from this package.
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.
Maybe -> return StringUtils.defaultString(properties.get(name), defaultValue);
at https://github.com/Cognifide/aet/blob/a024722d58c9704720199560a19ae4897058f555/core/worker/src/main/java/com/cognifide/aet/worker/drivers/WebDriverHelper.java#L39
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 method used (WebDriverHelper.getProp
)? Some of this method references were removed from ChromeWebDriverFactory.activate
.
Description
Migrate Felix annotations to OSGi in Worker module
Motivation and Context
Screenshots (if appropriate):
Types of changes
Checklist:
I hereby agree to the terms of the AET Contributor License Agreement.