@Test public void parseTestSuite() { Runner runner = new Runner(); runner.setDriver(manager.get()); try (InputStream is = getClass().getResourceAsStream(TEST_SUITE)) { Selenese selenese = Parser.parse(TEST_SUITE, is, runner.getCommandFactory()); assertThat(selenese, is(instanceOf(TestSuite.class))); } catch (IOException e) { } }
public static Selenese parse(String filename, InputStream is, ICommandFactory commandFactory) { boolean isSide = filename.toLowerCase().endsWith(".side"); try { TestProjectReader projectReader; SourceType sourceType; if (isSide) { sourceType = SourceType.SIDE; projectReader = SideTestProjectReader.newInstance(filename, is); } else { sourceType = SourceType.SELENESE; projectReader = SeleneseTestProjectReader.newInstance(filename, is); } projectReader.setupTestCaseMap(sourceType, commandFactory); return TestProjectParser.parse(sourceType, projectReader, commandFactory); } catch (InvalidSeleneseException e) { return isSide ? Binder.newErrorTestProject(filename, e) : Binder.newErrorTestSuite(filename, e); } }
Parser { public static Selenese parse(String filename, InputStream is, ICommandFactory commandFactory) { boolean isSide = filename.toLowerCase().endsWith(".side"); try { TestProjectReader projectReader; SourceType sourceType; if (isSide) { sourceType = SourceType.SIDE; projectReader = SideTestProjectReader.newInstance(filename, is); } else { sourceType = SourceType.SELENESE; projectReader = SeleneseTestProjectReader.newInstance(filename, is); } projectReader.setupTestCaseMap(sourceType, commandFactory); return TestProjectParser.parse(sourceType, projectReader, commandFactory); } catch (InvalidSeleneseException e) { return isSide ? Binder.newErrorTestProject(filename, e) : Binder.newErrorTestSuite(filename, e); } } }
Parser { public static Selenese parse(String filename, InputStream is, ICommandFactory commandFactory) { boolean isSide = filename.toLowerCase().endsWith(".side"); try { TestProjectReader projectReader; SourceType sourceType; if (isSide) { sourceType = SourceType.SIDE; projectReader = SideTestProjectReader.newInstance(filename, is); } else { sourceType = SourceType.SELENESE; projectReader = SeleneseTestProjectReader.newInstance(filename, is); } projectReader.setupTestCaseMap(sourceType, commandFactory); return TestProjectParser.parse(sourceType, projectReader, commandFactory); } catch (InvalidSeleneseException e) { return isSide ? Binder.newErrorTestProject(filename, e) : Binder.newErrorTestSuite(filename, e); } }  }
Parser { public static Selenese parse(String filename, InputStream is, ICommandFactory commandFactory) { boolean isSide = filename.toLowerCase().endsWith(".side"); try { TestProjectReader projectReader; SourceType sourceType; if (isSide) { sourceType = SourceType.SIDE; projectReader = SideTestProjectReader.newInstance(filename, is); } else { sourceType = SourceType.SELENESE; projectReader = SeleneseTestProjectReader.newInstance(filename, is); } projectReader.setupTestCaseMap(sourceType, commandFactory); return TestProjectParser.parse(sourceType, projectReader, commandFactory); } catch (InvalidSeleneseException e) { return isSide ? Binder.newErrorTestProject(filename, e) : Binder.newErrorTestSuite(filename, e); } }  static Selenese parse(String filename, InputStream is, ICommandFactory commandFactory); static Selenese parse(String filename, ICommandFactory commandFactory); }
Parser { public static Selenese parse(String filename, InputStream is, ICommandFactory commandFactory) { boolean isSide = filename.toLowerCase().endsWith(".side"); try { TestProjectReader projectReader; SourceType sourceType; if (isSide) { sourceType = SourceType.SIDE; projectReader = SideTestProjectReader.newInstance(filename, is); } else { sourceType = SourceType.SELENESE; projectReader = SeleneseTestProjectReader.newInstance(filename, is); } projectReader.setupTestCaseMap(sourceType, commandFactory); return TestProjectParser.parse(sourceType, projectReader, commandFactory); } catch (InvalidSeleneseException e) { return isSide ? Binder.newErrorTestProject(filename, e) : Binder.newErrorTestSuite(filename, e); } }  static Selenese parse(String filename, InputStream is, ICommandFactory commandFactory); static Selenese parse(String filename, ICommandFactory commandFactory);  }