Package org.junit.runner

Examples of org.junit.runner.Description.addChild()


    @Override
    public Description getDescription() {
        Description description = Description
                .createSuiteDescription("Run until failure");
        description.addChild(runner.getDescription());
        return description;
    }

    /**
     * Continuously runs the {@link Class class} under test until a failure
View Full Code Here


  @Override
  public Description getDescription() {
    Description spec= Description.createSuiteDescription(fName);
    for (Runner runner : fRunners)
      spec.addChild(runner.getDescription());
    return spec;
  }

  public List<Runner> getRunners() {
    return fRunners;
View Full Code Here

      TestSuite ts= (TestSuite) test;
      String name= ts.getName() == null ? "" : ts.getName();
      Description description= Description.createSuiteDescription(name);
      int n= ts.testCount();
      for (int i= 0; i < n; i++)
        description.addChild(makeDescription(ts.testAt(i)));
      return description;
    } else if (test instanceof JUnit4TestAdapter) {
      JUnit4TestAdapter adapter= (JUnit4TestAdapter) test;
      return adapter.getDescription();
    } else if (test instanceof TestDecorator) {
View Full Code Here

  @Override
  public Description getDescription() {
    Description spec= Description.createSuiteDescription(getName());
    List<Method> testMethods= fTestMethods;
    for (Method method : testMethods)
        spec.addChild(methodDescription(method));
    return spec;
  }

  protected String getName() {
    return getTestClass().getName();
View Full Code Here

    @Override
    public Description getDescription() {
        Description spec = Description.createSuiteDescription(getName(), classAnnotations());
        List<Method> testMethods = this.testMethods;
        for (Method method : testMethods)
            spec.addChild(methodDescription(method));
        return spec;
    }

    protected Annotation[] classAnnotations() {
        return getTestClass().getAnnotations();
View Full Code Here

      TestSuite ts= (TestSuite) test;
      String name= ts.getName() == null ? "" : ts.getName();
      Description description= Description.createSuiteDescription(name);
      int n= ts.testCount();
      for (int i= 0; i < n; i++)
        description.addChild(makeDescription(ts.testAt(i)));
      return description;
    } else if (test instanceof JUnit4TestAdapter) {
      JUnit4TestAdapter adapter= (JUnit4TestAdapter) test;
      return adapter.getDescription();
    } else if (test instanceof TestDecorator) {
View Full Code Here

    Description spec= Description.createSuiteDescription(fName);

    DEBUG.P("spec="+spec);
    DEBUG.P("fRunners.size="+fRunners.size());
    for (Runner runner : fRunners)
      spec.addChild(runner.getDescription());
    return spec;

    }finally{//我加上的
    DEBUG.P(0,this,"getDescription()");
    }
View Full Code Here

    DEBUG.P(this,"getDescription()");

    Description spec= Description.createSuiteDescription(getName(), classAnnotations());
    List<Method> testMethods= fTestMethods;
    for (Method method : testMethods)
      spec.addChild(methodDescription(method));

    DEBUG.P("spec="+spec);
    return spec;

    }finally{//我加上的
View Full Code Here

      Description description = Description.createSuiteDescription(
          testName(method) + " [" + times + " times]",
          method.getAnnotations());

      for (int i = 1; i <= times; i++) {
        description.addChild(Description.createTestDescription(
            getTestClass().getJavaClass(), "[" + i + "] "
                + testName(method)));
      }
      return description;
    }
View Full Code Here

      String displayName = o.getAsJsonPrimitive("displayName").getAsString();
      Description description = Description.createSuiteDescription(displayName,
          annotations.toArray(new Annotation[annotations.size()]));
 
      for (JsonElement child : o.getAsJsonArray("children")) {
        description.addChild(deserialize(child, typeOfT, context));
      }

      ComparableDescription key = new ComparableDescription(description);
      identifiers.put(key, key.id);
      return description;
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.