Package com.sandwich.koan.cmdline

Examples of com.sandwich.koan.cmdline.CommandLineArgumentRunner


          classPath);
        DynamicClassLoader.remove(FileCompiler.sourceToClass(
            DirectoryManager.getSourceDir(), DirectoryManager.getBinDir(), file).toURI().toURL());
        if(!listener.isLastCompilationAttemptFailure()){
          ApplicationUtils.getPresenter().clearMessages();
          new CommandLineArgumentRunner(args).run();
        }
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
View Full Code Here


    stubAllKoans(Arrays.asList(new Object(){
      @Koan public void printMsg(){
        System.out.println(definitelyAUniqueString);
      }
    }));
    new CommandLineArgumentRunner().run();
    assertSystemOutContains(definitelyAUniqueString);
  }
View Full Code Here

      if(ApplicationUtils.isFirstTimeAppHasBeenRun()){
        monitor.writeChanges();
      }
      monitor.addFileSavedListener(new KoanFileCompileAndRunListener(argsMap));
    }
    new CommandLineArgumentRunner(argsMap).run();
    if(ApplicationSettings.isDebug()){
      StringBuilder argsBuilder = new StringBuilder();
      int argNumber = 0;
      for(String arg : args){
        argsBuilder.append("Argument number "+String.valueOf(++argNumber)+": '"+arg+"'");
View Full Code Here

  }
 
  @Test
  public void testMainMethodWithClassNameArg_qualifiedWithPkgName() throws Throwable {
    stubAllKoans(Arrays.asList(new OnePassingKoan()));
    new CommandLineArgumentRunner().run();
    assertSystemOutContains(Strings.getMessage("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(Strings.getMessage("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.\n"+arg0.getMessage());
          }
        });
    new CommandLineArgumentRunner().run();
  }
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.