예제 #1
0
  @Before
  public void setup() {
    metacardList = getMetacardList(5);

    consoleOutput = new ConsoleOutput();
    consoleOutput.interceptSystemOut();
  }
예제 #2
0
  /**
   * Tests the {@Link RemoveCommand} when passed a null list of ids
   *
   * @throws Exception
   */
  @Test
  public void testNullList() throws Exception {
    final SolrCacheMBean mbean = mock(SolrCacheMBean.class);

    RemoveCommand removeCommand =
        new RemoveCommand() {
          @Override
          protected SolrCacheMBean getCacheProxy() {
            return mbean;
          }
        };

    removeCommand.ids = null;

    removeCommand.doExecute();

    assertThat(consoleOutput.getOutput(), containsString("Nothing to remove."));

    consoleOutput.reset();
  }
예제 #3
0
 @AfterClass
 public static void tearDownClass() throws IOException {
   consoleOutput.resetSystemOut();
   consoleOutput.closeBuffer();
 }
 @Override
 public void failed(String step, Throwable storyFailure) {
   super.failed(step, storyFailure);
   print(format("testFailed", eventName, storyFailure.getMessage()));
 }
 @Override
 public void pending(String step) {
   super.pending(step);
   print(format("testIgnored", eventName));
 }
 @Override
 public void afterScenario() {
   super.afterScenario();
   print(format("testFinished", eventName));
   this.eventName = null;
 }
 @Override
 public void beforeScenario(String title) {
   this.eventName = keywords.scenario() + scenarioTitle(title);
   print(format("testStarted", eventName));
   super.beforeScenario(title);
 }
 @Override
 public void execute() {
   ConsoleOutput consoleOutput = new ConsoleOutput(toString());
   consoleOutput.displayMessage();
 }