Skip to content

Commit 49ea7d8

Browse files
committed
[grid] Move jmx package into the grid
1 parent 462fd37 commit 49ea7d8

21 files changed

+51
-53
lines changed

java/server/src/org/openqa/selenium/remote/server/jmx/JMXHelper.java renamed to java/server/src/org/openqa/selenium/grid/jmx/JMXHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
package org.openqa.selenium.remote.server.jmx;
18+
package org.openqa.selenium.grid.jmx;
1919

2020
import java.lang.management.ManagementFactory;
2121

java/server/src/org/openqa/selenium/remote/server/jmx/MBean.java renamed to java/server/src/org/openqa/selenium/grid/jmx/MBean.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
package org.openqa.selenium.remote.server.jmx;
18+
package org.openqa.selenium.grid.jmx;
1919

2020
import java.lang.reflect.InvocationTargetException;
2121
import java.lang.reflect.Method;

java/server/src/org/openqa/selenium/remote/server/jmx/ManagedAttribute.java renamed to java/server/src/org/openqa/selenium/grid/jmx/ManagedAttribute.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
package org.openqa.selenium.remote.server.jmx;
18+
package org.openqa.selenium.grid.jmx;
1919

2020
import java.lang.annotation.ElementType;
2121
import java.lang.annotation.Retention;

java/server/src/org/openqa/selenium/remote/server/jmx/ManagedOperation.java renamed to java/server/src/org/openqa/selenium/grid/jmx/ManagedOperation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
package org.openqa.selenium.remote.server.jmx;
18+
package org.openqa.selenium.grid.jmx;
1919

2020
import java.lang.annotation.ElementType;
2121
import java.lang.annotation.Retention;

java/server/src/org/openqa/selenium/remote/server/jmx/ManagedService.java renamed to java/server/src/org/openqa/selenium/grid/jmx/ManagedService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
package org.openqa.selenium.remote.server.jmx;
18+
package org.openqa.selenium.grid.jmx;
1919

2020
import java.lang.annotation.ElementType;
2121
import java.lang.annotation.Retention;

java/server/src/org/openqa/selenium/grid/node/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ java_library(
1818
"//java/client/src/org/openqa/selenium/remote",
1919
"//java/server/src/org/openqa/selenium/grid/component",
2020
"//java/server/src/org/openqa/selenium/grid/data",
21+
"//java/server/src/org/openqa/selenium/grid/jmx",
2122
"//java/server/src/org/openqa/selenium/grid/node/locators",
2223
"//java/server/src/org/openqa/selenium/grid/security",
2324
"//java/server/src/org/openqa/selenium/grid/web",
24-
"//java/server/src/org/openqa/selenium/remote/server/jmx",
2525
"//java/server/src/org/openqa/selenium/status",
2626
artifact("com.google.guava:guava"),
2727
],

java/server/src/org/openqa/selenium/grid/node/local/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ java_library(
2020
"//java/server/src/org/openqa/selenium/grid/config",
2121
"//java/server/src/org/openqa/selenium/grid/data",
2222
"//java/server/src/org/openqa/selenium/grid/docker",
23+
"//java/server/src/org/openqa/selenium/grid/jmx",
2324
"//java/server/src/org/openqa/selenium/grid/log",
2425
"//java/server/src/org/openqa/selenium/grid/node",
2526
"//java/server/src/org/openqa/selenium/grid/node/config",
2627
"//java/server/src/org/openqa/selenium/grid/security",
2728
"//java/server/src/org/openqa/selenium/grid/server",
28-
"//java/server/src/org/openqa/selenium/remote/server/jmx",
2929
artifact("com.google.guava:guava"),
3030
],
3131
)

java/server/src/org/openqa/selenium/grid/node/local/LocalNode.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
import org.openqa.selenium.remote.SessionId;
5555
import org.openqa.selenium.remote.http.HttpRequest;
5656
import org.openqa.selenium.remote.http.HttpResponse;
57-
import org.openqa.selenium.remote.server.jmx.JMXHelper;
58-
import org.openqa.selenium.remote.server.jmx.ManagedAttribute;
59-
import org.openqa.selenium.remote.server.jmx.ManagedService;
57+
import org.openqa.selenium.grid.jmx.JMXHelper;
58+
import org.openqa.selenium.grid.jmx.ManagedAttribute;
59+
import org.openqa.selenium.grid.jmx.ManagedService;
6060
import org.openqa.selenium.remote.tracing.AttributeKey;
6161
import org.openqa.selenium.remote.tracing.EventAttribute;
6262
import org.openqa.selenium.remote.tracing.EventAttributeValue;

java/server/src/org/openqa/selenium/grid/server/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ java_library(
1919
"//java/server/src/org/openqa/selenium/events",
2020
"//java/server/src/org/openqa/selenium/grid/component",
2121
"//java/server/src/org/openqa/selenium/grid/config",
22+
"//java/server/src/org/openqa/selenium/grid/jmx",
2223
"//java/server/src/org/openqa/selenium/grid/web",
23-
"//java/server/src/org/openqa/selenium/remote/server/jmx",
2424
artifact("com.beust:jcommander"),
2525
artifact("com.google.guava:guava"),
2626
artifact("javax.servlet:javax.servlet-api"),

java/server/src/org/openqa/selenium/grid/server/BaseServerOptions.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
import org.openqa.selenium.WebDriverException;
2121
import org.openqa.selenium.grid.config.Config;
2222
import org.openqa.selenium.grid.config.ConfigException;
23+
import org.openqa.selenium.grid.jmx.JMXHelper;
24+
import org.openqa.selenium.grid.jmx.ManagedAttribute;
25+
import org.openqa.selenium.grid.jmx.ManagedService;
2326
import org.openqa.selenium.net.HostIdentifier;
2427
import org.openqa.selenium.net.NetworkUtils;
2528
import org.openqa.selenium.net.PortProber;
26-
import org.openqa.selenium.remote.server.jmx.JMXHelper;
27-
import org.openqa.selenium.remote.server.jmx.ManagedAttribute;
28-
import org.openqa.selenium.remote.server.jmx.ManagedService;
2929

3030
import java.io.File;
3131
import java.net.URI;

java/server/src/org/openqa/selenium/grid/session/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ java_library(
1414
deps = [
1515
"//java/client/src/org/openqa/selenium/remote",
1616
"//java/server/src/org/openqa/selenium/grid/data",
17+
"//java/server/src/org/openqa/selenium/grid/jmx",
1718
"//java/server/src/org/openqa/selenium/grid/web",
18-
"//java/server/src/org/openqa/selenium/remote/server/jmx",
1919
artifact("com.google.guava:guava"),
2020
],
2121
)

java/server/src/org/openqa/selenium/grid/session/remote/ServicedSession.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
package org.openqa.selenium.grid.session.remote;
1919

2020

21-
import static java.util.concurrent.TimeUnit.SECONDS;
22-
2321
import org.openqa.selenium.Capabilities;
2422
import org.openqa.selenium.InvalidArgumentException;
2523
import org.openqa.selenium.SessionNotCreatedException;
2624
import org.openqa.selenium.grid.data.CreateSessionRequest;
25+
import org.openqa.selenium.grid.jmx.JMXHelper;
26+
import org.openqa.selenium.grid.jmx.ManagedService;
2727
import org.openqa.selenium.grid.session.ActiveSession;
2828
import org.openqa.selenium.internal.Require;
2929
import org.openqa.selenium.net.PortProber;
@@ -32,11 +32,11 @@
3232
import org.openqa.selenium.remote.http.HttpHandler;
3333
import org.openqa.selenium.remote.http.HttpMethod;
3434
import org.openqa.selenium.remote.http.HttpRequest;
35-
import org.openqa.selenium.remote.server.jmx.JMXHelper;
36-
import org.openqa.selenium.remote.server.jmx.ManagedService;
3735
import org.openqa.selenium.remote.service.DriverService;
3836
import org.openqa.selenium.remote.tracing.Tracer;
3937

38+
import javax.management.MalformedObjectNameException;
39+
import javax.management.ObjectName;
4040
import java.io.IOException;
4141
import java.io.UncheckedIOException;
4242
import java.lang.reflect.Method;
@@ -48,8 +48,7 @@
4848
import java.util.logging.Level;
4949
import java.util.logging.Logger;
5050

51-
import javax.management.MalformedObjectNameException;
52-
import javax.management.ObjectName;
51+
import static java.util.concurrent.TimeUnit.SECONDS;
5352

5453
@ManagedService
5554
public class ServicedSession extends RemoteSession {

java/server/src/org/openqa/selenium/grid/sessionqueue/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ java_library(
1818
"//java/client/src/org/openqa/selenium/remote/http",
1919
"//java/server/src/org/openqa/selenium/events",
2020
"//java/server/src/org/openqa/selenium/grid/data",
21+
"//java/server/src/org/openqa/selenium/grid/jmx",
2122
"//java/server/src/org/openqa/selenium/grid/log",
2223
"//java/server/src/org/openqa/selenium/grid/security",
23-
"//java/server/src/org/openqa/selenium/remote/server/jmx",
2424
"//java/server/src/org/openqa/selenium/status",
2525
artifact("com.google.guava:guava"),
2626
],

java/server/src/org/openqa/selenium/grid/sessionqueue/config/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ java_library(
1111
deps = [
1212
"//java:auto-service",
1313
"//java/server/src/org/openqa/selenium/grid/config",
14+
"//java/server/src/org/openqa/selenium/grid/jmx",
1415
"//java/server/src/org/openqa/selenium/grid/sessionqueue",
15-
"//java/server/src/org/openqa/selenium/remote/server/jmx",
1616
artifact("com.beust:jcommander"),
1717
artifact("io.opentelemetry:opentelemetry-api"),
1818
],

java/server/src/org/openqa/selenium/grid/sessionqueue/config/NewSessionQueueOptions.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
package org.openqa.selenium.grid.sessionqueue.config;
1919

2020
import org.openqa.selenium.grid.config.Config;
21+
import org.openqa.selenium.grid.jmx.JMXHelper;
22+
import org.openqa.selenium.grid.jmx.ManagedAttribute;
23+
import org.openqa.selenium.grid.jmx.ManagedService;
2124
import org.openqa.selenium.grid.sessionqueue.NewSessionQueue;
22-
import org.openqa.selenium.remote.server.jmx.JMXHelper;
23-
import org.openqa.selenium.remote.server.jmx.ManagedAttribute;
24-
import org.openqa.selenium.remote.server.jmx.ManagedService;
2525

2626
import java.time.Duration;
2727

java/server/src/org/openqa/selenium/grid/sessionqueue/local/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ java_library(
1414
"//java/server/src/org/openqa/selenium/events",
1515
"//java/server/src/org/openqa/selenium/grid/config",
1616
"//java/server/src/org/openqa/selenium/grid/data",
17+
"//java/server/src/org/openqa/selenium/grid/jmx",
1718
"//java/server/src/org/openqa/selenium/grid/log",
1819
"//java/server/src/org/openqa/selenium/grid/security",
1920
"//java/server/src/org/openqa/selenium/grid/server",
2021
"//java/server/src/org/openqa/selenium/grid/sessionqueue",
2122
"//java/server/src/org/openqa/selenium/grid/sessionqueue/config",
22-
"//java/server/src/org/openqa/selenium/remote/server/jmx",
2323
artifact("com.google.guava:guava"),
2424
],
2525
)

java/server/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
import org.openqa.selenium.remote.NewSessionPayload;
3434
import org.openqa.selenium.remote.http.HttpRequest;
3535

36-
import org.openqa.selenium.remote.server.jmx.JMXHelper;
37-
import org.openqa.selenium.remote.server.jmx.ManagedAttribute;
38-
import org.openqa.selenium.remote.server.jmx.ManagedService;
36+
import org.openqa.selenium.grid.jmx.JMXHelper;
37+
import org.openqa.selenium.grid.jmx.ManagedAttribute;
38+
import org.openqa.selenium.grid.jmx.ManagedService;
3939

4040
import org.openqa.selenium.remote.tracing.AttributeKey;
4141
import org.openqa.selenium.remote.tracing.EventAttribute;

java/server/test/org/openqa/grid/selenium/proxy/DefaultRemoteProxyTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import org.junit.After;
2121
import org.junit.Test;
22-
import org.openqa.selenium.remote.server.jmx.JMXHelper;
22+
import org.openqa.selenium.grid.jmx.JMXHelper;
2323

2424
import java.util.concurrent.TimeoutException;
2525

java/server/test/org/openqa/selenium/grid/router/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ java_test_suite(
6060
"//java/server/src/org/openqa/selenium/grid/distributor/httpd",
6161
"//java/server/src/org/openqa/selenium/grid/distributor/local",
6262
"//java/server/src/org/openqa/selenium/grid/distributor/remote",
63+
"//java/server/src/org/openqa/selenium/grid/jmx",
6364
"//java/server/src/org/openqa/selenium/grid/node",
6465
"//java/server/src/org/openqa/selenium/grid/node/httpd",
6566
"//java/server/src/org/openqa/selenium/grid/node/local",
@@ -78,7 +79,6 @@ java_test_suite(
7879
"//java/server/src/org/openqa/selenium/grid/sessionqueue/remote",
7980
"//java/server/src/org/openqa/selenium/grid/web",
8081
"//java/server/src/org/openqa/selenium/netty/server",
81-
"//java/server/src/org/openqa/selenium/remote/server/jmx",
8282
"//java/server/test/org/openqa/selenium/grid/testing",
8383
artifact("com.google.guava:guava"),
8484
artifact("io.opentelemetry:opentelemetry-api"),

java/server/test/org/openqa/selenium/grid/router/JmxTest.java

+20-21
Original file line numberDiff line numberDiff line change
@@ -17,45 +17,44 @@
1717

1818
package org.openqa.selenium.grid.router;
1919

20-
import static org.assertj.core.api.Assertions.assertThat;
21-
import static org.junit.Assert.fail;
22-
2320
import com.google.common.collect.ImmutableMap;
24-
25-
import java.lang.management.ManagementFactory;
26-
import java.net.URI;
27-
import java.net.URISyntaxException;
28-
import java.time.Duration;
29-
import java.time.Instant;
30-
import javax.management.AttributeNotFoundException;
31-
import javax.management.InstanceNotFoundException;
32-
import javax.management.IntrospectionException;
33-
import javax.management.MBeanAttributeInfo;
34-
import javax.management.MBeanException;
35-
import javax.management.MBeanInfo;
36-
import javax.management.MBeanServer;
37-
import javax.management.MalformedObjectNameException;
38-
import javax.management.ObjectName;
39-
import javax.management.ReflectionException;
40-
4121
import org.junit.Test;
4222
import org.openqa.selenium.Capabilities;
4323
import org.openqa.selenium.ImmutableCapabilities;
4424
import org.openqa.selenium.events.EventBus;
4525
import org.openqa.selenium.events.local.GuavaEventBus;
4626
import org.openqa.selenium.grid.config.MapConfig;
4727
import org.openqa.selenium.grid.data.Session;
28+
import org.openqa.selenium.grid.jmx.JMXHelper;
4829
import org.openqa.selenium.grid.node.local.LocalNode;
4930
import org.openqa.selenium.grid.security.Secret;
5031
import org.openqa.selenium.grid.server.BaseServerOptions;
5132
import org.openqa.selenium.grid.sessionqueue.config.NewSessionQueueOptions;
5233
import org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue;
5334
import org.openqa.selenium.grid.testing.TestSessionFactory;
5435
import org.openqa.selenium.net.PortProber;
55-
import org.openqa.selenium.remote.server.jmx.JMXHelper;
5636
import org.openqa.selenium.remote.tracing.DefaultTestTracer;
5737
import org.openqa.selenium.remote.tracing.Tracer;
5838

39+
import javax.management.AttributeNotFoundException;
40+
import javax.management.InstanceNotFoundException;
41+
import javax.management.IntrospectionException;
42+
import javax.management.MBeanAttributeInfo;
43+
import javax.management.MBeanException;
44+
import javax.management.MBeanInfo;
45+
import javax.management.MBeanServer;
46+
import javax.management.MalformedObjectNameException;
47+
import javax.management.ObjectName;
48+
import javax.management.ReflectionException;
49+
import java.lang.management.ManagementFactory;
50+
import java.net.URI;
51+
import java.net.URISyntaxException;
52+
import java.time.Duration;
53+
import java.time.Instant;
54+
55+
import static org.assertj.core.api.Assertions.assertThat;
56+
import static org.junit.Assert.fail;
57+
5958
public class JmxTest {
6059

6160
private final Capabilities CAPS = new ImmutableCapabilities("browserName", "cheese");

0 commit comments

Comments
 (0)