Skip to content

Commit 23a712d

Browse files
committed
test: introduce constant for op NULL
Acked-by: Paul Millar Target: master
1 parent f07892e commit 23a712d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

oncrpc4j-core/src/test/java/org/dcache/oncrpc4j/rpc/ClientServerTLSTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class ClientServerTLSTest {
4646
private static final int PROGNUM = 100017;
4747
private static final int PROGVER = 1;
4848

49+
private static final int NULL = 0;
4950
private static final int ECHO = 1;
5051
private static final int UPPER = 2;
5152

@@ -71,7 +72,7 @@ public class ClientServerTLSTest {
7172
call.reply(s);
7273
break;
7374
}
74-
case 0: {
75+
case NULL: {
7576
call.reply(XdrVoid.XDR_VOID);
7677
}
7778
}
@@ -272,7 +273,7 @@ public void shouldFailWhenNoTLSOnClient() throws IOException {
272273
RpcTransport t = clnt.connect(svc.getInetSocketAddress(IpProtocolType.TCP));
273274
clntCall = new RpcCall(PROGNUM, PROGVER, new RpcAuthTypeNone(), t);
274275
// poke server to start tls
275-
clntCall.call(0, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID, new RpcAuthTypeTls());
276+
clntCall.call(NULL, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID, new RpcAuthTypeTls());
276277
clntCall.getTransport().startTLS();
277278
}
278279

@@ -309,7 +310,7 @@ public void shouldFailSecondStartTLS() throws IOException {
309310
RpcTransport t = clnt.connect(svc.getInetSocketAddress(IpProtocolType.TCP));
310311
clntCall = new RpcCall(PROGNUM, PROGVER, new RpcAuthTypeNone(), t);
311312
// poke server to start tls
312-
clntCall.call(0, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID, new RpcAuthTypeTls());
313+
clntCall.call(NULL, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID, new RpcAuthTypeTls());
313314
clntCall.getTransport().startTLS();
314315
clntCall.getTransport().startTLS();
315316
}
@@ -345,7 +346,7 @@ public void shouldRejectStartTlsWhenNotConfigured() throws IOException {
345346
RpcTransport t = clnt.connect(svc.getInetSocketAddress(IpProtocolType.TCP));
346347
// poke server to start tls
347348
clntCall = new RpcCall(PROGNUM, PROGVER, new RpcAuthTypeNone(), t);
348-
clntCall.call(0, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID, new RpcAuthTypeTls());
349+
clntCall.call(NULL, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID, new RpcAuthTypeTls());
349350
}
350351

351352

@@ -385,9 +386,7 @@ public void shouldRejectTlsWhenClientCertRequired() throws IOException, Exceptio
385386
RpcTransport t = clnt.connect(svc.getInetSocketAddress(IpProtocolType.TCP));
386387
clntCall = new RpcCall(PROGNUM, PROGVER, new RpcAuthTypeNone(), t);
387388

388-
XdrString s = new XdrString("hello");
389-
XdrString reply = new XdrString();
390-
clntCall.call(ECHO, s, reply);
389+
clntCall.call(NULL, XdrVoid.XDR_VOID, new XdrVoid());
391390
}
392391

393392
public static SSLContext createClientSslContext(Certificate certificate) throws Exception {

0 commit comments

Comments
 (0)