use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method groupHovers.
@Test
public void groupHovers() throws Exception {
Editor editor = harness.newEditor("groups:\n" + "- name: some-group\n" + " resources: []\n" + " jobs: []\n");
editor.assertHoverContains("name", "The name of the group");
editor.assertHoverContains("resources", "A list of resources that should appear in this group");
editor.assertHoverContains("jobs", " A list of jobs that should appear in this group");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method relaxedContentAssistContextForListItem_not_indented.
@Test
public void relaxedContentAssistContextForListItem_not_indented() throws Exception {
Editor editor;
// Note: this is a tricky case because when <*> lines up with 'plan' it will not be considered
// to be a child of 'plan' but a child of the 'job' instead.
// However, for hypothetical '- ' completions we'd have to treat as a child of plan instead!
editor = harness.newEditor("jobs:\n" + "- name: build-docker-image\n" + " serial: true\n" + " plan:\n" + " - get: docker-git\n" + " trigger: true\n" + " <*>");
editor.assertCompletionWithLabel("- put", "jobs:\n" + "- name: build-docker-image\n" + " serial: true\n" + " plan:\n" + " - get: docker-git\n" + " trigger: true\n" + " - put: <*>");
editor = harness.newEditor("jobs:\n" + "- name: build-docker-image\n" + " serial: true\n" + " plan:\n" + " <*>");
editor.assertCompletionWithLabel("- put", "jobs:\n" + "- name: build-docker-image\n" + " serial: true\n" + " plan:\n" + " - put: <*>");
editor = harness.newEditor("jobs:\n" + "- name: build-docker-image\n" + " serial: true\n" + " plan:\n" + " pu<*>");
editor.assertCompletionWithLabel("- put", "jobs:\n" + "- name: build-docker-image\n" + " serial: true\n" + " plan:\n" + " - put: <*>");
editor = harness.newEditor("jobs:\n" + "- name: build-docker-image\n" + " serial: true\n" + " plan:\n" + " ag");
editor.assertCompletionWithLabel("- aggregate", "jobs:\n" + "- name: build-docker-image\n" + " serial: true\n" + " plan:\n" + " - aggregate:\n" + " - <*>");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method githubCompletionErrors.
@Test
public void githubCompletionErrors() throws Exception {
when(github.getReposForOwner("the-owner")).thenThrow(new IOException("Explain some stuff"));
when(github.getOwners()).thenThrow(new IOException("Explain some stuff"));
Editor editor = harness.newEditor("resources:\n" + "- name: my-repo\n" + " type: git\n" + " source:\n" + " uri: git@github.com:the-owner/<*>");
editor.assertCompletionLabels("Explain some stuff");
editor.setText("resources:\n" + "- name: my-repo\n" + " type: git\n" + " source:\n" + " uri: git@github.com:<*>");
editor.assertCompletionLabels("Explain some stuff");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method reconcileMisSpelledPropertyNames.
@Test
public void reconcileMisSpelledPropertyNames() throws Exception {
Editor editor;
editor = harness.newEditor("resorces:\n" + "- name: git\n" + " type: git\n");
editor.assertProblems("resorces|Unknown property");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method resourceInEmbeddedTaskConfigDeprecated.
@Test
public void resourceInEmbeddedTaskConfigDeprecated() throws Exception {
Editor editor = harness.newEditor("resources:\n" + "- name: my-docker-image\n" + " type: docker-image\n" + " source:\n" + " username: {{docker_hub_username}}\n" + " password: {{docker_hub_password}}\n" + " repository: kdvolder/sts3-build-env\n" + "jobs:\n" + "- name: build-commons-update-site\n" + " plan:\n" + " - task: hello-world\n" + " image: my-docker-image\n" + " config:\n" + " rootfs_uri: blah\n" + " image_resource:\n" + " type: docker-image\n" + " inputs:\n" + " - name: commons-git\n" + " platform: linux\n" + " run:\n" + " path: which\n" + " args:\n" + " - mvn");
List<Diagnostic> problems = editor.assertProblems("rootfs_uri|Deprecated", "image_resource|Deprecated");
for (Diagnostic d : problems) {
assertEquals(DiagnosticSeverity.Warning, d.getSeverity());
}
}
Aggregations