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

[java] Use netty as http server for unit testing #12211

Merged
merged 4 commits into from
Jun 19, 2023

Conversation

joerg1985
Copy link
Member

Description

Use a netty based http server for unit testing and removed the old com.sun.net.httpserver.HttpServer based JreServer.
This PR will also unify the proxy tests by using the netty based http server and dropping some not needed dependencies.

Motivation and Context

The old JreServer was based in java/src, not in java/test this added a requires jdk.httpserver; into the generated java-modules.class of the client jars. Additionally there are now less dependencies needed in self-tests.

Types of changes

  • Bug fix (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 change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@titusfortner
Copy link
Member

I think we're getting rid of the netty dependency in October when we drop Java 8.

Not sure the options, would we be able to do something with default jdk http client?

I guess either way this doesn't increase dependences.

@diemol
Copy link
Member

diemol commented Jun 16, 2023

This is something I wanted to do, because we use the Jre server only for tests.

@titusfortner this is about the Netty server, not the HTTP client.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you, @joerg1985!

@diemol diemol merged commit 110079f into SeleniumHQ:trunk Jun 19, 2023
@asolntsev
Copy link
Contributor

asolntsev commented Jun 20, 2023

@joerg1985 Sorry, but I don't understand the need for this PR.
JreServer was used only in tests, right?

this added a requires jdk.httpserver; into the generated java-modules.class of the client jars.

Since JreServer was used only in tests, then we should just move JreServer from src/main to src/test. Then client jars would know nothing about requires jdk.httpserver;.

Additionally there are now less dependencies needed in self-tests.

I don't understand. Before this PR, we used only Java for tests. Now we additionally use Netty server for tests. I see more dependencies, not less.

@diemol
Copy link
Member

diemol commented Jun 20, 2023

Not following...

The JreServer was being used to run tests with Selenium RC, now that we deleted Selenium RC, the Jre Server was a left over. We usually have used the same server for testing, so this was some sort of tech debt. With this PR we are using Netty for everything, which makes things a little more simple.

Why do you say that there are more dependencies, @asolntsev?

@asolntsev
Copy link
Contributor

》 Why do you say that there are more dependencies, @asolntsev?

Because "Java" is one dependency, and "Java+Netty server" is two dependencies.

P.S. I know that Netty is used in Selenium project anyway, but it's netty client, not server. So I consider "Netty server" as an additional dependency.

@krmahadevan
Copy link
Contributor

@asolntsev - i think we use netty server for powering the server component of Grid no ?

@asolntsev
Copy link
Contributor

Probably.
But nevertheless, "jre" is less than "jre+netty".

@joerg1985
Copy link
Member Author

@asolntsev from my point of view it was more like jre+netty+jdk.httpserver before and now it is jre+netty. As mentioned above, netty is already used by the grid server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants