Remove obsolete project with classpath file support

This commit is contained in:
Kris De Volder
2018-04-24 13:55:31 -07:00
parent b2985ae4e2
commit 90408661a1
6 changed files with 2 additions and 339 deletions

View File

@@ -14,7 +14,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.ide.vscode.commons.java.IJavaProject;
import org.springframework.ide.vscode.commons.languageserver.ProgressService;
@@ -67,38 +66,4 @@ public class PropertiesIndexTest {
PropertyInfo propertyInfo = index.get("my.server.port");
assertNull(propertyInfo);
}
@Test @Ignore //ignore because classpath file is going to disapear and pieces already removed
public void springStandardPropertyPresent_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("server.port");
assertNotNull(propertyInfo);
assertEquals(Integer.class.getName(), propertyInfo.getType());
assertEquals("port", propertyInfo.getName());
}
@Test @Ignore //ignore because classpath file is going to disapear and pieces already removed
public void customPropertyPresent_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("demo.settings.user");
assertNotNull(propertyInfo);
assertEquals(String.class.getName(), propertyInfo.getType());
assertEquals("user", propertyInfo.getName());
}
@Test @Ignore //ignore because classpath file is going to disapear and pieces already removed
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);
}
}

View File

@@ -23,7 +23,6 @@ import org.springframework.ide.vscode.commons.java.IJavaProject;
import org.springframework.ide.vscode.commons.maven.MavenBuilder;
import org.springframework.ide.vscode.commons.maven.MavenCore;
import org.springframework.ide.vscode.commons.maven.java.MavenJavaProject;
import org.springframework.ide.vscode.commons.maven.java.classpathfile.JavaProjectWithClasspathFile;
import org.springframework.ide.vscode.commons.util.IOUtil;
import com.google.common.cache.Cache;
@@ -79,8 +78,8 @@ public class ProjectsHarness {
}
private enum ProjectType {
MAVEN,
CLASSPATH_TXT
MAVEN
// GRADLE?
}
private ProjectsHarness() {
@@ -102,9 +101,6 @@ public class ProjectsHarness {
case MAVEN:
MavenBuilder.newBuilder(testProjectPath).clean().pack().javadoc().skipTests().execute();
return new MavenJavaProject(MavenCore.getDefault(), testProjectPath.resolve(MavenCore.POM_XML).toFile());
case CLASSPATH_TXT:
MavenBuilder.newBuilder(testProjectPath).clean().pack().skipTests().execute();
return new JavaProjectWithClasspathFile(testProjectPath.resolve(MavenCore.CLASSPATH_TXT).toFile());
default:
throw new IllegalStateException("Bug!!! Missing case");
}
@@ -133,9 +129,4 @@ public class ProjectsHarness {
public MavenJavaProject mavenProject(String name) throws Exception {
return (MavenJavaProject) project(ProjectType.MAVEN, name);
}
public IJavaProject javaProjectWithClasspathFile(String name) throws Exception {
return project(ProjectType.CLASSPATH_TXT, name);
}
}