コード例 #1
0
ファイル: RemoveCommandTest.java プロジェクト: EIrwin/ddf
  @Before
  public void setup() {
    metacardList = getMetacardList(5);

    consoleOutput = new ConsoleOutput();
    consoleOutput.interceptSystemOut();
  }
コード例 #2
0
ファイル: RemoveCommandTest.java プロジェクト: EIrwin/ddf
  /**
   * 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
ファイル: RemoveCommandTest.java プロジェクト: EIrwin/ddf
 @AfterClass
 public static void tearDownClass() throws IOException {
   consoleOutput.resetSystemOut();
   consoleOutput.closeBuffer();
 }
コード例 #4
0
 @Override
 public void failed(String step, Throwable storyFailure) {
   super.failed(step, storyFailure);
   print(format("testFailed", eventName, storyFailure.getMessage()));
 }
コード例 #5
0
 @Override
 public void pending(String step) {
   super.pending(step);
   print(format("testIgnored", eventName));
 }
コード例 #6
0
 @Override
 public void afterScenario() {
   super.afterScenario();
   print(format("testFinished", eventName));
   this.eventName = null;
 }
コード例 #7
0
 @Override
 public void beforeScenario(String title) {
   this.eventName = keywords.scenario() + scenarioTitle(title);
   print(format("testStarted", eventName));
   super.beforeScenario(title);
 }
コード例 #8
0
 @Override
 public void execute() {
   ConsoleOutput consoleOutput = new ConsoleOutput(toString());
   consoleOutput.displayMessage();
 }