use of org.springframework.ide.vscode.commons.maven.java.MavenJavaProject in project sts4 by spring-projects.
the class BeanInjectedIntoHoverProviderTest method setup.
@Before
public void setup() throws Exception {
mockAppProvider = new MockRunningAppProvider();
harness = BootJavaLanguageServerHarness.builder().mockDefaults().runningAppProvider(mockAppProvider.provider).watchDogInterval(Duration.ofMillis(100)).build();
MavenJavaProject jp = projects.mavenProject("empty-boot-15-web-app", FOO_INTERFACE);
assertTrue(jp.getClasspath().findType("hello.Foo").exists());
harness.useProject(jp);
harness.intialize(null);
}
use of org.springframework.ide.vscode.commons.maven.java.MavenJavaProject in project sts4 by spring-projects.
the class VSCodeSourceLinksTest method testJarUrl.
@Test
public void testJarUrl() throws Exception {
MavenJavaProject project = mavenProjectsCache.get("empty-boot-15-web-app");
Optional<String> url = new VSCodeSourceLinks(null).sourceLinkUrlForFQName(project, "org.springframework.boot.autoconfigure.SpringBootApplication");
assertTrue(url.isPresent());
String headerPart = url.get().substring(0, url.get().indexOf('?'));
assertEquals("jdt://contents/spring-boot-autoconfigure-1.5.8.RELEASE.jar/org.springframework.boot.autoconfigure/SpringBootApplication.class", headerPart);
String positionPart = url.get().substring(url.get().lastIndexOf('#'));
assertEquals("#55,19", positionPart);
}
use of org.springframework.ide.vscode.commons.maven.java.MavenJavaProject in project sts4 by spring-projects.
the class VSCodeSourceLinksTest method testJavaSourceUrl.
@Test
public void testJavaSourceUrl() throws Exception {
MavenJavaProject project = mavenProjectsCache.get("empty-boot-15-web-app");
Optional<String> url = new VSCodeSourceLinks(null).sourceLinkUrlForFQName(project, "com.example.EmptyBoot15WebAppApplication");
assertTrue(url.isPresent());
Path projectPath = Paths.get(project.pom().getParent());
URI uri = URI.create(url.get());
// Use File to get rid of the fragment parts of the URL. The URL may have fragments that indicate line and column numbers
uri = new File(uri.getPath()).toURI();
Path relativePath = projectPath.relativize(Paths.get(uri));
assertEquals(Paths.get("src/main/java/com/example/EmptyBoot15WebAppApplication.java"), relativePath);
String positionPart = url.get().substring(url.get().lastIndexOf('#'));
assertEquals("#7,14", positionPart);
}
use of org.springframework.ide.vscode.commons.maven.java.MavenJavaProject in project sts4 by spring-projects.
the class ApplicationPropertiesEditorTest method testEnableApt.
@Test
public void testEnableApt() throws Throwable {
MavenJavaProject p = createPredefinedMavenProject("boot-1.2.0-properties-live-metadta");
// Check some assumptions about the initial state of the test project (if these checks fail then
// the test may be 'vacuous' since the things we are testing for already exist beforehand.
Path metadataFile = p.getClasspath().getOutputFolder().resolve(PropertiesLoader.PROJECT_META_DATA_LOCATIONS[0]);
assertTrue(metadataFile.toFile().isFile());
assertContains("\"name\": \"foo.counter\"", Files.toString(metadataFile.toFile(), Charset.forName("UTF8")));
}
use of org.springframework.ide.vscode.commons.maven.java.MavenJavaProject in project sts4 by spring-projects.
the class BeansByTypeHoverProviderTest method setup.
@Before
public void setup() throws Exception {
mockAppProvider = new MockRunningAppProvider();
harness = BootJavaLanguageServerHarness.builder().mockDefaults().runningAppProvider(mockAppProvider.provider).watchDogInterval(Duration.ofMillis(100)).build();
MavenJavaProject jp = projects.mavenProject("empty-boot-15-web-app");
harness.useProject(jp);
harness.intialize(null);
}
Aggregations