use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method emptyInputPathWarning.
@Test
public void emptyInputPathWarning() throws Exception {
Editor editor = harness.newEditor(LanguageId.CONCOURSE_TASK, "platform: linux\n" + "run:\n" + " path: blah\n" + "inputs:\n" + "- name: foo\n" + " path: \"\"\n" + "outputs:\n" + "- name: bar\n" + " path: \"\"\n");
List<Diagnostic> problems = editor.assertProblems("\"\"|Empty optional String attribute is useless and can be omitted", "\"\"|Empty optional String attribute is useless and can be omitted");
for (Diagnostic problem : problems) {
assertEquals(DiagnosticSeverity.Warning, problem.getSeverity());
}
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method s3ResourceGetParamsReconcileAndHovers.
@Test
public void s3ResourceGetParamsReconcileAndHovers() 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" + " - get: my-s3-bucket\n" + " params:\n" + " no-params-expected: bad");
editor.assertProblems("no-params-expected|Unknown property");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method cfResourceSourceHovers.
@Test
public void cfResourceSourceHovers() throws Exception {
Editor editor = harness.newEditor("resources:\n" + "- name: pws\n" + " type: cf\n" + " source:\n" + " api: {{cf_api}}\n" + " username: {{cf_user}}\n" + " password: {{cf_password}}\n" + " organization: {{cf_org}}\n" + " space: {{cf_space}}\n" + " skip_cert_check: true<*>");
editor.assertHoverContains("api", "address of the Cloud Controller");
editor.assertHoverContains("username", "username used to authenticate");
editor.assertHoverContains("password", "password used to authenticate");
editor.assertHoverContains("organization", "organization to push");
editor.assertHoverContains("space", "space to push");
editor.assertHoverContains("skip_cert_check", "Check the validity of the CF SSL cert");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method githubUriReconciling.
@Test
public void githubUriReconciling() throws Exception {
when(github.getReposForOwner("the-owner")).thenReturn(ImmutableList.of("nice-repo", "cool-project", "good-stuff"));
when(github.getReposForOwner("owner-no-exist")).thenReturn(null);
String editorText = "resources:\n" + "- name: my-repo\n" + " type: git\n" + " source:\n" + " uri: $$github$$the-owner/cool-project.git\n" + "- name: other-repo\n" + " type: git\n" + " source:\n" + " uri: $$github$$the-owner/repo-no-exist.git\n" + "- name: different-repo\n" + " type: git\n" + " source:\n" + " uri: $$github$$owner-no-exist/who-cares.git\n";
for (String githubUriPrefix : GithubRepoContentAssistant.URI_PREFIXES) {
Editor editor = harness.newEditor(editorText.replace("$$github$$", githubUriPrefix));
editor.ignoreProblem(PipelineYmlSchemaProblems.UNUSED_RESOURCE);
List<Diagnostic> problems = editor.assertProblems("repo-no-exist|Repo not found: 'repo-no-exist'", "owner-no-exist|User or Organization not found: 'owner-no-exist'");
for (Diagnostic d : problems) {
assertEquals(DiagnosticSeverity.Warning, d.getSeverity());
}
}
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class ConcourseEditorTest method gitResourceGetParamsReconcile.
@Test
public void gitResourceGetParamsReconcile() throws Exception {
Editor editor = harness.newEditor("resources:\n" + "- name: my-git\n" + " type: git\n" + "jobs:\n" + "- name: do-stuff\n" + " plan:\n" + " - get: my-git\n" + " params:\n" + " depth: -1\n" + " disable_git_lfs: not-bool\n");
editor.assertProblems("-1|must be positive", "not-bool|'boolean'");
}
Aggregations