Search in sources :

Example 56 with Editor

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

the class ConcourseEditorTest method gotoResourceTypeDefinition.

@Test
public void gotoResourceTypeDefinition() throws Exception {
    Editor editor = harness.newEditor("resource_types:\n" + "- name: slack-notification\n" + "  type: docker-image\n" + "resources:\n" + "- name: zazazee\n" + "  type: slack-notification\n");
    editor.assertGotoDefinition(editor.positionOf("type: slack-notification", "slack-notification"), editor.rangeOf("- name: slack-notification", "slack-notification"));
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 57 with Editor

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

the class ConcourseEditorTest method noAutoInsertRequiredSourcePropertiesIfPresent.

@Test
public void noAutoInsertRequiredSourcePropertiesIfPresent() throws Exception {
    Editor editor;
    // Most common case
    editor = harness.newEditor("resources:\n" + "- name: source-repo\n" + "  type: <*>\n" + "  source:");
    editor.assertCompletionWithLabel((l) -> l.startsWith("pool"), "resources:\n" + "- name: source-repo\n" + "  type: pool<*>\n" + "  source:");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 58 with Editor

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

the class ConcourseEditorTest method timeResourceSourceReconcile.

@Test
public void timeResourceSourceReconcile() throws Exception {
    Editor editor;
    editor = harness.newEditor("resources:\n" + "- name: every5minutes\n" + "  type: time\n" + "  source:\n" + "    location: PST8PDT\n" + "    start: 7AM\n" + "    stop: 8AM\n" + "    interval: 5m\n" + "    days:\n" + "    - Thursday\n");
    editor.assertProblems("every5minutes|Unused");
    editor = harness.newEditor("resources:\n" + "- name: every5minutes\n" + "  type: time\n" + "  source:\n" + "    location: some-location\n" + "    start: the-start-time\n" + "    stop: the-stop-time\n" + "    interval: the-interval\n" + "    days:\n" + "    - Monday\n" + "    - Someday\n");
    editor.assertProblems("every5minutes|Unused", "some-location|Unknown 'Location'", "the-start-time|not a valid 'Time'", "the-stop-time|not a valid 'Time'", "the-interval|not a valid 'Duration'", "Someday|unknown 'Day'");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 59 with Editor

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

the class ConcourseEditorTest method relaxedContentAssistContextForListItem_sameLine.

@Test
public void relaxedContentAssistContextForListItem_sameLine() throws Exception {
    Editor editor;
    editor = harness.newEditor("jobs:\n" + "- name: build-docker-image\n" + "  plan: <*>\n");
    editor.assertCompletionWithLabel("- put", "jobs:\n" + "- name: build-docker-image\n" + "  plan: \n" + "  - put: <*>\n");
    editor = harness.newEditor("jobs:\n" + "- name: build-docker-image\n" + "  plan: pu<*>\n");
    editor.assertCompletionWithLabel("- put", "jobs:\n" + "- name: build-docker-image\n" + "  plan: \n" + "  - put: <*>\n");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 60 with Editor

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

the class ConcourseEditorTest method bug_152918825_no_reconciling_for_double_parens_placeholders.

@Test
public void bug_152918825_no_reconciling_for_double_parens_placeholders() throws Exception {
    // https://www.pivotaltracker.com/story/show/152918825
    Editor editor = harness.newEditor("resources:\n" + "- name: image-XXX\n" + "  type: docker-image\n" + "  source:\n" + "    repository: ((DOCKER_IMAGE))\n" + "    insecure_registries: ((DOCKER_INSECURE_REGISTRIES))\n" + "    tag: latest");
    editor.assertProblems("image-XXX|Unused 'Resource'");
}
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