All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.javaspec.context.Context Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package info.javaspec.context;

import info.javaspec.spec.Spec;
import org.junit.runner.Description;
import org.junit.runner.notification.RunNotifier;

import java.io.Serializable;

/** A grouping of related specs, which may be further divided into sub-groups (sub-contexts) */
public abstract class Context {
  private final String id;

  protected Context(String id) {
    this.id = id;
  }

  public String getId() { return id; }

  public abstract Description getDescription();
  public Description describeSpec(Serializable specId, String displayName) {
    return Description.createTestDescription(getDescription().getClassName(), displayName, specId);
  }

  public abstract void addSpec(Spec spec);
  public abstract boolean hasSpecs();
  public abstract long numSpecs();

  public abstract void run(RunNotifier notifier);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy