Example usage for org.eclipse.jdt.core.tests.builder TestingEnvironment TestingEnvironment

List of usage examples for org.eclipse.jdt.core.tests.builder TestingEnvironment TestingEnvironment

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.tests.builder TestingEnvironment TestingEnvironment.

Prototype

TestingEnvironment

Source Link

Usage

From source file:dacapo.eclipse.EclipseTests.java

License:Open Source License

protected static void initialize() {
    try {/*from w  ww  .  ja v  a  2s  .  c  o  m*/
        if (env == null) {
            env = new TestingEnvironment();
            env.openEmptyWorkspace();
            System.out.println("<setting up workspace...>");
            setUpFullSourceWorkspace();
        }
        // TODO else error 
    } catch (Exception e) {
        System.err.println("Error creating workspace!");
        e.printStackTrace();
    }
}

From source file:org.eclipse.objectteams.otdt.test.builder.OTBuilderTests.java

License:Open Source License

/** Sets up this test.
 *///from w w  w.  ja va2  s  .c o  m
@Override
protected void setUp() throws Exception {
    super.setUp();

    this.otenv = new OTTestingEnvironment();
    this.otenv.activate();
    env = new TestingEnvironment() {
        @Override
        public Problem[] getProblemsFor(IPath path) {
            // capture some more problems than the super method, but not all:
            Problem[] allProblems = getProblemsFor(path, "org.eclipse.pde.core.problem");
            Problem[] filteredProblems = new Problem[allProblems.length];
            int j = 0;
            for (int i = 0; i < allProblems.length; i++) {
                // don't know why this warning is getting reported against perfectly valid files, ignore it for now:
                if (allProblems[i].getMessage().equals(PDECoreMessages.Builders_Manifest_useless_file))
                    continue;
                // some plugin.xml have a deprecated 'action' extension, just ignore those: 
                if (allProblems[i].getMessage().contains("deprecated"))
                    continue;
                filteredProblems[j++] = allProblems[i];
            }
            if (j < allProblems.length)
                System.arraycopy(filteredProblems, 0, filteredProblems = new Problem[j], 0, j);
            return filteredProblems;
        }
    };
    env.openEmptyWorkspace();
    env.resetWorkspace();

    BuildManager.DEBUG = 2;
}