Search in sources :

Example 71 with Editor

use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.

the class ConcourseEditorTest method groupHovers.

@Test
public void groupHovers() throws Exception {
    Editor editor = harness.newEditor("groups:\n" + "- name: some-group\n" + "  resources: []\n" + "  jobs: []\n");
    editor.assertHoverContains("name", "The name of the group");
    editor.assertHoverContains("resources", "A list of resources that should appear in this group");
    editor.assertHoverContains("jobs", " A list of jobs that should appear in this group");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 72 with Editor

use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.

the class ConcourseEditorTest method relaxedContentAssistContextForListItem_not_indented.

@Test
public void relaxedContentAssistContextForListItem_not_indented() throws Exception {
    Editor editor;
    // Note: this is a tricky case because when <*> lines up with 'plan' it will not be considered
    // to be a child of 'plan' but a child of the 'job' instead.
    // However, for hypothetical '- ' completions we'd have to treat as a child of plan instead!
    editor = harness.newEditor("jobs:\n" + "- name: build-docker-image\n" + "  serial: true\n" + "  plan:\n" + "  - get: docker-git\n" + "    trigger: true\n" + "  <*>");
    editor.assertCompletionWithLabel("- put", "jobs:\n" + "- name: build-docker-image\n" + "  serial: true\n" + "  plan:\n" + "  - get: docker-git\n" + "    trigger: true\n" + "  - put: <*>");
    editor = harness.newEditor("jobs:\n" + "- name: build-docker-image\n" + "  serial: true\n" + "  plan:\n" + "  <*>");
    editor.assertCompletionWithLabel("- put", "jobs:\n" + "- name: build-docker-image\n" + "  serial: true\n" + "  plan:\n" + "  - put: <*>");
    editor = harness.newEditor("jobs:\n" + "- name: build-docker-image\n" + "  serial: true\n" + "  plan:\n" + "  pu<*>");
    editor.assertCompletionWithLabel("- put", "jobs:\n" + "- name: build-docker-image\n" + "  serial: true\n" + "  plan:\n" + "  - put: <*>");
    editor = harness.newEditor("jobs:\n" + "- name: build-docker-image\n" + "  serial: true\n" + "  plan:\n" + "  ag");
    editor.assertCompletionWithLabel("- aggregate", "jobs:\n" + "- name: build-docker-image\n" + "  serial: true\n" + "  plan:\n" + "  - aggregate:\n" + "    - <*>");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 73 with Editor

use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.

the class ConcourseEditorTest method githubCompletionErrors.

@Test
public void githubCompletionErrors() throws Exception {
    when(github.getReposForOwner("the-owner")).thenThrow(new IOException("Explain some stuff"));
    when(github.getOwners()).thenThrow(new IOException("Explain some stuff"));
    Editor editor = harness.newEditor("resources:\n" + "- name: my-repo\n" + "  type: git\n" + "  source:\n" + "    uri: git@github.com:the-owner/<*>");
    editor.assertCompletionLabels("Explain some stuff");
    editor.setText("resources:\n" + "- name: my-repo\n" + "  type: git\n" + "  source:\n" + "    uri: git@github.com:<*>");
    editor.assertCompletionLabels("Explain some stuff");
}
Also used : IOException(java.io.IOException) Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 74 with Editor

use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.

the class ConcourseEditorTest method reconcileMisSpelledPropertyNames.

@Test
public void reconcileMisSpelledPropertyNames() throws Exception {
    Editor editor;
    editor = harness.newEditor("resorces:\n" + "- name: git\n" + "  type: git\n");
    editor.assertProblems("resorces|Unknown property");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 75 with Editor

use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.

the class ConcourseEditorTest method resourceInEmbeddedTaskConfigDeprecated.

@Test
public void resourceInEmbeddedTaskConfigDeprecated() throws Exception {
    Editor editor = harness.newEditor("resources:\n" + "- name: my-docker-image\n" + "  type: docker-image\n" + "  source:\n" + "    username: {{docker_hub_username}}\n" + "    password: {{docker_hub_password}}\n" + "    repository: kdvolder/sts3-build-env\n" + "jobs:\n" + "- name: build-commons-update-site\n" + "  plan:\n" + "  - task: hello-world\n" + "    image: my-docker-image\n" + "    config:\n" + "      rootfs_uri: blah\n" + "      image_resource:\n" + "        type: docker-image\n" + "      inputs:\n" + "      - name: commons-git\n" + "      platform: linux\n" + "      run:\n" + "        path: which\n" + "        args:\n" + "        - mvn");
    List<Diagnostic> problems = editor.assertProblems("rootfs_uri|Deprecated", "image_resource|Deprecated");
    for (Diagnostic d : problems) {
        assertEquals(DiagnosticSeverity.Warning, d.getSeverity());
    }
}
Also used : Diagnostic(org.eclipse.lsp4j.Diagnostic) Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Aggregations

Editor (org.springframework.ide.vscode.languageserver.testharness.Editor)402 Test (org.junit.Test)385 AbstractPropsEditorTest (org.springframework.ide.vscode.boot.editor.harness.AbstractPropsEditorTest)81 LiveBeansModel (org.springframework.ide.vscode.commons.boot.app.cli.livebean.LiveBeansModel)29 File (java.io.File)27 IJavaProject (org.springframework.ide.vscode.commons.java.IJavaProject)24 Diagnostic (org.eclipse.lsp4j.Diagnostic)22 Ignore (org.junit.Ignore)15 CompletionItem (org.eclipse.lsp4j.CompletionItem)13 IOException (java.io.IOException)9 CFDomain (org.springframework.ide.vscode.commons.cloudfoundry.client.CFDomain)6 ClientRequests (org.springframework.ide.vscode.commons.cloudfoundry.client.ClientRequests)6 CodeAction (org.springframework.ide.vscode.languageserver.testharness.CodeAction)5 ReleaseData (org.springframework.ide.vscode.bosh.models.ReleaseData)4 CFServiceInstance (org.springframework.ide.vscode.commons.cloudfoundry.client.CFServiceInstance)4 DynamicModelProvider (org.springframework.ide.vscode.bosh.models.DynamicModelProvider)3 NoTargetsException (org.springframework.ide.vscode.commons.cloudfoundry.client.cftarget.NoTargetsException)3 InputStream (java.io.InputStream)2 TimeoutException (java.util.concurrent.TimeoutException)2 StemcellData (org.springframework.ide.vscode.bosh.models.StemcellData)2