MergeStreamDataConsistency extends CompareDataConsistency { public List<Path> run(String [] args) throws Exception { List<Path> inconsistencydata = new ArrayList<Path>(); String [] localStreamrootDirs = args[0].split(","); String mergedStreamRoorDir = args[1]; List<String> streamNames = new ArrayList<String>(); if (args.length == 2) { FileSystem fs = new Path(mergedStreamRoorDir, "streams").getFileSystem( new Configuration()); FileStatus[] fileStatuses; try { fileStatuses = fs.listStatus(new Path(mergedStreamRoorDir, "streams")); } catch (FileNotFoundException fe) { fileStatuses = null; } if (fileStatuses != null && fileStatuses.length != 0) { for (FileStatus file : fileStatuses) { streamNames.add(file.getPath().getName()); } } else { System.out.println("There are no stream names in the stream"); } } else if (args.length == 3) { for (String streamname : args[2].split(",")) { streamNames.add(streamname); } } inconsistencydata = this.listingValidation(mergedStreamRoorDir, localStreamrootDirs, streamNames); if (inconsistencydata.isEmpty()) { System.out.println("there is no inconsistency data"); } return inconsistencydata; }  List<Path> listingValidation(String mergedStreamRoorDir, String[] 
      localStreamrootDirs, List<String> streamNames); void doRecursiveListing(Path streamDir, 
      TreeMap<String, Path> listOfFiles, FileSystem fs, List<Path> inconsistency); List<Path> run(String [] args); static void main(String [] args);  }
@Test public void testMergeStream() throws Exception { MergeStreamDataConsistency obj = new MergeStreamDataConsistency(); testLocalMergeStreams(emptyStreamName, emptyPaths, obj); testLocalMergeStreams(emptyDirStreamName, emptyDirsPaths, obj); testLocalMergeStreams(missedFilesStreamName, missedFilePaths, obj); testLocalMergeStreams(consistentDataStreamName, emptyPaths, obj); testLocalMergeStreams(dataReplayFilesStreamName, dataReplayFilePaths, obj); testLocalMergeStreams(extrafilesStreamName, extraFilePaths, obj); testLocalMergeStreams(singleFileStreamName, emptyPaths, obj); testLocalMergeStreams(missingSingleFileStreamName, missingSingleFilePath, obj); testLocalMergeStreams(inconsistencyAtEndOfStream, inconsistencyEndPaths, obj); testLocalMergeStreams(purgedPathStreaName, purgedPaths, obj); testLocalMergeStreams(purgedOnLocalStream, purgedLocalPaths, obj); testLocalMergeStreams(duplicateFileStream, duplicateFilePaths, obj); LOG.info("all streams together"); List<Path> allStreamPaths = new ArrayList<Path>(); allStreamPaths.addAll(emptyPaths); allStreamPaths.addAll(emptyDirsPaths); allStreamPaths.addAll(missedFilePaths); allStreamPaths.addAll(dataReplayFilePaths); allStreamPaths.addAll(extraFilePaths); allStreamPaths.addAll(missingSingleFilePath); allStreamPaths.addAll(inconsistencyEndPaths); allStreamPaths.addAll(purgedPaths); allStreamPaths.addAll(purgedLocalPaths); allStreamPaths.addAll(duplicateFilePaths); testLocalMergeStreams(allStreamNames, allStreamPaths, obj); List<Path> inconsistentdata = new ArrayList<Path>(); String[] args = { ("file: + className +"/3/"), "file: LOG.info("testing run method"); inconsistentdata = obj.run(args); Assert.assertEquals(inconsistentdata.size(), allStreamPaths.size()); Assert.assertTrue(inconsistentdata.containsAll(allStreamPaths)); }