@Test public void should_handle_nested_blocks_as_single_statement() throws Exception { final OracleStatementSplitter splitter = new OracleStatementSplitter(); final List<String> statements = splitter.splitStatements("DECLARE\n" + " l_message \n" + " VARCHAR2 (100) := 'Hello';\n" + "BEGIN\n" + " DECLARE\n" + " l_message2 VARCHAR2 (100) := \n" + " l_message || ' World!'; \n" + " BEGIN\n" + " DBMS_OUTPUT.put_line (l_message2);\n" + " END;\n" + "EXCEPTION\n" + " WHEN OTHERS\n" + " THEN\n" + " DBMS_OUTPUT.put_line \n" + " (DBMS_UTILITY.format_error_stack);\n" + "END;"); assertThat(statements).hasSize(1); }
@Override public List<String> splitStatements(String script) { return splitStatements(new StringReader(script)); }
OracleStatementSplitter implements StatementSplitter { @Override public List<String> splitStatements(String script) { return splitStatements(new StringReader(script)); } }
OracleStatementSplitter implements StatementSplitter { @Override public List<String> splitStatements(String script) { return splitStatements(new StringReader(script)); }  }
OracleStatementSplitter implements StatementSplitter { @Override public List<String> splitStatements(String script) { return splitStatements(new StringReader(script)); }  @Override void setStatementDelimiter(String statementDelimiter); @Override void setTrimStatementDelimiter(boolean trimStatementDelimiter); @Override String supports(); @Override List<String> splitStatements(String script); @Override List<String> splitStatements(Reader reader); }
OracleStatementSplitter implements StatementSplitter { @Override public List<String> splitStatements(String script) { return splitStatements(new StringReader(script)); }  @Override void setStatementDelimiter(String statementDelimiter); @Override void setTrimStatementDelimiter(boolean trimStatementDelimiter); @Override String supports(); @Override List<String> splitStatements(String script); @Override List<String> splitStatements(Reader reader);  }