Search in sources :

Example 26 with IMarker

use of org.eclipse.core.resources.IMarker in project xtext-xtend by eclipse.

the class Bug473833Test method assertNoErrors.

private void assertNoErrors(final IFile file) {
    try {
        final IMarker[] findMarkers = file.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
        for (final IMarker iMarker : findMarkers) {
            String _message = MarkerUtilities.getMessage(iMarker);
            int _severity = MarkerUtilities.getSeverity(iMarker);
            boolean _equals = (_severity == IMarker.SEVERITY_ERROR);
            Assert.assertFalse(_message, _equals);
        }
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : IMarker(org.eclipse.core.resources.IMarker)

Example 27 with IMarker

use of org.eclipse.core.resources.IMarker in project xtext-xtend by eclipse.

the class JavaVersionSettingTest method assertNoErrors.

private void assertNoErrors(final IFile file) {
    try {
        final IMarker[] findMarkers = file.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
        for (final IMarker iMarker : findMarkers) {
            String _message = MarkerUtilities.getMessage(iMarker);
            int _severity = MarkerUtilities.getSeverity(iMarker);
            boolean _equals = (_severity == IMarker.SEVERITY_ERROR);
            Assert.assertFalse(_message, _equals);
        }
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : IMarker(org.eclipse.core.resources.IMarker)

Example 28 with IMarker

use of org.eclipse.core.resources.IMarker in project xtext-xtend by eclipse.

the class RebuildAffectedResourcesTest method assertHasErrors.

public void assertHasErrors(final IFile file, final String msgPart) {
    try {
        final IMarker[] findMarkers = file.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
        for (final IMarker iMarker : findMarkers) {
            if (((MarkerUtilities.getSeverity(iMarker) == IMarker.SEVERITY_ERROR) && MarkerUtilities.getMessage(iMarker).contains(msgPart))) {
                return;
            }
        }
        IPath _fullPath = file.getFullPath();
        String _plus = ((("Expected an error marker containing \'" + msgPart) + "\' on ") + _fullPath);
        String _plus_1 = (_plus + " but found ");
        final Function1<IMarker, String> _function = (IMarker it) -> {
            return MarkerUtilities.getMessage(it);
        };
        String _join = IterableExtensions.join(ListExtensions.<IMarker, String>map(((List<IMarker>) Conversions.doWrapArray(findMarkers)), _function), ",");
        String _plus_2 = (_plus_1 + _join);
        Assert.fail(_plus_2);
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : IPath(org.eclipse.core.runtime.IPath) IMarker(org.eclipse.core.resources.IMarker)

Example 29 with IMarker

use of org.eclipse.core.resources.IMarker in project xtext-xtend by eclipse.

the class RebuildAffectedResourcesTest method assertNoErrorsInWorkspace.

public void assertNoErrorsInWorkspace() {
    try {
        final IMarker[] findMarkers = ResourcesPlugin.getWorkspace().getRoot().findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
        for (final IMarker iMarker : findMarkers) {
            String _message = MarkerUtilities.getMessage(iMarker);
            int _severity = MarkerUtilities.getSeverity(iMarker);
            boolean _equals = (_severity == IMarker.SEVERITY_ERROR);
            Assert.assertFalse(_message, _equals);
        }
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : IMarker(org.eclipse.core.resources.IMarker)

Example 30 with IMarker

use of org.eclipse.core.resources.IMarker in project xtext-xtend by eclipse.

the class ResolvingCrossReferenceDuringIndexingTest method assertNoErrorsInWorkspace.

public void assertNoErrorsInWorkspace() {
    try {
        final IMarker[] findMarkers = ResourcesPlugin.getWorkspace().getRoot().findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
        for (final IMarker iMarker : findMarkers) {
            String _message = MarkerUtilities.getMessage(iMarker);
            int _severity = MarkerUtilities.getSeverity(iMarker);
            boolean _equals = (_severity == IMarker.SEVERITY_ERROR);
            Assert.assertFalse(_message, _equals);
        }
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : IMarker(org.eclipse.core.resources.IMarker)

Aggregations

IMarker (org.eclipse.core.resources.IMarker)115 CoreException (org.eclipse.core.runtime.CoreException)31 Test (org.junit.Test)31 IFile (org.eclipse.core.resources.IFile)23 IResource (org.eclipse.core.resources.IResource)16 ArrayList (java.util.ArrayList)15 IProject (org.eclipse.core.resources.IProject)8 IPath (org.eclipse.core.runtime.IPath)8 Position (org.eclipse.jface.text.Position)8 Annotation (org.eclipse.jface.text.source.Annotation)7 Matchers.anyString (org.mockito.Matchers.anyString)7 IOException (java.io.IOException)6 HashMap (java.util.HashMap)6 Rule (net.sourceforge.pmd.Rule)6 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)6 BadLocationException (org.eclipse.jface.text.BadLocationException)6 RuleViolation (net.sourceforge.pmd.RuleViolation)5 JavaLanguageModule (net.sourceforge.pmd.lang.java.JavaLanguageModule)5 IDocument (org.eclipse.jface.text.IDocument)5 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)5