use of org.springframework.ide.vscode.languageserver.testharness.LanguageServerHarness in project sts4 by spring-projects.
the class ManifestYamlEditorTest method reconcileRunsOnDocumentOpenAndChange.
@Test
public void reconcileRunsOnDocumentOpenAndChange() throws Exception {
LanguageServerHarness harness = new LanguageServerHarness(ManifestYamlLanguageServer::new, LanguageId.CF_MANIFEST);
harness.intialize(null);
Editor editor = harness.newEditor("somemap: val\n" + "- sequence");
editor.assertProblems("-|expected <block end>");
editor.setText("- sequence\n" + "zomemap: val");
editor.assertProblems("z|expected <block end>");
}
use of org.springframework.ide.vscode.languageserver.testharness.LanguageServerHarness in project sts4 by spring-projects.
the class ManifestYamlLanguageServerTest method changeCfClientParams.
@Test
public void changeCfClientParams() throws Exception {
MockCloudfoundry cloudfoundry = new MockCloudfoundry();
ManifestYamlLanguageServer manifestYamlLanguageServer = new ManifestYamlLanguageServer(cloudfoundry.factory, cloudfoundry.defaultParamsProvider);
LanguageServerHarness harness = new LanguageServerHarness(() -> manifestYamlLanguageServer, LanguageId.CF_MANIFEST);
harness.intialize(null);
assertEquals(1, manifestYamlLanguageServer.getCfClientConfig().getClientParamsProvider().getParams().size());
assertEquals(Arrays.asList("test.io"), manifestYamlLanguageServer.getCfTargets());
DidChangeConfigurationParams params = new DidChangeConfigurationParams();
JsonParser parser = new JsonParser();
params.setSettings(parser.parse(new InputStreamReader(getClass().getResourceAsStream("/cf-targets1.json"))));
manifestYamlLanguageServer.getWorkspaceService().didChangeConfiguration(params);
assertEquals(3, manifestYamlLanguageServer.getCfClientConfig().getClientParamsProvider().getParams().size());
assertEquals(Arrays.asList("test.io", "api.system.demo-gcp.springapps.io", "api.run.pivotal.io"), manifestYamlLanguageServer.getCfTargets());
}
use of org.springframework.ide.vscode.languageserver.testharness.LanguageServerHarness in project sts4 by spring-projects.
the class ManifestYamlLanguageServerTest method createAndInitializeServerWithWorkspace.
@Test
public void createAndInitializeServerWithWorkspace() throws Exception {
LanguageServerHarness harness = new LanguageServerHarness(ManifestYamlLanguageServer::new);
File workspaceRoot = getTestResource("/workspace/");
assertExpectedInitResult(harness.intialize(workspaceRoot));
}
use of org.springframework.ide.vscode.languageserver.testharness.LanguageServerHarness in project sts4 by spring-projects.
the class ConcourseLanguageServerTest method createAndInitializeServerWithoutWorkspace.
@Test
public void createAndInitializeServerWithoutWorkspace() throws Exception {
File workspaceRoot = null;
LanguageServerHarness harness = new LanguageServerHarness(() -> new ConcourseLanguageServer(TEST_DEFAULT, Mockito.mock(GithubInfoProvider.class)));
assertExpectedInitResult(harness.intialize(workspaceRoot));
}
use of org.springframework.ide.vscode.languageserver.testharness.LanguageServerHarness in project sts4 by spring-projects.
the class ConcourseLanguageServerTest method createAndInitializeServerWithWorkspace.
@Test
public void createAndInitializeServerWithWorkspace() throws Exception {
LanguageServerHarness harness = new LanguageServerHarness(() -> new ConcourseLanguageServer(TEST_DEFAULT, Mockito.mock(GithubInfoProvider.class)));
File workspaceRoot = getTestResource("/workspace/");
assertExpectedInitResult(harness.intialize(workspaceRoot));
}
Aggregations