use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method relaxedCALessSpaces.
@Test
public void relaxedCALessSpaces() throws Exception {
Editor editor;
editor = harness.newEditor("name: \n" + "variables:\n" + "- name: voo\n" + " type: aaa\n" + "<*>");
editor.assertContextualCompletions(DEDENTED_COMPLETION.and(SNIPPET_COMPLETION.negate()), " <*>", // ==>
"instance_groups:\n" + "- name: $1\n" + " azs:\n" + " - $2\n" + " instances: $3\n" + " jobs:\n" + " - name: $4\n" + " release: $5\n" + " vm_type: $6\n" + " stemcell: $7\n" + " networks:\n" + " - name: $8<*>", // ----
"releases:\n" + "- name: $1\n" + " version: $2<*>", // ----
"stemcells:\n" + "- alias: $1\n" + " version: $2<*>", // ---
"tags:\n" + " <*>", // ---
"update:\n" + " canaries: $1\n" + " max_in_flight: $2\n" + " canary_watch_time: $3\n" + " update_watch_time: $4<*>", // ---
"- name: <*>");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method keyCompletionThatNeedsANewline.
@Test
public void keyCompletionThatNeedsANewline() throws Exception {
Editor editor = harness.newEditor("name: foo\n" + "update: canwa<*>");
editor.assertCompletions("name: foo\n" + "update: \n" + " canary_watch_time: <*>");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method cloudconfig_compilation_subproperties.
@Test
public void cloudconfig_compilation_subproperties() throws Exception {
Editor editor = harness.newEditor(LanguageId.BOSH_CLOUD_CONFIG, "compilation:\n" + " <*>");
editor.assertContextualCompletions(PLAIN_COMPLETION.and(SNIPPET_COMPLETION.negate()), "<*>", "az: <*>", "network: <*>", "reuse_compilation_vms: <*>", "vm_type: <*>", "workers: <*>");
editor.assertContextualCompletions(PLAIN_COMPLETION.and(SNIPPET_COMPLETION), "<*>", // ==>
"workers: $1\n" + " az: $2\n" + " vm_type: $3\n" + " network: $4<*>");
editor = harness.newEditor(LanguageId.BOSH_CLOUD_CONFIG, "compilation:\n" + " workers: not-int\n" + " reuse_compilation_vms: not-bool\n" + " az: z1\n" + " vm_type: default\n" + " network: private\n");
editor.ignoreProblem(YamlSchemaProblems.MISSING_PROPERTY);
editor.assertProblems("not-int|NumberFormatException", "not-bool|unknown 'boolean'", "z1|unknown 'AZName'", "default|unknown 'VMTypeName'", "private|unknown 'NetworkName'");
editor.assertHoverContains("workers", "The maximum number of compilation VMs");
editor.assertHoverContains("reuse_compilation_vms", "If `false`, BOSH creates a new compilation VM");
editor.assertHoverContains("az", "Name of the AZ defined in AZs section");
editor.assertHoverContains("vm_type", "Name of the VM type defined in VM types section");
editor.assertHoverContains("network", "References a valid network name defined in the Networks block");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method contentAssistAZ.
@Test
public void contentAssistAZ() throws Exception {
Editor editor = harness.newEditor("name: my-first-deployment\n" + "instance_groups:\n" + "- name: my-server\n" + " azs:\n" + " - <*>");
editor.assertContextualCompletions("<*>", "z1<*>", "z2<*>", "z3<*>");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method releasesAdvancedValidations.
@Test
public void releasesAdvancedValidations() throws Exception {
Editor editor = harness.newEditor("releases:\n" + "- name: some-release\n" + " url: https://my.releases.com/funky.tar.gz\n" + "- name: other-relase\n" + " version: other-version\n" + " url: file:///root/releases/a-nice-file.tar.gz\n" + "- name: bad-url\n" + " version: more-version\n" + " url: proto://something.com\n" + "#x");
editor.assertProblems("^-^ name: some-release|'version' is required", "url|'sha1' is recommended when the 'url' is http(s)", "proto|Url scheme must be one of [http, https, file]", "x|are required");
Diagnostic missingSha1Problem = editor.assertProblem("url");
assertContains("'sha1' is recommended", missingSha1Problem.getMessage());
assertEquals(DiagnosticSeverity.Warning, missingSha1Problem.getSeverity());
}
Aggregations