use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class ApplicationPropertiesEditorTest method testNavigationProposalAfterRelaxedPropertyName.
@Test
public void testNavigationProposalAfterRelaxedPropertyName() throws Exception {
IJavaProject p = createPredefinedMavenProject("enums-boot-1.3.2-app");
useProject(p);
assertCompletionsVariations("foo.colorData.b<*>", "foo.colorData.blue.<*>");
assertCompletionsVariations("foo.colorData.red.na<*>", "foo.colorData.red.name=<*>");
}
use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class ApplicationPropertiesEditorTest method testEnumPropertyReconciling.
@Test
public void testEnumPropertyReconciling() throws Exception {
IJavaProject p = createPredefinedMavenProject("enums-boot-1.3.2-app");
useProject(p);
assertNotNull(p.getClasspath().findType("demo.Color"));
data("foo.color", "demo.Color", null, "A foonky colour");
Editor editor = newEditor("foo.color=BLUE\n" + "foo.color=RED\n" + "foo.color=GREEN\n" + "foo.color.bad=BLUE\n" + "foo.color=Bogus\n");
// ignore deliberate abuse of dups
editor.ignoreProblem(PROP_DUPLICATE_KEY);
editor.assertProblems(".bad|Can't use '.' navigation", "Bogus|Color");
}
use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class ApplicationPropertiesEditorTest method testEnumMapKeyCompletion.
@Test
public void testEnumMapKeyCompletion() throws Exception {
IJavaProject p = createPredefinedMavenProject("enums-boot-1.3.2-app");
useProject(p);
data("foo.color-names", "java.util.Map<demo.Color,java.lang.String>", null, "Map with colors in its keys");
data("foo.color-data", "java.util.Map<demo.Color,demo.ColorData>", null, "Map with colors in its keys, and pojo in values");
assertNotNull(p.getClasspath().findType("demo.Color"));
assertNotNull(p.getClasspath().findType("demo.ColorData"));
// Map Enum -> String:
assertCompletionsVariations("foo.colnam<*>", "foo.color-names.<*>");
assertCompletionsVariations("foo.color-names.<*>", "foo.color-names.blue=<*>", "foo.color-names.green=<*>", "foo.color-names.red=<*>");
assertCompletionsDisplayStringAndDetail("foo.color-names.<*>", new String[] { "blue", "String" }, new String[] { "green", "String" }, new String[] { "red", "String" });
assertCompletionsVariations("foo.color-names.B<*>", "foo.color-names.BLUE=<*>");
// Map Enum -> Pojo:
assertCompletionsVariations("foo.coldat<*>", "foo.color-data.<*>");
assertCompletionsVariations("foo.color-data.<*>", "foo.color-data.blue.<*>", "foo.color-data.green.<*>", "foo.color-data.red.<*>");
assertCompletionsVariations("foo.color-data.B<*>", "foo.color-data.BLUE.<*>");
assertCompletionsDisplayStringAndDetail("foo.color-data.<*>", new String[] { "blue", "demo.ColorData" }, new String[] { "green", "demo.ColorData" }, new String[] { "red", "demo.ColorData" });
}
use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class ApplicationPropertiesEditorTest method testDeprecatedBeanPropertyCompletions.
@Ignore
@Test
public void testDeprecatedBeanPropertyCompletions() throws Exception {
IJavaProject p = createPredefinedMavenProject("tricky-getters-boot-1.3.1-app");
useProject(p);
data("foo", "demo.Deprecater", null, "A Bean with deprecated properties");
assertStyledCompletions("foo.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 ApplicationPropertiesEditorTest method testEnumMapValueCompletion.
@Test
public void testEnumMapValueCompletion() throws Exception {
IJavaProject p = createPredefinedMavenProject("enums-boot-1.3.2-app");
useProject(p);
assertNotNull(p.getClasspath().findType("demo.Color"));
assertCompletionsVariations("foo.nam<*>", "foo.name-colors.<*>", "foo.color-names.<*>");
assertCompletionsDisplayString("foo.name-colors.something=<*>", "red", "green", "blue");
assertCompletionsVariations("foo.name-colors.something=G<*>", "foo.name-colors.something=GREEN<*>");
}
Aggregations