Skip to content

Commit

Permalink
test: fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
kofemann committed Jan 3, 2023
1 parent 7d6e0fb commit cd19d6f
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.dcache.oncrpc4j.rpcgen;

import java.net.InetSocketAddress;
import org.dcache.oncrpc4j.rpc.net.IpProtocolType;
import org.dcache.oncrpc4j.rpc.OncRpcProgram;
import org.dcache.oncrpc4j.rpc.OncRpcSvc;
Expand All @@ -15,7 +14,7 @@ public abstract class AbstractCalculatorTest {
protected OncRpcSvc server;
protected CalculatorClient client;
protected String address = "127.0.0.1";
protected int port = 0;
volatile protected int port = 0;

@Before
public void setup() throws Exception{
Expand All @@ -29,11 +28,11 @@ public void setup() throws Exception{
server.register(new OncRpcProgram(Calculator.CALCULATOR, Calculator.CALCULATORVERS), serverImpl);
server.start();

InetSocketAddress sockAddr = server.getInetSocketAddress(IpProtocolType.TCP);
port = server.getInetSocketAddress(IpProtocolType.TCP).getPort();

client = new CalculatorClient(
InetAddress.getByName(address),
sockAddr.getPort(),
port,
Calculator.CALCULATOR,
Calculator.CALCULATORVERS,
IpProtocolType.TCP);
Expand Down

0 comments on commit cd19d6f

Please sign in to comment.