/// <exception cref="System.Exception"/> public long Run() { IPEndPoint serviceAddr = SecurityUtil.GetTokenServiceAddr(token); return(DelegationTokenFetcher.RenewDelegationToken(this._enclosing.connectionFactory , DFSUtil.CreateUri(this._enclosing.GetUnderlyingProtocol(), serviceAddr), (Org.Apache.Hadoop.Security.Token.Token <DelegationTokenIdentifier>)token)); }
public virtual void TestRenewTokenFromHttp() { bootstrap = StartHttpServer(httpPort, testToken, serviceUrl); NUnit.Framework.Assert.IsTrue("testRenewTokenFromHttp error", long.Parse(ExpDate) == DelegationTokenFetcher.RenewDelegationToken(connectionFactory, serviceUrl, testToken )); if (assertionError != null) { throw assertionError; } }
public virtual void TestTokenRenewFail() { try { DelegationTokenFetcher.RenewDelegationToken(connectionFactory, serviceUrl, testToken ); NUnit.Framework.Assert.Fail("Token fetcher shouldn't be able to renew tokens in absense of NN" ); } catch (IOException) { } }
public virtual void ExpectedTokenRenewErrorHttpResponse() { bootstrap = StartHttpServer(httpPort, testToken, serviceUrl); try { DelegationTokenFetcher.RenewDelegationToken(connectionFactory, new URI(serviceUrl .ToString() + "/exception"), CreateToken(serviceUrl)); NUnit.Framework.Assert.Fail("Token fetcher shouldn't be able to renew tokens using an invalid" + " NN URL"); } catch (IOException) { } if (assertionError != null) { throw assertionError; } }