use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class ApplicationYamlEditorTest method testEnumsInLowerCaseContentAssist.
@Ignore
@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");
assertCompletions("simple:\n" + " pants:\n" + " size: S<*>", "simple:\n" + " pants:\n" + " size: SMALL<*>", "simple:\n" + " pants:\n" + " size: EXTRA_SMALL<*>");
assertCompletions("simple:\n" + " pants:\n" + " size: s<*>", "simple:\n" + " pants:\n" + " size: small<*>", "simple:\n" + " pants:\n" + " size: extra-small<*>");
assertCompletions("simple:\n" + " pants:\n" + " size: ex<*>", // =>
"simple:\n" + " pants:\n" + " size: extra-large<*>", // or
"simple:\n" + " pants:\n" + " size: extra-small<*>");
assertCompletions("simple:\n" + " pants:\n" + " size: EX<*>", // =>
"simple:\n" + " pants:\n" + " size: EXTRA_LARGE<*>", // or
"simple:\n" + " pants:\n" + " size: EXTRA_SMALL<*>");
assertCompletionsDisplayString("foo:\n color: <*>", "red", "green", "blue");
assertCompletions("foo:\n color-data: B<*>", "foo:\n color-data: \n BLUE:\n <*>");
assertCompletions("foo:\n color-data: b<*>", "foo:\n color-data: \n blue:\n <*>");
assertCompletions("foo:\n color-data: <*>", "foo:\n color-data: \n blue:\n <*>", "foo:\n color-data: \n green:\n <*>", "foo:\n color-data: \n red:\n <*>");
assertCompletions("foo:\n" + " color-data:\n" + " red: na<*>", "foo:\n" + " color-data:\n" + " red: \n" + " name: <*>");
}
use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class ApplicationYamlEditorTest method test_STS4231.
@Ignore
@Test
public void test_STS4231() throws Exception {
// Should the 'predefined' project need to be recreated... use the commented code below:
// BootProjectTestHarness projectHarness = new BootProjectTestHarness(ResourcesPlugin.getWorkspace());
// IJavaProject project = projectHarness.createBootProject("boot-1.3.0-app-sts-4231",
// bootVersionAtLeast("1.3.0"),
// withStarters("web", "cloud-config-server")
// );
// For more robust test use predefined project which is not so much a moving target:
IJavaProject project = createPredefinedMavenProject("boot-1.3.0-app-sts-4231");
useProject(project);
assertCompletionsDisplayString("info:\n" + " component: Config Server\n" + "spring:\n" + " application:\n" + " name: configserver\n" + " jmx:\n" + " default-domain: cloud.config.server\n" + " cloud:\n" + " config:\n" + " server:\n" + " git:\n" + " uri: https://github.com/spring-cloud-samples/config-repo\n" + " repos:\n" + " my-repo:\n" + " <*>\n", // ==>
"name : String", "pattern : String[]");
assertCompletion("info:\n" + " component: Config Server\n" + "spring:\n" + " application:\n" + " name: configserver\n" + " jmx:\n" + " default-domain: cloud.config.server\n" + " cloud:\n" + " config:\n" + " server:\n" + " git:\n" + " uri: https://github.com/spring-cloud-samples/config-repo\n" + " repos:\n" + " my-repo:\n" + " p<*>\n", // ==>
"info:\n" + " component: Config Server\n" + "spring:\n" + " application:\n" + " name: configserver\n" + " jmx:\n" + " default-domain: cloud.config.server\n" + " cloud:\n" + " config:\n" + " server:\n" + " git:\n" + " uri: https://github.com/spring-cloud-samples/config-repo\n" + " repos:\n" + " my-repo:\n" + " pattern:\n" + " - <*>\n");
}
use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class ApplicationYamlEditorTest method testContentAssistCamelCaseBeanProp.
@Test
public void testContentAssistCamelCaseBeanProp() throws Exception {
IJavaProject p = createPredefinedMavenProject("tricky-getters-boot-1.3.1-app");
useProject(p);
data("demo.bean", "demo.CamelCaser", "For testing tolerance of camelCase", null);
assertCompletion("demo:\n" + " bean:\n" + " theLeft:\n" + " answer<*>\n", // =>
"demo:\n" + " bean:\n" + " theLeft:\n" + " the-answer-to-everything: <*>\n");
}
use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class PropertiesIndexTest method propertyNotPresent_ClasspathFile.
@Test
public void propertyNotPresent_ClasspathFile() throws Exception {
SpringPropertiesIndexManager indexManager = new SpringPropertiesIndexManager(ValueProviderRegistry.getDefault(), null);
IJavaProject classpathFileProject = projects.javaProjectWithClasspathFile(CUSTOM_PROPERTIES_PROJECT);
FuzzyMap<PropertyInfo> index = indexManager.get(classpathFileProject, progressService);
PropertyInfo propertyInfo = index.get("my.server.port");
assertNull(propertyInfo);
}
use of org.springframework.ide.vscode.commons.java.IJavaProject in project sts4 by spring-projects.
the class PropertiesIndexTest method customPropertyPresent_Maven.
@Test
public void customPropertyPresent_Maven() throws Exception {
SpringPropertiesIndexManager indexManager = new SpringPropertiesIndexManager(ValueProviderRegistry.getDefault(), null);
IJavaProject mavenProject = projects.mavenProject(CUSTOM_PROPERTIES_PROJECT);
FuzzyMap<PropertyInfo> index = indexManager.get(mavenProject, progressService);
PropertyInfo propertyInfo = index.get("demo.settings.user");
assertNotNull(propertyInfo);
assertEquals(String.class.getName(), propertyInfo.getType());
assertEquals("user", propertyInfo.getName());
}
Aggregations