use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method variablesBlockCompletions.
@Test
public void variablesBlockCompletions() throws Exception {
harness.getServerWrapper().enableSnippets(false);
Editor editor = harness.newEditor("variables:\n" + "- <*>");
editor.assertCompletions("variables:\n" + "- name: <*>");
editor = harness.newEditor("variables:\n" + "- name: foo\n" + " <*>");
editor.assertCompletions(PLAIN_COMPLETION, "variables:\n" + "- name: foo\n" + " options:\n" + " <*>", // ===============
"variables:\n" + "- name: foo\n" + " type: <*>");
editor = harness.newEditor("variables:\n" + "- name: foo\n" + " type: <*>");
editor.assertCompletionLabels("certificate", "password", "rsa", "ssh");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method missingPropertiesQuickfix.
@Test
public void missingPropertiesQuickfix() throws Exception {
Editor editor = harness.newEditor("name: blah\n" + "stemcells:\n" + "- alias: ubuntu\n" + " os: ubuntu-trusty\n" + " version: 3421.11\n" + "- alias: centos\n" + " os: centos-7\n" + " version: latest");
Diagnostic problem = editor.assertProblems("t|Properties [instance_groups, releases, update] are required").get(0);
CodeAction quickfix = editor.assertCodeAction(problem);
assertEquals("Add properties: [instance_groups, releases, update]", quickfix.getLabel());
quickfix.perform();
editor.assertText("name: blah\n" + "stemcells:\n" + "- alias: ubuntu\n" + " os: ubuntu-trusty\n" + " version: 3421.11\n" + "- alias: centos\n" + " os: centos-7\n" + " version: latest\n" + "releases:\n" + "- name: <*>\n" + " version: \n" + "update:\n" + " canaries: \n" + " max_in_flight: \n" + " canary_watch_time: \n" + " update_watch_time: \n" + "instance_groups:\n" + "- name: \n" + " azs:\n" + " - \n" + " instances: \n" + " jobs:\n" + " - name: \n" + " release: \n" + " vm_type: \n" + " stemcell: \n" + " networks:\n" + " - name: ");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method stemcellCompletions.
@Test
public void stemcellCompletions() throws Exception {
Editor editor = harness.newEditor("stemcells:\n" + "- <*>");
editor.assertCompletions(PLAIN_COMPLETION, "stemcells:\n" + "- alias: $1\n" + " version: $2<*>", // ==========
"stemcells:\n" + "- alias: <*>");
editor = harness.newEditor("stemcells:\n" + "- alias: blah\n" + " <*>");
editor.assertContextualCompletions(PLAIN_COMPLETION, "<*>", // =>
"name: <*>", "os: <*>", "version: <*>");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method contentAssistReleaseVersion.
@Test
public void contentAssistReleaseVersion() throws Exception {
releasesProvider = provideReleasesFrom(new ReleaseData("foo", "123.4"), new ReleaseData("foo", "222.2"), new ReleaseData("bar", "222.2"), new ReleaseData("bar", "333.3"));
Editor editor = harness.newEditor("releases:\n" + "- version: <*>");
editor.assertContextualCompletions("<*>", "123.4<*>", "222.2<*>", "333.3<*>", "latest<*>");
editor = harness.newEditor("releases:\n" + "- name: foo\n" + " version: <*>");
editor.assertContextualCompletions("<*>", "123.4<*>", "222.2<*>", "latest<*>");
// Still get all suggestions even when 'url' property is added
editor = harness.newEditor("releases:\n" + "- version: <*>\n" + " url: blah");
editor.assertContextualCompletions("<*>", "123.4<*>", "222.2<*>", "333.3<*>", "latest<*>");
editor = harness.newEditor("releases:\n" + "- name: foo\n" + " url: blah\n" + " version: <*>");
editor.assertContextualCompletions("<*>", "123.4<*>", "222.2<*>", "333.3<*>", "latest<*>");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method reconcileCfManifest.
@Test
public void reconcileCfManifest() throws Exception {
cloudConfigProvider.executeCommandWith(() -> {
throw new IOException("Couldn't contact the director");
});
Editor editor = harness.newEditorFromClasspath("/workspace/cf-deployment-manifest.yml");
editor.assertProblems();
}
Aggregations