use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class ApplicationPropertiesEditorTest method testEnumsInLowerCaseContentAssist.
@Test
public void testEnumsInLowerCaseContentAssist() throws Exception {
IJavaProject p = createPredefinedMavenProject("enums-boot-1.3.2-app");
useProject(p);
assertNotNull(p.getClasspath().findType("demo.ClothingSize"));
data("simple.pants.size", "demo.ClothingSize", null, "The simple pant's size");
assertCompletionsVariations("simple.pants.size=S<*>", "simple.pants.size=SMALL<*>", "simple.pants.size=EXTRA_SMALL<*>");
assertCompletionsVariations("simple.pants.size=s<*>", "simple.pants.size=small<*>", "simple.pants.size=extra-small<*>");
assertCompletionsVariations("simple.pants.size=ex<*>", "simple.pants.size=extra-large<*>", "simple.pants.size=extra-small<*>");
assertCompletionsVariations("simple.pants.size=EX<*>", "simple.pants.size=EXTRA_LARGE<*>", "simple.pants.size=EXTRA_SMALL<*>");
assertCompletionsDisplayString("foo.color=<*>", "red", "green", "blue");
assertCompletionsVariations("foo.color-data.R<*>", "foo.color-data.RED.<*>", "foo.color-data.GREEN.<*>");
assertCompletionsVariations("foo.color-data.r<*>", "foo.color-data.red.<*>", "foo.color-data.green.<*>");
assertCompletionsVariations("foo.color-data.<*>", "foo.color-data.blue.<*>", "foo.color-data.green.<*>", "foo.color-data.red.<*>");
assertCompletionsVariations("foo.color-data.red.na<*>", "foo.color-data.red.name=<*>");
}
use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class ApplicationYamlEditorTest method testReconcileBeanPropName.
@Test
public void testReconcileBeanPropName() throws Exception {
IJavaProject p = createPredefinedMavenProject("boot-1.2.1-app-properties-list-of-pojo");
useProject(p);
assertNotNull(p.getClasspath().findType("demo.Foo"));
data("some-foo", "demo.Foo", null, "some Foo pojo property");
Editor editor = newEditor("some-foo:\n" + " name: Good\n" + " bogus: Bad\n" + " ? - a\n" + " - b\n" + " : Weird\n");
editor.assertProblems("bogus|Unknown property 'bogus' for type 'demo.Foo'", "- a\n - b|Expecting a bean-property name for object of type 'demo.Foo' " + "but got a 'Sequence' node");
}
use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class ApplicationYamlEditorTest method testDeprecatedBeanPropertyHoverInfo.
@Ignore
@Test
public void testDeprecatedBeanPropertyHoverInfo() throws Exception {
IJavaProject jp = createPredefinedMavenProject("tricky-getters-boot-1.3.1-app");
useProject(jp);
data("foo", "demo.Deprecater", null, "A bean with deprecated property.");
Editor editor = newEditor("# a comment\n" + "foo:\n" + " name: foo\n");
editor.assertHoverContains("name", "<b>Deprecated!</b>");
}
use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class ApplicationYamlEditorTest method testDeprecatedBeanPropertyCompletions.
@Ignore
@Test
public void testDeprecatedBeanPropertyCompletions() throws Exception {
IJavaProject jp = createPredefinedMavenProject("tricky-getters-boot-1.3.1-app");
useProject(jp);
data("foo", "demo.Deprecater", null, "A Bean with deprecated properties");
assertStyledCompletions("foo:\n" + " nam<*>", // =>
StyledStringMatcher.plainFont("new-name : String"), StyledStringMatcher.strikeout("name"), StyledStringMatcher.strikeout("alt-name"));
}
use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class ApplicationYamlEditorTest method testHoverInfoForEnumValueInMapKeyCompletion.
@Test
public void testHoverInfoForEnumValueInMapKeyCompletion() throws Exception {
IJavaProject project = createPredefinedMavenProject("empty-boot-1.3.0-app");
useProject(project);
// This test will fail if source jars haven't been downloaded.
// Probably that is why it fails in CI build?
// Let's check:
// IType type = project.findType("com.fasterxml.jackson.databind.SerializationFeature");
// System.out.println(">>> source for: "+type.getFullyQualifiedName());
// System.out.println(downloadSources(type));
// System.out.println("<<< source for: "+type.getFullyQualifiedName());
assertCompletionDetails("spring:\n" + " jackson:\n" + " serialization:\n" + " ind<*>", // ==========
"indent-output", // ==>
"boolean", "allows enabling (or disabling) indentation");
}
Aggregations