Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions google-style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,16 @@
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="AvoidStarImport">
<property name="severity" value="warning"/>
</module>
<module name="AvoidStarImport"/>
<module name="CustomImportOrder">
<property name="customImportOrderRules" value="THIRD_PARTY_PACKAGE###SPECIAL_IMPORTS###STANDARD_JAVA_PACKAGE###STATIC"/>
<property name="specialImportsRegExp" value="^javax\."/>
<property name="standardPackageRegExp" value="^java\."/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="false"/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="EmptyBlock">
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/io/appium/java_client/AppiumDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@

package io.appium.java_client;

import static io.appium.java_client.internal.CapabilityHelpers.APPIUM_PREFIX;
import static io.appium.java_client.remote.MobileCapabilityType.AUTOMATION_NAME;
import static io.appium.java_client.remote.MobileCapabilityType.PLATFORM_NAME;
import static org.apache.commons.lang3.StringUtils.isBlank;

import io.appium.java_client.internal.CapabilityHelpers;
import io.appium.java_client.remote.AppiumCommandExecutor;
import io.appium.java_client.remote.AppiumNewSessionCommandPayload;
Expand Down Expand Up @@ -51,6 +46,11 @@
import java.util.Collections;
import java.util.Map;

import static io.appium.java_client.internal.CapabilityHelpers.APPIUM_PREFIX;
import static io.appium.java_client.remote.MobileCapabilityType.AUTOMATION_NAME;
import static io.appium.java_client.remote.MobileCapabilityType.PLATFORM_NAME;
import static org.apache.commons.lang3.StringUtils.isBlank;

/**
* Default Appium driver implementation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package io.appium.java_client;

import com.google.common.collect.ImmutableMap;

import org.openqa.selenium.remote.ExecuteMethod;
import org.openqa.selenium.remote.Response;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package io.appium.java_client;

import com.google.common.base.Throwables;

import lombok.AccessLevel;
import lombok.Getter;
import org.openqa.selenium.TimeoutException;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/appium/java_client/ComparesImages.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package io.appium.java_client;

import static io.appium.java_client.MobileCommand.compareImagesCommand;

import io.appium.java_client.imagecomparison.ComparisonMode;
import io.appium.java_client.imagecomparison.FeaturesMatchingOptions;
import io.appium.java_client.imagecomparison.FeaturesMatchingResult;
Expand All @@ -27,11 +25,13 @@
import io.appium.java_client.imagecomparison.SimilarityMatchingResult;
import org.apache.commons.io.FileUtils;

import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.util.Base64;
import java.util.Map;
import javax.annotation.Nullable;

import static io.appium.java_client.MobileCommand.compareImagesCommand;

public interface ComparesImages extends ExecutesMethod {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package io.appium.java_client;

import com.google.common.collect.ImmutableMap;

import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.remote.ErrorCodes;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/appium/java_client/HasAppStrings.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package io.appium.java_client;

import static io.appium.java_client.MobileCommand.GET_STRINGS;
import static io.appium.java_client.MobileCommand.prepareArguments;

import java.util.AbstractMap;
import java.util.Map;

import static io.appium.java_client.MobileCommand.GET_STRINGS;
import static io.appium.java_client.MobileCommand.prepareArguments;

public interface HasAppStrings extends ExecutesMethod {
/**
* Get all defined Strings from an app for the default language.
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/io/appium/java_client/HasDeviceTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@

package io.appium.java_client;

import static io.appium.java_client.MobileCommand.GET_DEVICE_TIME;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;

import org.openqa.selenium.remote.DriverCommand;
import org.openqa.selenium.remote.Response;

import java.util.Map;

import static io.appium.java_client.MobileCommand.GET_DEVICE_TIME;

public interface HasDeviceTime extends ExecutesMethod {

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/appium/java_client/HasSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@

package io.appium.java_client;

import static io.appium.java_client.MobileCommand.getSettingsCommand;
import static io.appium.java_client.MobileCommand.setSettingsCommand;

import org.openqa.selenium.remote.Response;

import java.util.EnumMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.stream.Collectors;

import static io.appium.java_client.MobileCommand.getSettingsCommand;
import static io.appium.java_client.MobileCommand.setSettingsCommand;

public interface HasSettings extends ExecutesMethod {

/**
Expand Down
21 changes: 10 additions & 11 deletions src/main/java/io/appium/java_client/InteractsWithApps.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,25 @@

package io.appium.java_client;

import static io.appium.java_client.MobileCommand.ACTIVATE_APP;
import static io.appium.java_client.MobileCommand.INSTALL_APP;
import static io.appium.java_client.MobileCommand.IS_APP_INSTALLED;
import static io.appium.java_client.MobileCommand.QUERY_APP_STATE;
import static io.appium.java_client.MobileCommand.REMOVE_APP;
import static io.appium.java_client.MobileCommand.RUN_APP_IN_BACKGROUND;
import static io.appium.java_client.MobileCommand.TERMINATE_APP;
import static io.appium.java_client.MobileCommand.prepareArguments;

import com.google.common.collect.ImmutableMap;

import io.appium.java_client.appmanagement.ApplicationState;
import io.appium.java_client.appmanagement.BaseActivateApplicationOptions;
import io.appium.java_client.appmanagement.BaseInstallApplicationOptions;
import io.appium.java_client.appmanagement.BaseRemoveApplicationOptions;
import io.appium.java_client.appmanagement.BaseTerminateApplicationOptions;

import javax.annotation.Nullable;
import java.time.Duration;
import java.util.AbstractMap;
import javax.annotation.Nullable;

import static io.appium.java_client.MobileCommand.ACTIVATE_APP;
import static io.appium.java_client.MobileCommand.INSTALL_APP;
import static io.appium.java_client.MobileCommand.IS_APP_INSTALLED;
import static io.appium.java_client.MobileCommand.QUERY_APP_STATE;
import static io.appium.java_client.MobileCommand.REMOVE_APP;
import static io.appium.java_client.MobileCommand.RUN_APP_IN_BACKGROUND;
import static io.appium.java_client.MobileCommand.TERMINATE_APP;
import static io.appium.java_client.MobileCommand.prepareArguments;

@SuppressWarnings("rawtypes")
public interface InteractsWithApps extends ExecutesMethod {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/appium/java_client/LocksDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package io.appium.java_client;

import java.time.Duration;

import static io.appium.java_client.MobileCommand.getIsDeviceLockedCommand;
import static io.appium.java_client.MobileCommand.lockDeviceCommand;
import static io.appium.java_client.MobileCommand.unlockDeviceCommand;

import java.time.Duration;

public interface LocksDevice extends ExecutesMethod {

/**
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/io/appium/java_client/LogsEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@

package io.appium.java_client;

import static io.appium.java_client.MobileCommand.GET_EVENTS;
import static io.appium.java_client.MobileCommand.LOG_EVENT;

import com.google.common.collect.ImmutableMap;
import io.appium.java_client.serverevents.CommandEvent;
import io.appium.java_client.serverevents.CustomEvent;
import io.appium.java_client.serverevents.TimedEvent;
import io.appium.java_client.serverevents.ServerEvents;
import io.appium.java_client.serverevents.TimedEvent;
import org.openqa.selenium.json.Json;
import org.openqa.selenium.remote.Response;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.openqa.selenium.json.Json;
import org.openqa.selenium.remote.Response;

import static io.appium.java_client.MobileCommand.GET_EVENTS;
import static io.appium.java_client.MobileCommand.LOG_EVENT;

public interface LogsEvents extends ExecutesMethod {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/appium/java_client/MobileBy.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package io.appium.java_client;

import java.io.Serializable;

import org.openqa.selenium.By;

import java.io.Serializable;

/**
* Appium locating strategies.
*
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/appium/java_client/MobileCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package io.appium.java_client;

import com.google.common.collect.ImmutableMap;

import io.appium.java_client.imagecomparison.BaseComparisonOptions;
import io.appium.java_client.imagecomparison.ComparisonMode;
import io.appium.java_client.screenrecording.BaseStartScreenRecordingOptions;
Expand All @@ -26,12 +25,12 @@
import org.openqa.selenium.remote.CommandInfo;
import org.openqa.selenium.remote.http.HttpMethod;

import javax.annotation.Nullable;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.AbstractMap;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;

/**
* The repository of mobile commands defined in the Mobile JSON
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/appium/java_client/MultiTouchAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

package io.appium.java_client;

import static com.google.common.base.Preconditions.checkArgument;
import static java.util.stream.Collectors.toList;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;

import java.util.List;
import java.util.Map;

import static com.google.common.base.Preconditions.checkArgument;
import static java.util.stream.Collectors.toList;

/**
* Used for Webdriver 3 multi-touch gestures
* See the Webriver 3 spec https://dvcs.w3.org/hg/webdriver/raw-file/default/webdriver-spec.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package io.appium.java_client;

import static io.appium.java_client.MobileCommand.PERFORM_MULTI_TOUCH;
import static io.appium.java_client.MobileCommand.PERFORM_TOUCH_ACTION;

import java.util.List;
import java.util.Map;

import static io.appium.java_client.MobileCommand.PERFORM_MULTI_TOUCH;
import static io.appium.java_client.MobileCommand.PERFORM_TOUCH_ACTION;

/**
* Touch actions are deprecated.
* Please use W3C Actions instead or the corresponding
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/io/appium/java_client/PullsFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@

package io.appium.java_client;

import static io.appium.java_client.MobileCommand.PULL_FILE;
import static io.appium.java_client.MobileCommand.PULL_FOLDER;

import com.google.common.collect.ImmutableMap;

import org.openqa.selenium.remote.Response;

import java.nio.charset.StandardCharsets;
import java.util.Base64;

import static io.appium.java_client.MobileCommand.PULL_FILE;
import static io.appium.java_client.MobileCommand.PULL_FOLDER;

public interface PullsFiles extends ExecutesMethod {

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/appium/java_client/PushesFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

package io.appium.java_client;

import static com.google.common.base.Preconditions.checkNotNull;
import static io.appium.java_client.MobileCommand.pushFileCommand;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.Base64;

import static com.google.common.base.Preconditions.checkNotNull;
import static io.appium.java_client.MobileCommand.pushFileCommand;

public interface PushesFiles extends ExecutesMethod {

/**
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/io/appium/java_client/ScreenshotState.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
import lombok.Setter;
import lombok.experimental.Accessors;

import static com.google.common.base.Preconditions.checkNotNull;
import static java.util.Optional.ofNullable;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
Expand All @@ -33,7 +31,8 @@
import java.util.function.Function;
import java.util.function.Supplier;

import javax.imageio.ImageIO;
import static com.google.common.base.Preconditions.checkNotNull;
import static java.util.Optional.ofNullable;

@Accessors(chain = true)
public class ScreenshotState {
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/io/appium/java_client/TouchAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@

package io.appium.java_client;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.ImmutableList.builder;
import static java.util.stream.Collectors.toList;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;

import io.appium.java_client.touch.ActionOptions;
import io.appium.java_client.touch.LongPressOptions;
import io.appium.java_client.touch.TapOptions;
Expand All @@ -33,6 +28,10 @@
import java.util.List;
import java.util.Map;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.ImmutableList.builder;
import static java.util.stream.Collectors.toList;

/**
* Used for Webdriver 3 touch actions
* See the Webriver 3 spec
Expand Down
Loading