@Test public void testReadFileForStrComp() throws IOException { List<String> actualList = reader.readFileForStrComp(TEST_CLASS_WEB); String[] expecteds = expectedList.stream().toArray(String[]::new); String[] actuals = actualList.stream().toArray(String[]::new); assertArrayEquals(expecteds, actuals); }
@Override public List<String> readFileForStrComp(String filePath) throws IOException { List<String> lines = new ArrayList<>(); URL url = new URL(filePath); BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream())); String line = null; while ((line = reader.readLine()) != null) { lines.add(line); } reader.close(); return lines; }
WebFileReader implements ContentReader { @Override public List<String> readFileForStrComp(String filePath) throws IOException { List<String> lines = new ArrayList<>(); URL url = new URL(filePath); BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream())); String line = null; while ((line = reader.readLine()) != null) { lines.add(line); } reader.close(); return lines; } }
WebFileReader implements ContentReader { @Override public List<String> readFileForStrComp(String filePath) throws IOException { List<String> lines = new ArrayList<>(); URL url = new URL(filePath); BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream())); String line = null; while ((line = reader.readLine()) != null) { lines.add(line); } reader.close(); return lines; }  }
WebFileReader implements ContentReader { @Override public List<String> readFileForStrComp(String filePath) throws IOException { List<String> lines = new ArrayList<>(); URL url = new URL(filePath); BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream())); String line = null; while ((line = reader.readLine()) != null) { lines.add(line); } reader.close(); return lines; }  @Override String readFileForRegex(String filePath); @Override List<String> readFileForStrComp(String filePath); }
WebFileReader implements ContentReader { @Override public List<String> readFileForStrComp(String filePath) throws IOException { List<String> lines = new ArrayList<>(); URL url = new URL(filePath); BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream())); String line = null; while ((line = reader.readLine()) != null) { lines.add(line); } reader.close(); return lines; }  @Override String readFileForRegex(String filePath); @Override List<String> readFileForStrComp(String filePath);  }