Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo committed Feb 28, 2024
1 parent c4c6e75 commit 4713098
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.ls.core.internal.ProjectUtils;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.ls.core.internal.managers.ProjectsManager;
import org.junit.Test;

import java.io.File;
Expand All @@ -32,10 +33,12 @@ public class CoverageHandlerTest extends AbstractProjectsManagerBasedTest {

@Test
public void testGetCoverageDetail() throws Exception {
final List<IProject> ps = importProjects(Collections.singleton("coverage-test"));
waitForBackgroundJobs();
assertTrue(ps.size() == 2);
final IJavaProject javaProject = ProjectUtils.getJavaProject("coverage-test");
final List<IProject> projects = importProjects(Collections.singleton("coverage-test"));
assertTrue(projects.size() == 2);
final IProject project = projects.stream().filter(p -> {
return !ProjectsManager.DEFAULT_PROJECT_NAME.equals(p.getName());
}).findFirst().get();
final IJavaProject javaProject = JavaCore.create(project);
final String basePath = new File("projects/coverage-test").getAbsolutePath();
final CoverageHandler coverageHandler = new CoverageHandler(javaProject, basePath);
final List<SourceFileCoverage> coverageDetail = coverageHandler.getCoverageDetail(new NullProgressMonitor());
Expand Down

0 comments on commit 4713098

Please sign in to comment.