Add a regression test for '.yaml'.

Checks that boot language server accepts '.yaml' as equivalent
to '.yml' for reconcile, completions and hovers.
This commit is contained in:
Kris De Volder
2019-01-31 16:02:43 -08:00
parent 2a83e31172
commit 306d116681
4 changed files with 52 additions and 9 deletions

View File

@@ -112,7 +112,7 @@ public class CompilationUnitCacheTest {
harness.useProject(ProjectsHarness.dummyProject());
harness.intialize(null);
TextDocument doc = new TextDocument(harness.createTempUri(), LanguageId.JAVA, 0, "package my.package\n" +
TextDocument doc = new TextDocument(harness.createTempUri(null), LanguageId.JAVA, 0, "package my.package\n" +
"\n" +
"public class SomeClass {\n" +
"\n" +
@@ -128,7 +128,7 @@ public class CompilationUnitCacheTest {
public void cu_not_generated_without_project() throws Exception {
harness.intialize(null);
TextDocument doc = new TextDocument(harness.createTempUri(), LanguageId.JAVA, 0, "package my.package\n" +
TextDocument doc = new TextDocument(harness.createTempUri(null), LanguageId.JAVA, 0, "package my.package\n" +
"\n" +
"public class SomeClass {\n" +
"\n" +
@@ -147,7 +147,7 @@ public class CompilationUnitCacheTest {
harness.useProject(ProjectsHarness.dummyProject());
harness.intialize(null);
TextDocument doc = new TextDocument(harness.createTempUri(), LanguageId.JAVA, 0, "package my.package\n" +
TextDocument doc = new TextDocument(harness.createTempUri(null), LanguageId.JAVA, 0, "package my.package\n" +
"\n" +
"public class SomeClass {\n" +
"\n" +
@@ -171,7 +171,7 @@ public class CompilationUnitCacheTest {
harness.useProject(ProjectsHarness.dummyProject());
harness.intialize(null);
TextDocument doc = new TextDocument(harness.createTempUri(), LanguageId.JAVA, 0, "package my.package\n" +
TextDocument doc = new TextDocument(harness.createTempUri(null), LanguageId.JAVA, 0, "package my.package\n" +
"\n" +
"public class SomeClass {\n" +
"\n" +

View File

@@ -3253,6 +3253,36 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
);
}
@Test public void testYamlExtensionAccepted() throws Exception {
data("server.port", "java.lang.Integer", null, "Port of server");
Editor editor;
// Hovers
editor = harness.newEditorWithExt(LanguageId.BOOT_PROPERTIES_YAML, ".yaml",
"server:\n" +
" port: blah"
);
editor.assertHoverContains("port", "Port of server");
//Reconcile
editor = harness.newEditorWithExt(LanguageId.BOOT_PROPERTIES_YAML, ".yaml",
"server:\n" +
" porter: blah"
);
editor.assertProblems("porter|Unknown");
//Completions
editor = harness.newEditorWithExt(LanguageId.BOOT_PROPERTIES_YAML, ".yaml",
"server:\n" +
" p<*>"
);
editor.assertCompletionLabels("server.port");
}
@Test public void testPropertyMapKeyCompletions() throws Exception {
useProject(createPredefinedMavenProject("empty-boot-1.3.0-app"));
assertCompletionWithLabel(