Examples of KoanIncompleteException


Examples of com.sandwich.koan.KoanIncompleteException

public class BlowUpOnLineTen {
  // gotta blow up on line 10 thus the comment
  @Koan
  public void blowUpOnLineTen(){
    throw new KoanIncompleteException(null);
  }
View Full Code Here

Examples of com.sandwich.koan.KoanIncompleteException

public class BlowUpOnLineEleven {
  // gotta put it on line 11 thus the two lines here
  //
  @Koan
  public void blowUpOnLineEleven() {
    throw new KoanIncompleteException(null);
  }
View Full Code Here

Examples of com.sandwich.koan.KoanIncompleteException

 
  private void assertEquals(String expectation, ByteArrayOutputStream bytes){
    expectation = expectation == null ? "" : expectation;
    String bytesString = String.valueOf(bytes);
    if(!expectation.equals(bytesString)){
      throw new KoanIncompleteException("expected: <"+expectation+"> but found: <"+bytesString+">");
    }
  }
View Full Code Here

Examples of com.sandwich.koan.KoanIncompleteException

  private void assertContains(boolean assertContains, String expectation, ByteArrayOutputStream bytes) {
    String consoleOutput = String.valueOf(bytes.toString());
    boolean containsTheSubstring = consoleOutput.contains(expectation);
    if(assertContains && !containsTheSubstring || !assertContains && containsTheSubstring){
      throw new KoanIncompleteException(new StringBuilder(
          "<").append(
          expectation).append(
          "> ").append(
          (assertContains ? "wasn't" : "was")).append(
          " found in: " ).append(
View Full Code Here

Examples of com.sandwich.koan.KoanIncompleteException

        }
        onLine[0]++;
      }
    });
    if(!found[0]){
      throw new KoanIncompleteException(lineText+" was expected, but not found in: "+bytesString);
    }
  }
View Full Code Here

Examples of com.sandwich.koan.KoanIncompleteException

public class BlowUpOnLineEleven {
  // gotta put it on line 11 thus the two spaces here
  //
  @Koan
  public void blowUpOnLineEleven() {
    throw new KoanIncompleteException(null);
  }
View Full Code Here

Examples of com.sandwich.koan.KoanIncompleteException

  }
 
  public void assertSystemOutEquals(String expectation){
    expectation = expectation == null ? "" : expectation;
    if(!expectation.equals(bytes.toString())){
      throw new KoanIncompleteException("expected: <"+expectation+"> but found: <"+bytes.toString()+">");
    }
  }
View Full Code Here

Examples of com.sandwich.koan.KoanIncompleteException

 
  private void assertSystemOutContains(boolean assertContains, String expectation) {
    String consoleOutput = bytes.toString();
    boolean containsTheSubstring = consoleOutput.contains(expectation);
    if(assertContains && !containsTheSubstring || !assertContains && containsTheSubstring){
      throw new KoanIncompleteException(new StringBuilder(
          "<").append(
          expectation).append(
          "> ").append(
          (assertContains ? "wasn't" : "was")).append(
          " found in: " ).append(
View Full Code Here

Examples of com.sandwich.koan.KoanIncompleteException

        }
        onLine[0]++;
      }
    });
    if(!found[0]){
      throw new KoanIncompleteException(lineText+" was expected, but not found in: "+bytes.toString());
    }
  }
View Full Code Here

Examples of com.sandwich.koan.KoanIncompleteException

  public static void fail(String msg, Object o0, Object o1){
    fail(msg+(msg.length() == 0 ? "" : KoanConstants.EOL)+EXPECTED+o0+BUT_WAS+o1+END);
  }
 
  public static void fail(String msg){
    throw new KoanIncompleteException(msg);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.