@Test public void testReadLinesThrows() throws IOException { exceptionRule.expect(IllegalStateException.class); exceptionRule.expectMessage("Unable to read file fileUri"); JavaScriptFile file = mock(JavaScriptFile.class); when(file.uri()).thenReturn(URI.create("fileUri")); when(file.contents()).thenThrow(IOException.class); readLines(file); }
public static List<String> readLines(JavaScriptFile file) { try (BufferedReader reader = newBufferedReader(file)) { return reader.lines().collect(Collectors.toList()); } catch (IOException e) { throw new IllegalStateException("Unable to read file " + file.uri(), e); } }
CheckUtils { public static List<String> readLines(JavaScriptFile file) { try (BufferedReader reader = newBufferedReader(file)) { return reader.lines().collect(Collectors.toList()); } catch (IOException e) { throw new IllegalStateException("Unable to read file " + file.uri(), e); } } }
CheckUtils { public static List<String> readLines(JavaScriptFile file) { try (BufferedReader reader = newBufferedReader(file)) { return reader.lines().collect(Collectors.toList()); } catch (IOException e) { throw new IllegalStateException("Unable to read file " + file.uri(), e); } } private  CheckUtils(); }
CheckUtils { public static List<String> readLines(JavaScriptFile file) { try (BufferedReader reader = newBufferedReader(file)) { return reader.lines().collect(Collectors.toList()); } catch (IOException e) { throw new IllegalStateException("Unable to read file " + file.uri(), e); } } private  CheckUtils(); static String asString(Tree tree); static ExpressionTree removeParenthesis(ExpressionTree expressionTree); static Tree parentIgnoreParentheses(Tree tree); static ControlFlowGraph buildControlFlowGraph(Tree tree); static boolean isDescendant(Tree tree, Tree potentialParent); @Nullable static Tree getFirstAncestor(Tree tree, Kinds... kind); static List<String> readLines(JavaScriptFile file); }
CheckUtils { public static List<String> readLines(JavaScriptFile file) { try (BufferedReader reader = newBufferedReader(file)) { return reader.lines().collect(Collectors.toList()); } catch (IOException e) { throw new IllegalStateException("Unable to read file " + file.uri(), e); } } private  CheckUtils(); static String asString(Tree tree); static ExpressionTree removeParenthesis(ExpressionTree expressionTree); static Tree parentIgnoreParentheses(Tree tree); static ControlFlowGraph buildControlFlowGraph(Tree tree); static boolean isDescendant(Tree tree, Tree potentialParent); @Nullable static Tree getFirstAncestor(Tree tree, Kinds... kind); static List<String> readLines(JavaScriptFile file);  }