From 1930a7bf608fef760c4286882f6abb99f47001ff Mon Sep 17 00:00:00 2001 From: Vidura Mudalige Date: Fri, 2 Aug 2019 21:16:19 +1000 Subject: [PATCH] =?UTF-8?q?YARN-9093.=20Remove=20commented=20code=20block?= =?UTF-8?q?=20from=20the=20beginning=20of=20Tes=E2=80=A6=20(#444)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestDefaultContainerExecutor.java | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestDefaultContainerExecutor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestDefaultContainerExecutor.java index dba79b33a5..a5c115283a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestDefaultContainerExecutor.java +++ b/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 @@ 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 { - 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.anyObject(), anyInt(), anyShort(), anyLong(), - Matchers.anyObject(), anyInt(), anyBoolean()); - return dob; - } - */ - private static Path BASE_TMP_PATH = new Path("target", TestDefaultContainerExecutor.class.getSimpleName());