@Override public void evaluate() throws Throwable { System.setProperty("disableSpringSnapshotRepos", "false"); try { try { this.base.evaluate(); } finally { for (AbstractCommand command : CliTester.this.commands) { if (command != null && command instanceof RunCommand) { ((RunCommand) command).stop(); } } System.clearProperty("disableSpringSnapshotRepos"); } } catch (Exception ex) { throw new IllegalStateException(ex); } }
@Test public void debugAddsAutoconfigReport() { CommandRunner runner = new CommandRunner("spring"); runner.addCommand(new RunCommand()); // -d counts as "debug" for the spring command, but not for the // LoggingApplicationListener runner.runAndHandleErrors("run", "samples/app.groovy", "-d"); assertThat(this.output.toString()).contains("Negative matches:"); }
@Test public void debugSwitchedOffForAppArgs() { CommandRunner runner = new CommandRunner("spring"); runner.addCommand(new RunCommand()); runner.runAndHandleErrors("run", "samples/app.groovy", "--", "-d"); assertThat(this.output.toString()).doesNotContain("Negative matches:"); }
@Test public void debugAddsAutoconfigReport() { CommandRunner runner = new CommandRunner("spring"); runner.addCommand(new RunCommand()); // -d counts as "debug" for the spring command, but not for the // LoggingApplicationListener runner.runAndHandleErrors("run", "samples/app.groovy", "-d"); assertTrue(this.output.toString().contains("Negative matches:")); }
@Test public void debugSwitchedOffForAppArgs() { CommandRunner runner = new CommandRunner("spring"); runner.addCommand(new RunCommand()); runner.runAndHandleErrors("run", "samples/app.groovy", "--", "-d"); assertFalse(this.output.toString().contains("Negative matches:")); }
public String run(String... args) throws Exception { Future<RunCommand> future = submitCommand(new RunCommand(), args); this.commands.add(future.get(this.timeout, TimeUnit.MILLISECONDS)); return getOutput(); }