### Question:
HelpParseCommand extends AbstractCommand { @Override public void execute() throws CommandExecutionException, CommandFailureException { String file = System.getProperty(envSettings.getDbPatchFile()); if (file == null) { throw new CommandFailureException("Set system property \"" + envSettings.getDbPatchFile() + "\" to file you want to parse."); } execute(System.out, new File(file)); } HelpParseCommand(EnvSettings envSettings); @Override void execute();  }### Answer:
@Test(expected = CommandFailureException.class) public void testParseFileNotFount() throws Exception { command.execute(new PrintStream(new NullOutputStream()), new File("not.existing.file.sql")); }
@Test public void testParse() throws Exception { Patch patch = addPatchToATestContext("010.patch1", "010.patch1.sql"); final File patchFile = patch.getFile(); String out = executeToString(new ExecuteToStringCallback() { @Override public void call(PrintStream printStream) throws Exception { command.execute(printStream, patchFile); } }); Assert.assertEquals("Statements count: 2\n" + "{SqlPatchStatement:INSERT INTO tab (ID) VALUES (1)}\n" + "{SqlPatchStatement:INSERT INTO tab (ID) VALUES (2)}", out.trim()); }