Search in sources :

Example 86 with Editor

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

the class ConcourseEditorTest method reconcileResourceTypeType.

@Test
public void reconcileResourceTypeType() throws Exception {
    Editor editor;
    editor = harness.newEditor("resource_types:\n" + "- name: s3-multi\n" + "  type: # <- bad\n");
    editor.assertProblems("^ # <- bad|cannot be blank");
    editor = harness.newEditor("resource_types:\n" + "- name: s3-multi\n" + "  type: garbage\n");
    editor.assertProblems("garbage|Resource Type does not exist");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 87 with Editor

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

the class ConcourseEditorTest method getStepVersionShouldAcceptMap.

@Test
public void getStepVersionShouldAcceptMap() throws Exception {
    // See https://github.com/spring-projects/sts4/pull/24
    Editor editor = harness.newEditor("jobs:\n" + "- name: do-stuff\n" + "  plan:\n" + "  - get: cf-deployment-git\n" + "    version: { ref: ((cf_deployment_commit_ref)) }");
    editor.assertProblems("cf-deployment-git|resource does not exist");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 88 with Editor

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

the class ConcourseEditorTest method reconcileDuplicateJobNames.

@Test
public void reconcileDuplicateJobNames() throws Exception {
    Editor editor = harness.newEditor("jobs:\n" + "- name: job-1\n" + "- name: utils\n" + "- name: job-1\n");
    editor.assertProblems("-^ name: job-1|'plan' is required", "job-1|Duplicate job name", "-^ name: utils|'plan' is required", "-^ name: job-1|'plan' is required", "job-1|Duplicate job name");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 89 with Editor

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

the class ConcourseEditorTest method resourceTypeAttributeHovers.

@Test
public void resourceTypeAttributeHovers() 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");
    editor.assertHoverContains("name", "This name will be referenced by `resources` defined within the same pipeline");
    editor.assertHoverContains("type", 2, "used to provide the resource type's container image");
    editor.assertHoverContains("source", 2, "The location of the resource type's resource");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 90 with Editor

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

the class ConcourseEditorTest method gitResourcePutParamsHovers.

@Test
public void gitResourcePutParamsHovers() throws Exception {
    Editor editor = harness.newEditor("resources:\n" + "- name: my-git\n" + "  type: git\n" + "jobs:\n" + "- name: do-stuff\n" + "  plan:\n" + "  - put: my-git\n" + "    params:\n" + "      repository: some-other-repo\n" + "      rebase: do-rebase\n" + "      tag: the-tag-file\n" + "      only_tag: do-tag\n" + "      tag_prefix: RELEASE\n" + "      force: force-it\n" + "      annotate: release-annotion\n");
    editor.assertHoverContains("repository", "The path of the repository");
    editor.assertHoverContains("rebase", "attempt rebasing");
    editor.assertHoverContains("tag", "HEAD will be tagged");
    editor.assertHoverContains("only_tag", "push only the tags");
    editor.assertHoverContains("tag_prefix", "prepended with this string");
    editor.assertHoverContains("force", "pushed regardless of the upstream state");
    editor.assertHoverContains("annotate", "path to a file containing the annotation message");
}
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