HADOOP-13813. TestDelegationTokenFetcher#testDelegationTokenWithoutRenewer is failing. Contributed by Mingliang Liu

This commit is contained in:
Mingliang Liu 2016-11-11 21:56:47 -08:00
parent 2ee18fc15e
commit 96f43921ba
1 changed files with 4 additions and 3 deletions

View File

@ -135,7 +135,8 @@ public class TestDelegationTokenFetcher {
Credentials creds = Credentials.readTokenStorageFile(p, conf); Credentials creds = Credentials.readTokenStorageFile(p, conf);
Iterator<Token<?>> itr = creds.getAllTokens().iterator(); Iterator<Token<?>> itr = creds.getAllTokens().iterator();
assertTrue("token not exist error", itr.hasNext()); assertTrue("token not exist error", itr.hasNext());
assertNotNull("Token should be there without renewer", itr.next()); final Token token = itr.next();
assertNotNull("Token should be there without renewer", token);
// Test compatibility of DelegationTokenFetcher.printTokensToString // Test compatibility of DelegationTokenFetcher.printTokensToString
String expectedNonVerbose = "Token (HDFS_DELEGATION_TOKEN token 1 for " + String expectedNonVerbose = "Token (HDFS_DELEGATION_TOKEN token 1 for " +
@ -154,8 +155,8 @@ public class TestDelegationTokenFetcher {
DelegationTokenFetcher.renewTokens(conf, p); DelegationTokenFetcher.renewTokens(conf, p);
fail("Should have failed to renew"); fail("Should have failed to renew");
} catch (AccessControlException e) { } catch (AccessControlException e) {
GenericTestUtils.assertExceptionContains( GenericTestUtils.assertExceptionContains("tried to renew a token ("
"tried to renew a token without a renewer", e); + token.decodeIdentifier() + ") without a renewer", e);
} }
} finally { } finally {
cluster.shutdown(); cluster.shutdown();