Package com.sandwich.koan.cmdline

Examples of com.sandwich.koan.cmdline.CommandLineArgumentRunner


public class AppReadinessForDeploymentTest extends CommandLineTestCase {
 
  @Test
  public void testMainMethodWithClassNameArg_qualifiedWithPkgName() throws Throwable {
    stubAllKoans(Arrays.asList(new OnePassingKoan()));
    new CommandLineArgumentRunner().run();
    assertSystemOutContains(KoanConstants.PASSING_SUITES+" "+OnePassingKoan.class.getSimpleName());
  }
View Full Code Here


  }

  @Test
  public void testMainMethodWithClassNameArg_classSimpleName() throws Throwable {
    stubAllKoans(Arrays.asList(new OnePassingKoan()));
    new CommandLineArgumentRunner().run();
    assertSystemOutContains(KoanConstants.PASSING_SUITES+" "+OnePassingKoan.class.getSimpleName());
  }
View Full Code Here

 
  @Test
  public void testMainMethodWithClassNameArg_classNameAndMethod() throws Throwable {
    stubAllKoans(Arrays.asList(new TwoFailingKoans()));
    String failingKoanMethodName = TwoFailingKoans.class.getMethod("koanTwo").getName();
    new CommandLineArgumentRunner().run();
    assertSystemOutContains(failingKoanMethodName);
    assertSystemOutContains("0/2");
  }
View Full Code Here

  }

  @Test
  public void testLineExceptionIsThrownAtIsHintedAt() throws Exception {
    stubAllKoans(Arrays.asList(new BlowUpOnLineTen()));
    new CommandLineArgumentRunner().run();
    assertSystemOutContains("Line 10");
    assertSystemOutDoesntContain("Line 11");
  }
View Full Code Here

  }
 
  @Test
  public void testLineExceptionIsThrownAtIsHintedAtEvenIfThrownFromSuperClass() throws Exception {
    stubAllKoans(Arrays.asList(new BlowUpOnLineEleven()));
    new CommandLineArgumentRunner().run();
    assertSystemOutContains("Line 11");
    assertSystemOutDoesntContain("Line 10");
  }
View Full Code Here

          @Override
          public void publish(LogRecord arg0) {
            message[0] = arg0.getMessage();
          }
        });
    new CommandLineArgumentRunner(new CommandLineArgumentBuilder()).run();
    assertEquals(
        new StringBuilder(
            WrongExpectationOrderKoan.class.getSimpleName())
            .append(".expectationOnLeft ")
            .append(EXPECTATION_LEFT_ARG).toString(), message[0]);
View Full Code Here

          @Override
          public void publish(LogRecord arg0) {
            fail("No logging necessary when koan passes, otherwise - logging is new, adjust accordingly.");
          }
        });
    new CommandLineArgumentRunner().run();
  }
View Full Code Here

public class ConsolePresenterTest extends CommandLineTestCase {

  @Test
  public void hintPresentation() throws Throwable {
    stubAllKoans(Arrays.asList(new OneFailingKoanDifferentName()));
    new CommandLineArgumentRunner(new CommandLineArgumentBuilder()).run();
    assertSystemOutContains(new StringBuilder(
        Strings.getMessage("investigate")).append(
        ": ").append(
        OneFailingKoanDifferentName.class.getSimpleName()).append(
        " class's ").append(
View Full Code Here

  @Test // uncomment enableEncouragement @ the top of ConsolePresenter class
  public void encouragement() throws Throwable {
    if(ApplicationSettings.isEncouragementEnabled()){
      stubAllKoans(Arrays.asList(new Class<?>[] {
          OneFailingKoan.class }));
      new CommandLineArgumentRunner().run();
      assertSystemOutContains(new StringBuilder(
          Strings.getMessage("you_have_conquered")).append(
          " 0 ").append(
          Strings.getMessage("out_of")).append(
          " 1 ").append(
View Full Code Here

 
  @Test
  public void testOneHundredPercentSuccessReward() throws Throwable {
    stubAllKoans(Arrays.asList(new Class<?>[] {
        OnePassingKoan.class }));
    new CommandLineArgumentRunner().run();
    assertSystemOutContains(Strings.getMessage("all_koans_succeeded"));
    assertSystemOutDoesntContain(Strings.getMessage("you_have_conquered"));
    assertSystemOutDoesntContain(Strings.getMessage("encouragement"));
  }
View Full Code Here

TOP

Related Classes of com.sandwich.koan.cmdline.CommandLineArgumentRunner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.