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

#655 FIX #682

Merged
merged 5 commits into from
Aug 5, 2017
Merged

#655 FIX #682

merged 5 commits into from
Aug 5, 2017

Conversation

TikhomirovSergey
Copy link
Contributor

@TikhomirovSergey TikhomirovSergey commented Jul 31, 2017

Change list

#655 FIX

Types of changes

  • No changes in production code.
  • Bugfix (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)

Details

io.appium.java_client.remote.AppiumCommandExecutor was rolled back.

It is breaking change because it is compatible with appium server > v1.6.5

@TikhomirovSergey
Copy link
Contributor Author

#594 #597

public AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands,
URL addressOfRemoteServer, HttpClient.Factory httpClientFactory) {
super(additionalCommands, addressOfRemoteServer, httpClientFactory);
service = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be a reason of unexpected NPE?

Copy link
Contributor Author

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.

then it might be useful to mark the property as Nullable

Copy link
Contributor

Choose a reason for hiding this comment

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

or make it optional (I'd prefer this option)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mykola-mokhnach ok. I will improve it soon.

@mykola-mokhnach
Copy link
Contributor

How about having some unit test to verify resulting capabilities structure?

@TikhomirovSergey
Copy link
Contributor Author

@mykola-mokhnach

How about having some unit test to verify resulting capabilities structure?

I think we don't need for these tests:

  1. as you can see public class AppiumCommandExecutor extends HttpCommandExecutor and
 @Override public Response execute(Command command) throws IOException, WebDriverException {
        ...
      return super.execute(command);
       ...
   }
  1. The capability forming is fully inherited from Selenium
    HttpCommandExecutor ProtocolHandshake

Our tests which run some AppiumDriver are successful.

Copy link
Member

@SrinivasanTarget SrinivasanTarget left a comment

Choose a reason for hiding this comment

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

LGTM

@appium appium deleted a comment Aug 4, 2017
response.setSessionId(command.getSessionId().toString());
@Override public Response execute(Command command) throws WebDriverException {
if (DriverCommand.NEW_SESSION.equals(command.getName())) {
ofNullable(service).ifPresent(driverService -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume the code will be simpler if we make the service variable itself of type Optional

}

return new WebDriverException("The appium server has accidentally died!", rootCause);
}).orElse(new WebDriverException(rootCause.getMessage(), rootCause));
Copy link
Contributor

Choose a reason for hiding this comment

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

probably, orElseGet ?

@TikhomirovSergey
Copy link
Contributor Author

@mykola-mokhnach There is another one improvement.

@mykola-mokhnach
Copy link
Contributor

@TikhomirovSergey 👍

@appium appium deleted a comment Aug 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants