Package com.sandwich.koan.cmdline

Examples of com.sandwich.koan.cmdline.CommandLineArgumentBuilder


public class AppLauncherTest {

  @Test
  public void testNecessityOfAddingRunKoansCommandLineArgument_addsIfNoArgsPresent(){ //default target
    Map<ArgumentType, CommandLineArgument> args = new CommandLineArgumentBuilder();
    assertArgsContains(true, args, ArgumentType.RUN_KOANS);
  }
View Full Code Here


    assertArgsContains(true, args, ArgumentType.RUN_KOANS);
  }

  @Test
  public void testNecessityOfAddingRunKoansCommandLineArgument_ifClassArgIsPresent(){
    Map<ArgumentType, CommandLineArgument> args = new CommandLineArgumentBuilder(Object.class.getName());
    assertArgsContains(true, args, ArgumentType.RUN_KOANS, ArgumentType.CLASS_ARG);
  }
View Full Code Here

    List<ArgumentType> types = new ArrayList<ArgumentType>(Arrays.asList(ArgumentType.values()));
    assertTrue(types.remove(ArgumentType.CLASS_ARG));
    assertTrue(types.remove(ArgumentType.DEBUG));
    assertTrue(types.remove(ArgumentType.RUN_KOANS));
    for(ArgumentType type : types){
      Map<ArgumentType, CommandLineArgument> args = new CommandLineArgumentBuilder(type.args().iterator().next());
      assertArgsContains(false, args, ArgumentType.RUN_KOANS);
      assertArgsContains(true, args, type);
    }
  }
View Full Code Here

import com.sandwich.util.io.directories.DirectoryManager;

public class AppLauncher {

  public static void main(final String... args) throws Throwable {
    Map<ArgumentType, CommandLineArgument> argsMap = new CommandLineArgumentBuilder(args);
    if(argsMap.containsKey(ArgumentType.RUN_KOANS)){
      new Thread(new Runnable(){
        public void run() {
          do{
            try {
              char c = (char)System.in.read();
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) {
            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

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

public class ConsolePresenterTest extends CommandLineTestCase {

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

TOP

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

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.