YARN-9093. Remove commented code block from the beginning of Tes… (#444)
This commit is contained in:
parent
cbcada804d
commit
1930a7bf60
@ -83,45 +83,6 @@
|
|||||||
|
|
||||||
public class TestDefaultContainerExecutor {
|
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",
|
private static Path BASE_TMP_PATH = new Path("target",
|
||||||
TestDefaultContainerExecutor.class.getSimpleName());
|
TestDefaultContainerExecutor.class.getSimpleName());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user