Add wrappers for Android logcat broadcaster#858
Add wrappers for Android logcat broadcaster#858SrinivasanTarget merged 9 commits intoappium:masterappium/java-client:masterfrom
Conversation
|
@KazuCocoa FYI |
| /** | ||
| * @return The list of web socket message handlers. | ||
| */ | ||
| List<T> messageHandlers(); |
There was a problem hiding this comment.
messageHandlers() -> getMessageHandlers()
| /** | ||
| * This is the basic interface for all web socket message handlers. | ||
| */ | ||
| public interface MessagesHandler { |
There was a problem hiding this comment.
It's strange that messages handler can not handle messages.
There was a problem hiding this comment.
yep, I'll make it generic
| * @param reason connection close reason | ||
| */ | ||
| @OnClose | ||
| public void onClose(Session session, CloseReason reason) { |
There was a problem hiding this comment.
it is used in connect
There was a problem hiding this comment.
@OnClose
public void onClose(CloseReason reason) {
|
I was also thinking about having separate callbacks for each event instead of interface implementation, which is more Java 8'ish. for example: Instead of driver.addLogcatListener(new MessagesHandler<String>() {
@Override
public void onMessage(String message) {
messageSemaphore.release();
}
@Override
public void onConnected() {
connectedSemaphore.release();
}
@Override
public void onDisconnected() {
// ignore
}
@Override
public void onError(Throwable cause) {
// ignore
}
});it might look like driver.addLogcatMessageListener(this::onMessage);
driver.addLogcatErrorListener(this::onError); |
|
Make sure the hotfix appium/appium#10496 is merged to appium server before testing this PR locally |
|
@mykola-mokhnach Unfortunately there is a conflict. Can you please resolve this? I will get this in. |
… into ws # Conflicts: # src/main/java/io/appium/java_client/android/AndroidDriver.java
|
@SrinivasanTarget The conflict is resolved |
Change list
Added basic classes to support web sockets interaction in general and to interact with logcat messages broadcaster that has been implemented for Android server.
Types of changes