Java Code Examples for org.eclipse.core.resources.IFolder#findMarkers()
The following examples show how to use
org.eclipse.core.resources.IFolder#findMarkers() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProfilerAbstractBuilderTest.java From xtext-eclipse with Eclipse Public License 2.0 | 6 votes |
@Test public void testFullBuildBigProjectWithRefeernceToJar() throws Exception { IJavaProject project = workspace.createJavaProject("foo"); workspace.addNature(project.getProject(), XtextProjectHelper.NATURE_ID); IFolder folder = project.getProject().getFolder("src"); IFile jarFile = project.getProject().getFile("my.jar"); jarFile.create(jarInputStream(new TextFile("my/element"+F_EXT,"object ReferenceMe")), true, workspace.monitor()); workspace.addJarToClasspath(project, jarFile); int NUM_FILES = 2000; IFile[] files = new IFile[NUM_FILES]; StopWatch timer = new StopWatch(); for (int i = 0; i < NUM_FILES; i++) { IFile file = folder.getFile("Test_" + i + "_" + F_EXT); files[i] = file; String contents = "object Foo" + i + " references ReferenceMe"; file.create(new StringInputStream(contents), true, workspace.monitor()); } logAndReset("Creating files", timer); workspace.build(); logAndReset("Auto build", timer); IMarker[] iMarkers = folder.findMarkers(EValidator.MARKER, true, IResource.DEPTH_INFINITE); for (IMarker iMarker : iMarkers) { System.out.println(iMarker.getAttribute(IMarker.MESSAGE)); } assertEquals(0,iMarkers.length); }
Example 2
Source File: ProfilerAbstractBuilderTest.java From xtext-eclipse with Eclipse Public License 2.0 | 6 votes |
@Test public void testFullBuildBigProjectWithLinkingErrors() throws Exception { IJavaProject project = workspace.createJavaProject("foo"); workspace.addNature(project.getProject(), XtextProjectHelper.NATURE_ID); IFolder folder = project.getProject().getFolder("src"); int NUM_FILES = 200; IFile[] files = new IFile[NUM_FILES]; StopWatch timer = new StopWatch(); for (int i = 0; i < NUM_FILES; i++) { IFile file = folder.getFile("Test_" + i + "_" + F_EXT); files[i] = file; String contents = "object Foo" + i + " references Foo" + (i * 1000); if (i == NUM_FILES) contents = "object Foo" + i; file.create(new StringInputStream(contents), true, workspace.monitor()); } logAndReset("Creating files", timer); workspace.build(); logAndReset("Auto build", timer); IMarker[] iMarkers = folder.findMarkers(EValidator.MARKER, true, IResource.DEPTH_INFINITE); assertEquals(NUM_FILES-1,iMarkers.length); }
Example 3
Source File: ProfilerAbstractBuilderTest.java From xtext-eclipse with Eclipse Public License 2.0 | 6 votes |
@Test public void testFullBuildBigProjectWithSyntaxErrors() throws Exception { IJavaProject project = workspace.createJavaProject("foo"); workspace.addNature(project.getProject(), XtextProjectHelper.NATURE_ID); IFolder folder = project.getProject().getFolder("src"); int NUM_FILES = 500; IFile[] files = new IFile[NUM_FILES]; StopWatch timer = new StopWatch(); for (int i = 0; i < NUM_FILES; i++) { IFile file = folder.getFile("Test_" + i + "_" + F_EXT); files[i] = file; String contents = "object Foo" + i + " references Foo" + (i * 1000); if (i == NUM_FILES) contents = "object Foo" + i; file.create(new StringInputStream(contents), true, workspace.monitor()); } logAndReset("Creating files", timer); workspace.build(); logAndReset("Auto build", timer); IMarker[] iMarkers = folder.findMarkers(EValidator.MARKER, true, IResource.DEPTH_INFINITE); assertEquals(NUM_FILES-1,iMarkers.length); }