3333import java .net .URI ;
3434
3535import org .apache .hadoop .conf .Configuration ;
36- import org .apache .hadoop .hdfs .security .token .delegation .DelegationTokenIdentifier ;
3736import org .apache .hadoop .hdfs .web .resources .DeleteOpParam ;
3837import org .apache .hadoop .hdfs .web .resources .GetOpParam ;
3938import org .apache .hadoop .hdfs .web .resources .HttpOpParam ;
@@ -64,11 +63,10 @@ private WebHdfsFileSystem spyWebhdfsInSecureSetup() throws IOException {
6463 return fs ;
6564 }
6665
67- @ SuppressWarnings ("unchecked" )
68- @ Test (timeout = 1000 )
66+ @ Test (timeout = 5000 )
6967 public void testTokenForNonTokenOp () throws IOException {
7068 WebHdfsFileSystem fs = spyWebhdfsInSecureSetup ();
71- Token <DelegationTokenIdentifier > token = mock (Token .class );
69+ Token <? > token = mock (Token .class );
7270 doReturn (token ).when (fs ).getDelegationToken (null );
7371
7472 // should get/set/renew token
@@ -85,22 +83,21 @@ public void testTokenForNonTokenOp() throws IOException {
8583 verify (fs , never ()).setDelegationToken (token );
8684 }
8785
88- @ Test (timeout = 1000 )
86+ @ Test (timeout = 5000 )
8987 public void testNoTokenForGetToken () throws IOException {
9088 checkNoTokenForOperation (GetOpParam .Op .GETDELEGATIONTOKEN );
9189 }
9290
93- @ Test (timeout = 1000 )
91+ @ Test (timeout = 5000 )
9492 public void testNoTokenForCanclToken () throws IOException {
9593 checkNoTokenForOperation (PutOpParam .Op .RENEWDELEGATIONTOKEN );
9694 }
9795
98- @ Test (timeout = 1000 )
96+ @ Test (timeout = 5000 )
9997 public void testNoTokenForCancelToken () throws IOException {
10098 checkNoTokenForOperation (PutOpParam .Op .CANCELDELEGATIONTOKEN );
10199 }
102100
103- @ SuppressWarnings ("unchecked" )
104101 private void checkNoTokenForOperation (HttpOpParam .Op op ) throws IOException {
105102 WebHdfsFileSystem fs = spyWebhdfsInSecureSetup ();
106103 doReturn (null ).when (fs ).getDelegationToken (null );
@@ -110,7 +107,7 @@ private void checkNoTokenForOperation(HttpOpParam.Op op) throws IOException {
110107 fs .toUrl (op , null );
111108 verify (fs , never ()).getDelegationToken ();
112109 verify (fs , never ()).getDelegationToken (null );
113- verify (fs , never ()).setDelegationToken (any (Token .class ));
110+ verify (fs , never ()).setDelegationToken (( Token <?>) any (Token .class ));
114111 }
115112
116113 @ Test (timeout = 1000 )
0 commit comments