Package com.sandwich.koan.result

Examples of com.sandwich.koan.result.KoanMethodResult


        fail();
      }
    };

    KoanSuiteResult kr = new KoanResultBuilder().remainingCases(Arrays.asList(OneFailingKoan.class.getSimpleName())
      ).methodResult(new KoanMethodResult(KoanMethod.getInstance("", OneFailingKoan.class.getDeclaredMethods()[0]),
          "", "")).build();
    presenter.displayResult(kr);
    assertEquals(4, state[0]);
  }
View Full Code Here


  @Test
  public void testToString() throws Exception {
    KoanResultBuilder builder = new KoanResultBuilder()
      .remainingCases(Arrays.asList(OneFailingKoan.class.getSimpleName()))
      .methodResult(new KoanMethodResult(KoanMethod.getInstance("", OneFailingKoan.class.getDeclaredMethods()[0]), "msg", "2"))
      .level("1")
      .numberPassing(3);
    KoanSuiteResult result = builder.build();
    String string = result.toString();
    assertTrue(string.contains("1"));
View Full Code Here

  KoanSuiteResult runKoans() {
    List<String> passingSuites = new ArrayList<String>();
    List<String> failingSuites = new ArrayList<String>();
    String level = null;
    KoanMethodResult failure = null;
    DynamicClassLoader loader = KoanClassLoader.getInstance();
    Path pathToEnlightenment = getPathToEnlightenment();
    KoanSuiteCompilationListener compilationListener = new KoanSuiteCompilationListener();
    int successfull = 0;
    for (Entry<String, Map<String, Map<String, KoanElementAttributes>>> packages : pathToEnlightenment) {
      for (Entry<String, Map<String, KoanElementAttributes>> e : packages.getValue().entrySet()) {
        String name = e.getKey().substring(e.getKey().lastIndexOf('.')+1);
        if(failure == null){
          Object suite = safelyConstructSuite(loader, compilationListener, e);
          final List<KoanElementAttributes> attributes = new ArrayList<KoanElementAttributes>(e.getValue().values());
          final List<KoanMethod> methods = mergeJavaFilesMethodsAndThoseInXml(suite, attributes, pathToEnlightenment.getOnlyMethodNameToRun());
          Collections.sort(methods, new KoanComparator());
          for (final KoanMethod koan : methods) {
            KoanMethodResult result = KoanMethodRunner.run(suite, koan);
            if(KoanMethodResult.PASSED != result){
              // Test failed!
              failure = result;
              failingSuites.add(name);
              break;
View Full Code Here

          }
          break;
        }
        tempException = tempException.getCause();
      }
      return new KoanMethodResult(koan, message, getOriginalLineNumber(t, suite.getClass()));
    }
    return KoanMethodResult.PASSED;
  }
View Full Code Here

 
  @Test
  public void testToString() throws Exception {
    KoanResultBuilder builder = new KoanResultBuilder()
      .remainingCases(Arrays.asList(OneFailingKoan.class.getSimpleName()))
      .methodResult(new KoanMethodResult(KoanMethod.getInstance("", OneFailingKoan.class.getDeclaredMethods()[0]), "msg", "2"))
      .level("1")
      .numberPassing(3);
    KoanSuiteResult result = builder.build();
    String string = result.toString();
    assertTrue(string.contains("1"));
View Full Code Here

        fail();
      }
    };

    KoanSuiteResult kr = new KoanResultBuilder().remainingCases(Arrays.asList(OneFailingKoan.class.getSimpleName())
      ).methodResult(new KoanMethodResult(KoanMethod.getInstance("", OneFailingKoan.class.getDeclaredMethods()[0]),
          "", "")).build();
    presenter.displayResult(kr);
    assertEquals(4, state[0]);
  }
View Full Code Here

TOP

Related Classes of com.sandwich.koan.result.KoanMethodResult

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.