/** * Test RenewDelegationTokenRequestPBImpl. * Test a transformation to prototype and back */ @Test public void testRenewDelegationTokenRequestPBImpl() { Token token = getDelegationToken(); RenewDelegationTokenRequestPBImpl original = new RenewDelegationTokenRequestPBImpl(); original.setDelegationToken(token); RenewDelegationTokenRequestProto protoType = original.getProto(); RenewDelegationTokenRequestPBImpl copy = new RenewDelegationTokenRequestPBImpl(protoType); assertNotNull(copy.getDelegationToken()); //compare source and converted assertEquals(token, copy.getDelegationToken()); }
@Override public RenewDelegationTokenResponse renewDelegationToken( RenewDelegationTokenRequest request) throws YarnException, IOException { RenewDelegationTokenRequestProto requestProto = ((RenewDelegationTokenRequestPBImpl) request).getProto(); try { return new RenewDelegationTokenResponsePBImpl(proxy.renewDelegationToken( null, requestProto)); } catch (ServiceException e) { RPCUtil.unwrapAndThrowException(e); return null; } }
@Test public void testRenewDelegationTokenRequestPBImpl() throws Exception { validatePBImplRecord(RenewDelegationTokenRequestPBImpl.class, RenewDelegationTokenRequestProto.class); }