Explorar el Código

YARN-9093. Remove commented code block from the beginning of Tes… (#444)

Vidura Mudalige hace 6 años
padre
commit
1930a7bf60

+ 0 - 39
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestDefaultContainerExecutor.java

@@ -83,45 +83,6 @@ import org.mockito.stubbing.Answer;
 
 public class TestDefaultContainerExecutor {
 
-  /*
-  // XXX FileContext cannot be mocked to do this
-  static FSDataInputStream getRandomStream(Random r, int len)
-      throws IOException {
-    byte[] bytes = new byte[len];
-    r.nextBytes(bytes);
-    DataInputBuffer buf = new DataInputBuffer();
-    buf.reset(bytes, 0, bytes.length);
-    return new FSDataInputStream(new FakeFSDataInputStream(buf));
-  }
-
-  class PathEndsWith extends ArgumentMatcher<Path> {
-    final String suffix;
-    PathEndsWith(String suffix) {
-      this.suffix = suffix;
-    }
-    @Override
-    public boolean matches(Object o) {
-      return
-      suffix.equals(((Path)o).getName());
-    }
-  }
-
-  DataOutputBuffer mockStream(
-      AbstractFileSystem spylfs, Path p, Random r, int len) 
-      throws IOException {
-    DataOutputBuffer dob = new DataOutputBuffer();
-    doReturn(getRandomStream(r, len)).when(spylfs).open(p);
-    doReturn(new FileStatus(len, false, -1, -1L, -1L, p)).when(
-        spylfs).getFileStatus(argThat(new PathEndsWith(p.getName())));
-    doReturn(new FSDataOutputStream(dob)).when(spylfs).createInternal(
-        argThat(new PathEndsWith(p.getName())),
-        eq(EnumSet.of(OVERWRITE)),
-        Matchers.<FsPermission>anyObject(), anyInt(), anyShort(), anyLong(),
-        Matchers.<Progressable>anyObject(), anyInt(), anyBoolean());
-    return dob;
-  }
-  */
-
   private static Path BASE_TMP_PATH = new Path("target",
       TestDefaultContainerExecutor.class.getSimpleName());