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

Task/new osgi annotations #312

Merged
merged 20 commits into from
Aug 10, 2018
Merged

Task/new osgi annotations #312

merged 20 commits into from
Aug 10, 2018

Conversation

EwaFengler
Copy link
Contributor

Description

Migrate Felix annotations to OSGi in Worker module

Motivation and Context

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

I hereby agree to the terms of the AET Contributor License Agreement.

Copy link
Contributor

@malaskowski malaskowski left a 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.*;
Copy link
Contributor

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.

<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.metatype.annotations</artifactId>
</dependency>
Copy link
Contributor

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;
Copy link
Contributor

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";
Copy link
Contributor

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>
Copy link
Contributor

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,
Copy link
Contributor

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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.

<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.metatype.annotations</artifactId>
</dependency>
Copy link
Contributor

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>

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.

@tkaik tkaik merged commit 44d2bb9 into wttech:feature/upgrade-osgi-annotations Aug 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants