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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.