Search in sources :

Example 96 with Editor

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

the class ConcourseEditorTest method gitResourceGetParamsHovers.

@Test
public void gitResourceGetParamsHovers() throws Exception {
    Editor editor = harness.newEditor("resources:\n" + "- name: my-git\n" + "  type: git\n" + "jobs:\n" + "- name: do-stuff\n" + "  plan:\n" + "  - get: my-git\n" + "    params:\n" + "      depth: -1\n" + "      disable_git_lfs: not-bool\n" + "      submodules: none");
    editor.assertHoverContains("depth", "using the `--depth` option");
    editor.assertHoverContains("submodules", "If `none`, submodules will not be fetched");
    editor.assertHoverContains("disable_git_lfs", "will not fetch Git LFS files");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 97 with Editor

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

the class ConcourseEditorTest method reconcileSimpleTypes.

@Test
public void reconcileSimpleTypes() throws Exception {
    Editor editor;
    // check for 'format' errors:
    editor = harness.newEditor("jobs:\n" + "- name: foo\n" + "  serial: boohoo\n" + "  max_in_flight: -1\n" + "  plan:\n" + "  - get: git\n" + "    trigger: yohoho\n" + "    attempts: 0\n" + "    timeout: 1h:30m\n");
    editor.assertProblems("boohoo|boolean", "-1|must be positive", "git|resource does not exist", "yohoho|boolean", "0|must be at least 1", "1h:30m|Duration");
    // check that correct values are indeed accepted
    editor = harness.newEditor("resources:\n" + "- name: git\n" + "  type: git\n" + "jobs:\n" + "- name: foo\n" + "  serial: true\n" + "  max_in_flight: 2\n" + "  plan:\n" + "  - get: git\n" + "    trigger: true");
    editor.assertProblems();
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 98 with Editor

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

the class ConcourseEditorTest method taskCachesCompletions.

@Test
public void taskCachesCompletions() throws Exception {
    // See: https://www.pivotaltracker.com/story/show/153861788
    Editor editor = harness.newEditor(LanguageId.CONCOURSE_TASK, "platform: linux\n" + "\n" + "inputs:\n" + "- name: project-src\n" + "\n" + "caches:\n" + "- <*>\n" + "run:\n" + "  path: project-src/ci/build");
    editor.assertContextualCompletions(PLAIN_COMPLETION, "<*>", "path: <*>");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 99 with Editor

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

the class ConcourseEditorTest method githubCompletionsUriTypes.

@Test
public void githubCompletionsUriTypes() throws Exception {
    Editor editor = harness.newEditor("resources:\n" + "- name: my-repo\n" + "  type: git\n" + "  source:\n" + "    uri: <*>");
    editor.assertContextualCompletions("<*>", "git@github.com:<*>", "https://github.com/<*>");
    editor.assertContextualCompletions("@<*>", "git@github.com:<*>");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 100 with Editor

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

the class ConcourseEditorTest method topLevelHoverInfos.

@Test
public void topLevelHoverInfos() throws Exception {
    Editor editor = harness.newEditor("resource_types:\n" + "- name: s3-multi\n" + "  type: docker-image\n" + "  source:\n" + "    repository: kdvolder/s3-resource-simple\n" + "resources:\n" + "- name: docker-git\n" + "  type: git\n" + "  source:\n" + "    uri: git@github.com:spring-projects/sts4.git\n" + "    branch: {{branch}}\n" + "    username: kdvolder\n" + "    private_key: {{rsa_id}}\n" + "    paths:\n" + "    - concourse/docker\n" + "jobs:\n" + "- name: build-docker-image\n" + "  serial: true\n" + "  plan:\n" + "  - get: docker-git\n" + "    trigger: true\n" + "  - put: docker-image\n" + "    params:\n" + "      build: docker-git/concourse/docker\n" + "    get_params: \n" + "      skip_download: true\n" + "groups:\n" + "- name: a-groups\n");
    editor.assertHoverContains("resource_types", "each pipeline can configure its own custom types by specifying `resource_types` at the top level.");
    editor.assertHoverContains("resources", "A resource is any entity that can be checked for new versions");
    editor.assertHoverContains("jobs", "At a high level, a job describes some actions to perform");
    editor.assertHoverContains("groups", "A pipeline may optionally contain a section called `groups`");
}
Also used : 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