Package org.junitext

Examples of org.junitext.Category


  }

  @Override
  public void testStarted(Description description) {
    super.testStarted(description);
    Category c = CategoryResolver.getCategory(description);
    if (c != null) {
      forceInitialize(c);
      results.get(c).get("Success").add(description);
    }
  }
View Full Code Here


  }
 
  @Override
  public void testFailure(Failure failure) {
    super.testFailure(failure);
    Category c = CategoryResolver.getCategory(failure.getDescription());
    if (c != null) {
      forceInitialize(c);
      results.get(c).get("Failure").add(failure.getDescription());
      results.get(c).get("Success").remove(failure.getDescription());
    }
View Full Code Here

  }

  @Override
  public void testIgnored(Description description) {
    super.testIgnored(description);
    Category c = CategoryResolver.getCategory(description);
    if (c != null) {
      forceInitialize(c);
      results.get(c).get("Ignore").add(description);
      results.get(c).get("Success").remove(description);
    }
View Full Code Here

    this.category = c;
  }

  @Override
  public boolean shouldRun(Description description) {
    Category c = CategoryResolver.getCategory(description);
    if (c != null) {
      return c.value().equals(category);
    } else {
      return true;
    }
  }
View Full Code Here

        // only when test case
        if ((obj1.isSuite() || obj2.isSuite())) {
          return 0;
        }
        try {
          Category c1 = CategoryResolver.getCategory(obj1);
          String cat1 = c1 != null ? c1.value() : "";
          Category c2 = CategoryResolver.getCategory(obj2);
          String cat2 = c2 != null ? c2.value() : "";
          int rc = cat1.compareTo(cat2);
          // when same, sort via name
          if (rc == 0) {
            return obj1.getDisplayName().compareTo(
                obj2.getDisplayName());
View Full Code Here

    Request req = Request.aClass(ACategoryTest.class);
    Runner r = req.getRunner();

    Set<Category> cats = new HashSet<Category>();
    for (Description each : r.getDescription().getChildren()) {
      Category c = CategoryResolver.getCategory(each);
      if (c != null) {
        cats.add(c);
      }
    }
    // A is twice
    assertEquals (3, cats.size());
    // select Category "A"
    Category a = null;
    for (Iterator<Category> iter = cats.iterator() ; iter.hasNext() ; ) {
      Category c = (Category) iter.next();
      if ("A".equals(c.value())) {
        a = c;
      }
    }
    assertNotNull(a);
    assertEquals ("A", a.value());
View Full Code Here

TOP

Related Classes of org.junitext.Category

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.