use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method noListIndent.
@Test
public void noListIndent() throws Exception {
Editor editor;
editor = harness.newEditor("jo<*>");
editor.assertCompletions("jobs:\n" + "- name: $1\n" + " plan:\n" + " - $2<*>");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method reconcilerJobFromPassedAttributeMustInteractWithResource.
@Test
public void reconcilerJobFromPassedAttributeMustInteractWithResource() throws Exception {
Editor editor;
editor = harness.newEditor("resources:\n" + "- name: version\n" + " type: semver\n" + "- name: source-repo\n" + " type: git\n" + "jobs:\n" + "- name: build-it\n" + " plan:\n" + " - aggregate:\n" + " # - put: version\n" + " - get: source-repo\n" + "- name: test-it\n" + " plan:\n" + " - get: source-repo\n" + " passed:\n" + " - build-it # <- good\n" + " - get: version\n" + " passed:\n" + " - build-it # <- bad\n");
editor.assertProblems("build-it^ # <- bad|Job 'build-it' does not interact with resource 'version'");
editor = harness.newEditor("resources:\n" + "- name: version\n" + " type: semver\n" + "- name: source-repo\n" + " type: git\n" + "jobs:\n" + "- name: build-it\n" + " plan:\n" + " - aggregate:\n" + " - put: version\n" + " # - get: source-repo\n" + "- name: test-it\n" + " plan:\n" + " - get: source-repo\n" + " passed:\n" + " - build-it # <- bad\n" + " - get: version\n" + " passed:\n" + " - build-it # <- good\n");
editor.assertProblems("build-it^ # <- bad|Job 'build-it' does not interact with resource 'source-repo'");
// Check that we find interactions in steps that are at the top-level of the plan:
editor = harness.newEditor("resources:\n" + "- name: version\n" + " type: semver\n" + "- name: source-repo\n" + " type: git\n" + "jobs:\n" + "- name: build-it\n" + " plan:\n" + " - aggregate:\n" + " - put: version\n" + " - get: source-repo\n" + "- name: test-it\n" + " plan:\n" + " - get: source-repo\n" + " passed:\n" + " - build-it\n" + " - get: version\n" + " passed:\n" + " - build-it\n");
editor.assertProblems();
// Check that we find interactions in steps that are nested in other steps
editor = harness.newEditor("resources:\n" + "- name: version\n" + " type: semver\n" + "- name: source-repo\n" + " type: git\n" + "jobs:\n" + "- name: build-it\n" + " plan:\n" + " - put: version\n" + " - get: source-repo\n" + "- name: test-it\n" + " plan:\n" + " - get: source-repo\n" + " passed:\n" + " - build-it\n" + " - get: version\n" + " passed:\n" + " - build-it\n");
editor.assertProblems();
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method s3ResourcePutParamsReconcileAndHovers.
@Test
public void s3ResourcePutParamsReconcileAndHovers() throws Exception {
Editor editor;
editor = harness.newEditor("resources:\n" + "- name: my-s3-bucket\n" + " type: s3\n" + "jobs:\n" + "- name: a-job\n" + " plan:\n" + " - put: my-s3-bucket\n" + " params:\n" + " acl: public-read\n" + " get_params:\n" + " no-params-expected: bad");
editor.assertProblems("params|'file' is required", "no-params-expected|Unknown property");
editor = harness.newEditor("resources:\n" + "- name: my-s3-bucket\n" + " type: s3\n" + "jobs:\n" + "- name: a-job\n" + " plan:\n" + " - put: my-s3-bucket\n" + " params:\n" + " file: path/to/file\n" + " acl: bad-acl\n" + " content_type: anything/goes\n");
editor.assertProblems("bad-acl|unknown 'S3CannedAcl'");
editor.assertHoverContains("file", "Path to the file to upload");
editor.assertHoverContains("acl", "Canned Acl");
editor.assertHoverContains("content_type", "MIME");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method taskCachesHovers.
@Test
public void taskCachesHovers() throws Exception {
Editor editor = harness.newEditor(LanguageId.CONCOURSE_TASK, "platform: linux\n" + "\n" + "inputs:\n" + "- name: project-src\n" + "\n" + "caches:\n" + "- path: project-src/node_modules\n" + " junk: bad\n" + "\n" + "run:\n" + " path: project-src/ci/build");
editor.assertHoverContains("caches", "Caches are scoped to the worker the task is run on");
editor.assertHoverContains("path", "The path to a directory to be cached");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method gotoSymbolInPipeline.
@Test
public void gotoSymbolInPipeline() throws Exception {
Editor editor = harness.newEditor("resource_types:\n" + "- name: some-resource-type\n" + "resources:\n" + "- name: foo-resource\n" + "- name: bar-resource\n" + "jobs:\n" + "- name: do-some-stuff\n" + "- name: do-more-stuff\n" + "groups:\n" + "- name: group-one\n" + "- name: group-two\n");
editor.assertDocumentSymbols("some-resource-type|ResourceType", "foo-resource|Resource", "bar-resource|Resource", "do-some-stuff|Job", "do-more-stuff|Job", "group-one|Group", "group-two|Group");
}
Aggregations