Search in sources :

Example 56 with Diagnostic

use of org.eclipse.lsp4j.Diagnostic in project sts4 by spring-projects.

the class ManifestYamlEditorTest method reconcileRouteFormat.

@Test
public void reconcileRouteFormat() throws Exception {
    Editor editor = harness.newEditor("applications:\n" + "- name: foo\n" + "  routes:\n" + "  - route: http://springsource.org\n");
    editor.assertProblems("http://springsource.org|is not a valid 'Route'");
    Diagnostic problem = editor.assertProblem("http://springsource.org");
    assertEquals(DiagnosticSeverity.Error, problem.getSeverity());
    editor = harness.newEditor("applications:\n" + "- name: foo\n" + "  routes:\n" + "  - route: spring source.org\n");
    editor.assertProblems("spring source.org|is not a valid 'Route'");
    problem = editor.assertProblem("spring source.org");
    assertEquals(DiagnosticSeverity.Error, problem.getSeverity());
    editor = harness.newEditor("applications:\n" + "- name: foo\n" + "  routes:\n" + "  - route: springsource.org:kuku\n");
    editor.assertProblems("springsource.org:kuku|is not a valid 'Route'");
    problem = editor.assertProblem("springsource.org:kuku");
    assertEquals(DiagnosticSeverity.Error, problem.getSeverity());
    editor = harness.newEditor("applications:\n" + "- name: foo\n" + "  routes:\n" + "  - route: springsource.org/kuku?p=23\n");
    editor.assertProblems("springsource.org/kuku?p=23|is not a valid 'Route'");
    problem = editor.assertProblem("springsource.org/kuku?p=23");
    assertEquals(DiagnosticSeverity.Error, problem.getSeverity());
    editor = harness.newEditor("applications:\n" + "- name: foo\n" + "  routes:\n" + "  - route: springsource.org:645788\n");
    editor.assertProblems("springsource.org:645788|is not a valid 'Route'");
    problem = editor.assertProblem("springsource.org:645788");
    assertEquals(DiagnosticSeverity.Error, problem.getSeverity());
}
Also used : Diagnostic(org.eclipse.lsp4j.Diagnostic) Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Aggregations

Diagnostic (org.eclipse.lsp4j.Diagnostic)56 Test (org.junit.Test)31 Editor (org.springframework.ide.vscode.languageserver.testharness.Editor)22 Range (org.eclipse.lsp4j.Range)13 ArrayList (java.util.ArrayList)12 PublishDiagnosticsParams (org.eclipse.lsp4j.PublishDiagnosticsParams)11 List (java.util.List)8 Position (org.eclipse.lsp4j.Position)8 DiagnosticSeverity (org.eclipse.lsp4j.DiagnosticSeverity)7 URI (java.net.URI)5 Path (java.nio.file.Path)5 Map (java.util.Map)5 AbstractProjectsManagerBasedTest (org.eclipse.jdt.ls.core.internal.managers.AbstractProjectsManagerBasedTest)5 Command (org.eclipse.lsp4j.Command)5 MarkedString (org.eclipse.lsp4j.MarkedString)5 CodeAction (org.springframework.ide.vscode.languageserver.testharness.CodeAction)5 IOException (java.io.IOException)4 Collections (java.util.Collections)4 HashMap (java.util.HashMap)4 ImmutableList (com.google.common.collect.ImmutableList)3