Appendix C. AutoTestBuilder with Exclusion Support

This is the version of the AutoTestBuilder with exclusion support. Before each test run, the exclusion file test.exclusions is read and applied to the list of available types.

Example . org.eclipse.contribution.junit/AutoTestBuilder

public class AutoTestBuilder extends IncrementalProjectBuilder {
  private static boolean enabled= true;
  private static boolean trace= false;

  public AutoTestBuilder() {
  }

  protected IProject[] build(int kind, Map args,
     IProgressMonitor pm) throws CoreException {
    if (hasBuildErrors() || !AutoTestBuilder.enabled)
     return null;
    IJavaProject javaProject= JavaCore.create(getProject());
    IType[] types= new TestSearcher().findAll(javaProject, pm);
    types= exclude(types); if (trace) ...

Get Contributing to Eclipse: Principles, Patterns, and Plug-Ins now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.