use of org.apache.hadoop.oncrpc.security.Verifier in project hadoop by apache.
the class TestRpcCall method testConstructor.
@Test
public void testConstructor() {
Credentials credential = new CredentialsNone();
Verifier verifier = new VerifierNone();
int rpcVersion = RpcCall.RPC_VERSION;
int program = 2;
int version = 3;
int procedure = 4;
RpcCall call = new RpcCall(0, RpcMessage.Type.RPC_CALL, rpcVersion, program, version, procedure, credential, verifier);
assertEquals(0, call.getXid());
assertEquals(RpcMessage.Type.RPC_CALL, call.getMessageType());
assertEquals(rpcVersion, call.getRpcVersion());
assertEquals(program, call.getProgram());
assertEquals(version, call.getVersion());
assertEquals(procedure, call.getProcedure());
assertEquals(credential, call.getCredential());
assertEquals(verifier, call.getVerifier());
}
use of org.apache.hadoop.oncrpc.security.Verifier in project hadoop by apache.
the class TestRpcAcceptedReply method testConstructor.
@Test
public void testConstructor() {
Verifier verifier = new VerifierNone();
RpcAcceptedReply reply = new RpcAcceptedReply(0, ReplyState.MSG_ACCEPTED, verifier, AcceptState.SUCCESS);
assertEquals(0, reply.getXid());
assertEquals(RpcMessage.Type.RPC_REPLY, reply.getMessageType());
assertEquals(ReplyState.MSG_ACCEPTED, reply.getState());
assertEquals(verifier, reply.getVerifier());
assertEquals(AcceptState.SUCCESS, reply.getAcceptState());
}
use of org.apache.hadoop.oncrpc.security.Verifier in project hadoop by apache.
the class RpcAcceptedReply method read.
public static RpcAcceptedReply read(int xid, ReplyState replyState, XDR xdr) {
Verifier verifier = Verifier.readFlavorAndVerifier(xdr);
AcceptState acceptState = AcceptState.fromValue(xdr.readInt());
return new RpcAcceptedReply(xid, replyState, verifier, acceptState);
}
use of org.apache.hadoop.oncrpc.security.Verifier in project hadoop by apache.
the class RpcDeniedReply method read.
public static RpcDeniedReply read(int xid, ReplyState replyState, XDR xdr) {
Verifier verifier = Verifier.readFlavorAndVerifier(xdr);
RejectState rejectState = RejectState.fromValue(xdr.readInt());
return new RpcDeniedReply(xid, replyState, rejectState, verifier);
}
Aggregations