Skip to content

Commit

Permalink
[Grid] Adding a test to check that remoteHost is properly read and set.
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Nov 7, 2018
1 parent 5b0a928 commit fea6316
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions java/server/test/org/openqa/grid/internal/BaseRemoteProxyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,24 @@ public void proxyConfigOverwritesRegistryConfig() {
assertEquals(50L, p.getConfig().maxSession.longValue());
}

@Test
public void remoteHostParameterIsTakenInProxyAndRegistry() {
GridRegistry registry = DefaultGridRegistry.newInstance(new Hub(new GridHubConfiguration()));

GridNodeConfiguration nodeConfiguration = parseCliOptions("-remoteHost", "http://machine1:5555");
RegistrationRequest req = RegistrationRequest.build(nodeConfiguration);
req.getConfiguration().proxy = null;

RemoteProxy p = BaseRemoteProxy.getNewInstance(req, registry);
registry.add(p);

// values which are present in both the registration request and the registry need to
// come from the registration request
assertEquals("http://machine1:5555", p.getConfig().getRemoteHost());
assertEquals("http://machine1:5555",
registry.getProxyById(p.getId()).getRemoteHost().toExternalForm());
}

@Test
public void proxyTakesRemoteAsIdIfIdNotSpecified() {
String remoteHost ="http://machine1:5555";
Expand Down

0 comments on commit fea6316

Please sign in to comment.