use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method reconcileStemcellVersionNoDirector.
@SuppressWarnings("unchecked")
@Test
public void reconcileStemcellVersionNoDirector() throws Exception {
Editor editor;
stemcellsProvider = mock(DynamicModelProvider.class);
when(stemcellsProvider.getModel(any())).thenThrow(new IOException("Couldn't connect to bosh"));
editor = harness.newEditor("stemcells:\n" + "- alias: aaa\n" + " name: centos-agent\n" + " version: 222.2\n" + "- alias: bbb\n" + " name: centos-agent\n" + " version: 123.4\n" + "- alias: ddd\n" + " os: ubuntu\n" + " version: 333.3\n" + "- alias: eee\n" + " os: ubuntu\n" + " version: latest\n");
editor.ignoreProblem(YamlSchemaProblems.MISSING_PROPERTY);
editor.assertProblems();
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method reconcileReleaseNameDef.
@Test
public void reconcileReleaseNameDef() 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" + "- name: foo\n" + "- name: bar\n" + "- name: bogus\n" + "- name: url-makes-this-ok\n" + " url: file://blah");
editor.ignoreProblem(YamlSchemaProblems.MISSING_PROPERTY);
editor.assertProblems("bogus|unknown 'ReleaseName'. Valid values are: [foo, bar]");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method cloudconfig_azs.
@Test
public void cloudconfig_azs() throws Exception {
Editor editor = harness.newEditor(LanguageId.BOSH_CLOUD_CONFIG, "azs:\n" + "- <*>");
editor.assertContextualCompletions("<*>", "name: <*>");
editor = harness.newEditor(LanguageId.BOSH_CLOUD_CONFIG, "azs:\n" + "- name: the-zone\n" + " <*>");
editor.assertContextualCompletions(PLAIN_COMPLETION, "<*>", "cloud_properties:\n" + " <*>");
editor = harness.newEditor(LanguageId.BOSH_CLOUD_CONFIG, "azs:\n" + "- name: the-zone\n" + " cloud_properties: {}\n");
editor.assertHoverContains("name", "Name of an AZ within the Director");
editor.assertHoverContains("cloud_properties", "Describes any IaaS-specific properties needed to associated with AZ");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method cloudconfig_dynamic_network_hovers.
@Test
public void cloudconfig_dynamic_network_hovers() throws Exception {
Editor editor = harness.newEditor(LanguageId.BOSH_CLOUD_CONFIG, "networks:\n" + "- name: foo\n" + " type: dynamic\n" + " dns: []\n" + " cloud_properties: {}\n");
editor.assertHoverContains("name", "Name used to reference this network configuration");
editor.assertHoverContains("type", "The type of configuration");
editor.assertHoverContains("dns", "DNS IP addresses for this network");
editor.assertHoverContains("cloud_properties", "Describes any IaaS-specific properties for the network");
editor = harness.newEditor(LanguageId.BOSH_CLOUD_CONFIG, "networks:\n" + "- name: my-network\n" + " type: dynamic\n" + " subnets:\n" + " - az: z1\n" + " dns: []\n" + " cloud_properties: {subnet: subnet-9be6c3f7}\n" + " - azs: [z2, z3]\n" + " cloud_properties: {subnet: subnet-9be6c384}");
editor.assertHoverContains("name", "Name used to reference this network configuration");
editor.assertHoverContains("type", "The type of configuration");
editor.assertHoverContains("subnets", "Lists subnets in this network");
editor.assertHoverContains("dns", "DNS IP addresses for this subnet");
editor.assertHoverContains("az", "AZ associated with this subnet");
editor.assertHoverContains("cloud_properties", "Describes any IaaS-specific properties for the subnet");
editor.assertHoverContains("azs", "List of AZs associated with this subnet");
}
use of org.springframework.ide.vscode.languageserver.testharness.Editor in project sts4 by spring-projects.
the class BoshEditorTest method dynamicStemcellOssFromDirector.
@Test
public void dynamicStemcellOssFromDirector() throws Exception {
StemcellsModel stemcellsModel = mock(StemcellsModel.class);
when(stemcellsProvider.getModel(any())).thenReturn(stemcellsModel);
when(stemcellsModel.getStemcellOss()).thenReturn(ImmutableSet.of("ubuntu", "centos"));
// content assist
Editor editor = harness.newEditor("stemcells:\n" + "- os: <*>");
editor.assertContextualCompletions("<*>", "centos<*>", "ubuntu<*>");
// reconcile
editor = harness.newEditor("stemcells:\n" + "- alias: good\n" + " os: ubuntu\n" + "- alias: not-so-good\n" + " os: bogus<*>");
editor.ignoreProblem(YamlSchemaProblems.MISSING_PROPERTY);
editor.assertProblems("bogus|unknown 'StemcellOs'. Valid values are: [ubuntu, centos]");
}
Aggregations