@Test public void testParseAScript() throws IOException { String line = ""; List<String> sourceA = new ArrayList<String>(); try (InputStream isA = TextParserTest.class.getResourceAsStream("/normal_script.prg"); BufferedReader br = new BufferedReader(new InputStreamReader(isA))) { assertThat(isA).isNotNull(); while ((line = br.readLine()) != null) { sourceA.add(line); } } CclScript cclScriptA = parser.parseCclScript("script", sourceA); List<String> sourceB = new ArrayList<String>(); try (InputStream isB = TextParserTest.class.getResourceAsStream("/normal_script_extra_spaces.prg"); BufferedReader br = new BufferedReader(new InputStreamReader(isB))) { assertThat(isB).isNotNull(); while ((line = br.readLine()) != null) { sourceB.add(line); } } CclScript cclScriptB = parser.parseCclScript("script", sourceB); List<String> sourceC = new ArrayList<String>(); try (InputStream isC = TextParserTest.class.getResourceAsStream("/normal_script_tabs.prg"); BufferedReader br = new BufferedReader(new InputStreamReader(isC))) { assertThat(isC).isNotNull(); while ((line = br.readLine()) != null) { sourceC.add(line); } } CclScript cclScriptC = parser.parseCclScript("script", sourceA); List<String> sourceD = new ArrayList<String>(); try (InputStream isD = TextParserTest.class.getResourceAsStream("/normal_script_extra_tabs.prg"); BufferedReader br = new BufferedReader(new InputStreamReader(isD))) { assertThat(isD).isNotNull(); while ((line = br.readLine()) != null) { sourceD.add(line); } } CclScript cclScriptD = parser.parseCclScript("script", sourceD); assertThat(cclScriptB.equals(cclScriptA)).isTrue(); assertThat(cclScriptC).isEqualTo(cclScriptA); assertThat(cclScriptD).isEqualTo(cclScriptA); }
public CclScript parseCclScript(final String scriptName, final List<String> source) { return parse(scriptName, source, new ScriptDocumentationFactory(), scriptFactory); }
TextParser { public CclScript parseCclScript(final String scriptName, final List<String> source) { return parse(scriptName, source, new ScriptDocumentationFactory(), scriptFactory); } }
TextParser { public CclScript parseCclScript(final String scriptName, final List<String> source) { return parse(scriptName, source, new ScriptDocumentationFactory(), scriptFactory); }  }
TextParser { public CclScript parseCclScript(final String scriptName, final List<String> source) { return parse(scriptName, source, new ScriptDocumentationFactory(), scriptFactory); }  CclScript parseCclScript(final String scriptName, final List<String> source); IncludeFile parseIncludeFile(final String includeName, final List<String> source); }
TextParser { public CclScript parseCclScript(final String scriptName, final List<String> source) { return parse(scriptName, source, new ScriptDocumentationFactory(), scriptFactory); }  CclScript parseCclScript(final String scriptName, final List<String> source); IncludeFile parseIncludeFile(final String includeName, final List<String> source);  }