O'Reilly logo

Contributing to Eclipse: Principles, Patterns, and Plug-Ins by Kent Beck, Erich Gamma

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. The TestProject Fixture

This appendix lists the full source code of the TestProject fixture class that we used to implement the tests.

Example . org.eclipse.contribution.junit.test/TestProject

public class TestProject {
  public IProject project;
  public IJavaProject javaProject;
  private IPackageFragmentRoot sourceFolder;

  public TestProject() throws CoreException {
    IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
    project= root.getProject("Project-1");
    project.create(null);
    project.open(null);

    javaProject= JavaCore.create(project);
    IFolder binFolder= createBinFolder();
    setJavaNature();
    javaProject.setRawClasspath(new IClasspathEntry[0], null);
    createOutputFolder(binFolder);
    addSystemLibraries();
  }
  public IProject getProject ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required