Use primary properties in a few places in bosh manifest schema

This commit is contained in:
Kris De Volder
2017-07-11 12:07:09 -07:00
parent 10519b4694
commit ac0230689b
7 changed files with 95 additions and 51 deletions

View File

@@ -54,7 +54,7 @@ public class BoshDeploymentManifestSchema implements YamlSchema {
TYPE_UTIL = f.TYPE_UTIL;
TOPLEVEL_TYPE = f.ybean("BoshDeploymentManifest");
addProp(TOPLEVEL_TYPE, "name", t_ne_string).isRequired(true);
addProp(TOPLEVEL_TYPE, "name", t_ne_string).isPrimary(true);
addProp(TOPLEVEL_TYPE, "director_uuid", t_uuid)
.isRequired(true);
@@ -63,7 +63,7 @@ public class BoshDeploymentManifestSchema implements YamlSchema {
t_version.parseWith(ValueParsers.NE_STRING);
YBeanType t_release = f.ybean("Release");
addProp(t_release, "name", t_ne_string).isRequired(true);
addProp(t_release, "name", t_ne_string).isPrimary(true);
addProp(t_release, "version", t_version).isRequired(true);
addProp(TOPLEVEL_TYPE, "releases", f.yseq(t_release)).isRequired(true);

View File

@@ -18,6 +18,8 @@ import org.springframework.ide.vscode.commons.yaml.reconcile.YamlSchemaProblems;
import org.springframework.ide.vscode.languageserver.testharness.Editor;
import org.springframework.ide.vscode.languageserver.testharness.LanguageServerHarness;
import static org.springframework.ide.vscode.languageserver.testharness.Editor.*;
public class BoshEditorTest {
LanguageServerHarness harness;
@@ -116,14 +118,37 @@ public class BoshEditorTest {
"<*>"
);
editor.assertCompletions(
"director_uuid: <*>",
"instance_groups:\n- <*>",
"name: <*>",
"releases:\n- <*>",
"stemcells:\n- <*>",
"tags:\n <*>",
"update:\n <*>",
"variables:\n- <*>",
"name: <*>"
);
editor = harness.newEditor(
"name: blah\n" +
"<*>"
);
editor.assertCompletions(
"name: blah\n" +
"director_uuid: <*>"
, // ============
"name: blah\n" +
"instance_groups:\n- <*>"
, // ============
"name: blah\n" +
"releases:\n- <*>"
, // ============
"name: blah\n" +
"stemcells:\n- <*>"
, // ============
"name: blah\n" +
"tags:\n <*>"
, // ============
"name: blah\n" +
"update:\n <*>"
, // ============
"name: blah\n" +
"variables:\n- <*>"
, // ============
"name: blah\n" +
"properties:\n <*>"
);
}
@@ -174,9 +199,17 @@ public class BoshEditorTest {
editor.assertCompletions(
"releases:\n" +
"- name: <*>"
, //========
"releases:\n" +
"- version: <*>"
);
editor = harness.newEditor(
"releases:\n" +
"- name: foo\n" +
" <*>"
);
editor.assertCompletions(PLAIN_COMPLETION,
"releases:\n" +
"- name: foo\n" +
" version: <*>"
);
}
@@ -203,4 +236,12 @@ public class BoshEditorTest {
editor.assertCompletionLabels("latest");
}
@Test public void instanceGroupsCompletions() throws Exception {
Editor editor = harness.newEditor(
"instance_groups:\n" +
"- <*>"
);
}
}