@Test public void testInvalidInput() { String input = "Lorem ipsum dolor sit amet"; List<CrashStackTrace> stackTraces = StackTracesParsing.parseStackTraces(input); assertThat(stackTraces, hasSize(0)); }
public static List<CrashStackTrace> parseStackTraces(String input){ CharStream text = CharStreams.fromString(input); StackTracesLexer lexer = new StackTracesLexer(text); CommonTokenStream tokens = new CommonTokenStream(lexer); StackTracesParser parser = new StackTracesParser(tokens); StackTracesParser.StackTracesContext tree = parser.stackTraces(); StackTracesCollectorListener listener = new StackTracesCollectorListener(); ParseTreeWalker walker = new ParseTreeWalker(); walker.walk(listener, tree); return listener.getStackTraces(); }
StackTracesParsing { public static List<CrashStackTrace> parseStackTraces(String input){ CharStream text = CharStreams.fromString(input); StackTracesLexer lexer = new StackTracesLexer(text); CommonTokenStream tokens = new CommonTokenStream(lexer); StackTracesParser parser = new StackTracesParser(tokens); StackTracesParser.StackTracesContext tree = parser.stackTraces(); StackTracesCollectorListener listener = new StackTracesCollectorListener(); ParseTreeWalker walker = new ParseTreeWalker(); walker.walk(listener, tree); return listener.getStackTraces(); } }
StackTracesParsing { public static List<CrashStackTrace> parseStackTraces(String input){ CharStream text = CharStreams.fromString(input); StackTracesLexer lexer = new StackTracesLexer(text); CommonTokenStream tokens = new CommonTokenStream(lexer); StackTracesParser parser = new StackTracesParser(tokens); StackTracesParser.StackTracesContext tree = parser.stackTraces(); StackTracesCollectorListener listener = new StackTracesCollectorListener(); ParseTreeWalker walker = new ParseTreeWalker(); walker.walk(listener, tree); return listener.getStackTraces(); }  }
StackTracesParsing { public static List<CrashStackTrace> parseStackTraces(String input){ CharStream text = CharStreams.fromString(input); StackTracesLexer lexer = new StackTracesLexer(text); CommonTokenStream tokens = new CommonTokenStream(lexer); StackTracesParser parser = new StackTracesParser(tokens); StackTracesParser.StackTracesContext tree = parser.stackTraces(); StackTracesCollectorListener listener = new StackTracesCollectorListener(); ParseTreeWalker walker = new ParseTreeWalker(); walker.walk(listener, tree); return listener.getStackTraces(); }  static List<CrashStackTrace> parseStackTraces(String input); }
StackTracesParsing { public static List<CrashStackTrace> parseStackTraces(String input){ CharStream text = CharStreams.fromString(input); StackTracesLexer lexer = new StackTracesLexer(text); CommonTokenStream tokens = new CommonTokenStream(lexer); StackTracesParser parser = new StackTracesParser(tokens); StackTracesParser.StackTracesContext tree = parser.stackTraces(); StackTracesCollectorListener listener = new StackTracesCollectorListener(); ParseTreeWalker walker = new ParseTreeWalker(); walker.walk(listener, tree); return listener.getStackTraces(); }  static List<CrashStackTrace> parseStackTraces(String input);  }