Search in sources :

Example 1 with RenewDelegationTokenRequestPBImpl

use of org.apache.hadoop.yarn.api.protocolrecords.impl.pb.RenewDelegationTokenRequestPBImpl in project hadoop by apache.

the class TestYarnApiClasses method testRenewDelegationTokenRequestPBImpl.

/**
  * 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());
}
Also used : RenewDelegationTokenRequestPBImpl(org.apache.hadoop.yarn.api.protocolrecords.impl.pb.RenewDelegationTokenRequestPBImpl) RenewDelegationTokenRequestProto(org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProto) Token(org.apache.hadoop.yarn.api.records.Token) Test(org.junit.Test)

Aggregations

RenewDelegationTokenRequestProto (org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProto)1 RenewDelegationTokenRequestPBImpl (org.apache.hadoop.yarn.api.protocolrecords.impl.pb.RenewDelegationTokenRequestPBImpl)1 Token (org.apache.hadoop.yarn.api.records.Token)1 Test (org.junit.Test)1