Skip to content

Commit

Permalink
Move remote dialects into their own packages
Browse files Browse the repository at this point in the history
This sets the stage for us pulling the OSS dialect out
into a legacy package without us breaking the java
module system's rules on split packages.
  • Loading branch information
shs96c committed Apr 2, 2019
1 parent 0b1a4b5 commit b0b69e6
Show file tree
Hide file tree
Showing 24 changed files with 137 additions and 178 deletions.
2 changes: 1 addition & 1 deletion .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@
ie-test = //java/client/test/org/openqa/selenium/ie:ie
opera-test = //java/client/test/org/openqa/selenium/opera:opera
safari-test = //java/client/test/org/openqa/selenium/safari:safari
java-small-tests = //java/client/test/org/openqa/selenium:small-tests //java/client/test/org/openqa/selenium/json:small-tests //java/client/test/org/openqa/selenium/support:small-tests //java/client/test/org/openqa/selenium/remote:common-tests //java/client/test/org/openqa/selenium/remote:client-tests //java/server/test/org/openqa/grid/selenium/node:node //java/server/test/org/openqa/grid/selenium/proxy:proxy //java/server/test/org/openqa/selenium/remote/server:small-tests //java/server/test/org/openqa/selenium/remote/server/log:test //java/server/test/org/openqa/selenium/injector:small-tests
java-small-tests = //java/client/test/org/openqa/selenium:small-tests //java/client/test/org/openqa/selenium/json:small-tests //java/client/test/org/openqa/selenium/support:small-tests //java/client/test/org/openqa/selenium/remote:small-tests //java/server/test/org/openqa/grid/selenium/node:node //java/server/test/org/openqa/grid/selenium/proxy:proxy //java/server/test/org/openqa/selenium/remote/server:small-tests //java/server/test/org/openqa/selenium/remote/server/log:test //java/server/test/org/openqa/selenium/injector:small-tests
15 changes: 4 additions & 11 deletions java/client/src/org/openqa/selenium/remote/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,14 @@ java_library(
"html5/RemoteLocationContext.java",
"html5/RemoteSessionStorage.java",
"html5/RemoteWebStorage.java",
"http/HttpClient.java",
"http/HttpMessage.java",
"http/HttpMethod.java",
"http/HttpRequest.java",
"http/HttpResponse.java",
"http/AbstractHttpCommandCodec.java",
"http/AbstractHttpResponseCodec.java",
"http/JsonHttpCommandCodec.java",
"http/JsonHttpResponseCodec.java",
"http/W3CHttpCommandCodec.java",
"http/W3CHttpResponseCodec.java",
"internal/OkHttpClient.java",
"internal/JsonToWebElementConverter.java",
"internal/WebElementToJsonConverter.java",
"mobile/RemoteNetworkConnection.java",
] + glob([
"codec/*.java",
"codec/jwp/*.java",
"codec/w3c/*.java",
"service/*.java",
]),
resources = [
Expand All @@ -133,6 +125,7 @@ java_library(
exported_deps = [
":api",
":capabilities",
"//java/client/src/org/openqa/selenium/remote/http:http",
"//java/client/src/org/openqa/selenium/json:json",
"//java/client/src/org/openqa/selenium/remote/session:session",
"//third_party/java/okhttp3:okhttp",
Expand Down
8 changes: 4 additions & 4 deletions java/client/src/org/openqa/selenium/remote/Dialect.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

import org.openqa.selenium.remote.http.HttpRequest;
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.remote.http.JsonHttpCommandCodec;
import org.openqa.selenium.remote.http.JsonHttpResponseCodec;
import org.openqa.selenium.remote.http.W3CHttpCommandCodec;
import org.openqa.selenium.remote.http.W3CHttpResponseCodec;
import org.openqa.selenium.remote.codec.jwp.JsonHttpCommandCodec;
import org.openqa.selenium.remote.codec.jwp.JsonHttpResponseCodec;
import org.openqa.selenium.remote.codec.w3c.W3CHttpCommandCodec;
import org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec;

public enum Dialect {
OSS {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import org.openqa.selenium.remote.http.HttpClient;
import org.openqa.selenium.remote.http.HttpRequest;
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.remote.http.W3CHttpCommandCodec;
import org.openqa.selenium.remote.http.W3CHttpResponseCodec;
import org.openqa.selenium.remote.codec.w3c.W3CHttpCommandCodec;
import org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec;
import org.openqa.selenium.remote.service.DriverService;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.remote.http;
package org.openqa.selenium.remote.codec;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
Expand Down Expand Up @@ -105,6 +105,8 @@
import org.openqa.selenium.remote.Command;
import org.openqa.selenium.remote.CommandCodec;
import org.openqa.selenium.remote.SessionId;
import org.openqa.selenium.remote.http.HttpMethod;
import org.openqa.selenium.remote.http.HttpRequest;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.remote.http;
package org.openqa.selenium.remote.codec;

import static com.google.common.base.Strings.nullToEmpty;
import static com.google.common.net.HttpHeaders.CACHE_CONTROL;
Expand All @@ -32,6 +32,7 @@
import org.openqa.selenium.remote.ErrorCodes;
import org.openqa.selenium.remote.Response;
import org.openqa.selenium.remote.ResponseCodec;
import org.openqa.selenium.remote.http.HttpResponse;

import java.util.Optional;
import java.util.function.Supplier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.remote.http;
package org.openqa.selenium.remote.codec.jwp;

import static org.openqa.selenium.remote.DriverCommand.ACCEPT_ALERT;
import static org.openqa.selenium.remote.DriverCommand.CLEAR_LOCAL_STORAGE;
Expand Down Expand Up @@ -67,6 +67,7 @@

import org.openqa.selenium.InvalidArgumentException;
import org.openqa.selenium.remote.DriverCommand;
import org.openqa.selenium.remote.codec.AbstractHttpCommandCodec;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.remote.http;
package org.openqa.selenium.remote.codec.jwp;

import org.openqa.selenium.remote.ErrorHandler;
import org.openqa.selenium.remote.Response;
import org.openqa.selenium.remote.codec.AbstractHttpResponseCodec;
import org.openqa.selenium.remote.internal.JsonToWebElementConverter;

import java.util.function.Function;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.remote.http;
package org.openqa.selenium.remote.codec.w3c;

import static org.openqa.selenium.remote.DriverCommand.ACCEPT_ALERT;
import static org.openqa.selenium.remote.DriverCommand.ACTIONS;
Expand Down Expand Up @@ -76,6 +76,7 @@
import org.openqa.selenium.interactions.PointerInput;
import org.openqa.selenium.interactions.Sequence;
import org.openqa.selenium.remote.RemoteWebElement;
import org.openqa.selenium.remote.codec.AbstractHttpCommandCodec;
import org.openqa.selenium.remote.internal.WebElementToJsonConverter;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.remote.http;
package org.openqa.selenium.remote.codec.w3c;

import static com.google.common.base.Strings.nullToEmpty;
import static com.google.common.net.HttpHeaders.CONTENT_TYPE;
Expand All @@ -32,6 +32,8 @@
import org.openqa.selenium.json.Json;
import org.openqa.selenium.remote.ErrorCodes;
import org.openqa.selenium.remote.Response;
import org.openqa.selenium.remote.codec.AbstractHttpResponseCodec;
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.remote.internal.JsonToWebElementConverter;

import java.lang.reflect.Constructor;
Expand Down
11 changes: 11 additions & 0 deletions java/client/src/org/openqa/selenium/remote/http/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
java_library(
name = "http",
srcs = glob(["*.java"]),
deps = [
"//java/client/src/org/openqa/selenium:selenium",
"//third_party/java/guava:guava",
],
visibility = [
"//java/client/src/org/openqa/selenium/remote/...",
],
)
31 changes: 7 additions & 24 deletions java/client/test/org/openqa/selenium/remote/BUCK
Original file line number Diff line number Diff line change
@@ -1,34 +1,12 @@
java_test(
name = "common-tests",
srcs = [
"DesiredCapabilitiesTest.java",
"RemoteCommonTests.java",
"http/JsonHttpCommandCodecTest.java",
"http/JsonHttpResponseCodecTest.java",
"http/W3CHttpResponseCodecTest.java",
],
labels = [
"small",
],
deps = [
"//java/client/src/org/openqa/selenium:selenium",
"//java/client/src/org/openqa/selenium/remote:remote",
"//third_party/java/guava:guava",
"//third_party/java/assertj:assertj",
"//third_party/java/junit:junit",
],
)

java_test(
name = "client-tests",
name = "small-tests",
srcs = [
"AugmenterTest.java",
"BaseAugmenterTest.java",
"DesiredCapabilitiesTest.java",
"ErrorHandlerTest.java",
"JdkAugmenterTest.java",
"JsonWireProtocolResponseTest.java",
"ProtocolHandshakeTest.java",
"RemoteClientTests.java",
"RemoteLogsTest.java",
"RemoteWebDriverInitializationTest.java",
"RemoteWebDriverUnitTest.java",
Expand All @@ -45,6 +23,11 @@ java_test(
"//third_party/java/servlet:javax.servlet-api",
],
deps = [
"//java/client/src/org/openqa/selenium:selenium",
"//java/client/src/org/openqa/selenium/remote:remote",
"//third_party/java/guava:guava",
"//third_party/java/assertj:assertj",
"//third_party/java/junit:junit",
"//java/client/src/org/openqa/selenium:selenium",
"//java/client/src/org/openqa/selenium/chrome:chrome",
"//java/client/src/org/openqa/selenium/firefox:firefox",
Expand Down
35 changes: 0 additions & 35 deletions java/client/test/org/openqa/selenium/remote/RemoteClientTests.java

This file was deleted.

34 changes: 0 additions & 34 deletions java/client/test/org/openqa/selenium/remote/RemoteCommonTests.java

This file was deleted.

13 changes: 13 additions & 0 deletions java/client/test/org/openqa/selenium/remote/codec/jwp/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
java_test(
name = "jwp",
srcs = glob(["*.java"]),
labels = [
"small",
],
deps = [
"//java/client/src/org/openqa/selenium/remote:remote",
"//third_party/java/assertj:assertj",
"//third_party/java/guava:guava",
"//third_party/java/junit:junit",
],
)

0 comments on commit b0b69e6

Please sign in to comment.