### Question:
SimpleCopyListing extends CopyListing { private Path makeQualified(Path path) throws IOException { final FileSystem fs = path.getFileSystem(getConf()); return path.makeQualified(fs.getUri(), fs.getWorkingDirectory()); } protected  SimpleCopyListing(Configuration configuration, Credentials credentials); @Override void doBuildListing(Path pathToListingFile, S3MapReduceCpOptions options); @VisibleForTesting void doBuildListing(SequenceFile.Writer fileListWriter, S3MapReduceCpOptions options); @VisibleForTesting void doBuildListing(SequenceFile.Writer fileListWriter, S3MapReduceCpOptions options, List<Path> globbedPaths); static final String CONF_LABEL_ROOT_PATH; }### Answer:
@Test public void typical() throws Exception { Map<String, String> expectedValues = new HashMap<>(); FileSystem fs = FileSystem.get(config); Path source = new Path(temporaryRoot + "/source"); Path p1 = new Path(source, "1"); Path p2 = new Path(source, "2"); Path p3 = new Path(source, "2/3"); Path p4 = new Path(source, "2/3/4"); Path p5 = new Path(source, "5"); Path p6 = new Path(source, "5/6"); Path p7 = new Path(source, "7"); Path p8 = new Path(source, "7/8"); Path p9 = new Path(source, "7/8/9"); fs.mkdirs(p1); fs.mkdirs(p2); fs.mkdirs(p3); fs.mkdirs(p4); fs.mkdirs(p5); createFile(fs, p6); expectedValues.put(fs.makeQualified(p6).toString(), PathUtil.getRelativePath(source, p6)); fs.mkdirs(p7); fs.mkdirs(p8); createFile(fs, p9); expectedValues.put(fs.makeQualified(p9).toString(), PathUtil.getRelativePath(source, p9)); final URI uri = fs.getUri(); Path fileSystemPath = new Path(uri.toString()); source = new Path(fileSystemPath.toString(), source); URI target = URI.create("s3: Path listingPath = new Path(fileSystemPath.toString() + "/" + temporaryRoot + "/META/fileList.seq"); listing.buildListing(listingPath, options(source, target)); try (SequenceFile.Reader reader = new SequenceFile.Reader(config, SequenceFile.Reader.file(listingPath))) { Text key = new Text(); CopyListingFileStatus value = new CopyListingFileStatus(); Map<String, String> actualValues = new HashMap<>(); while (reader.next(key, value)) { if (key.toString().equals("")) { continue; } actualValues.put(value.getPath().toString(), key.toString()); } assertThat(actualValues.size(), is(expectedValues.size())); for (Map.Entry<String, String> entry : actualValues.entrySet()) { assertThat(entry.getValue(), is(expectedValues.get(entry.getKey()))); } } }