Skip to content

Commit

Permalink
Update jdtls
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Wisniewski <[email protected]>
  • Loading branch information
awisniew90 committed Sep 4, 2024
1 parent 0866686 commit c02a2c7
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -563,22 +562,13 @@ public void openMavenIntegrationTestReport(IProject inputProject) {
}

// Get the path to the test report.
Path path = getMavenIntegrationTestReportPath(projectPath);
if (!path.toFile().exists()) {
String msg = "No integration test results were found for project " + projectName + ". Select \""
+ DashboardView.APP_MENU_ACTION_RUN_TESTS + "\" before you select \""
+ DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT + "\" on the menu.";
if (Trace.isEnabled()) {
Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op. Path: " + path);
}
ErrorHandler.processErrorMessage(NLS.bind(Messages.mvn_int_test_report_none_found, new String[] { projectName,
DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT }), true);
return;
}
Path path = getMavenIntegrationTestReportPath(projectPath, projectName);

// Display the report on the browser. Browser display is based on eclipse configuration preferences.
String browserTabTitle = projectName + " " + BROWSER_MVN_IT_REPORT_NAME_SUFFIX;
openTestReport(projectName, path, path.toString(), browserTabTitle, browserTabTitle);
if (path != null) {
// Display the report on the browser. Browser display is based on eclipse configuration preferences.
String browserTabTitle = projectName + " " + BROWSER_MVN_IT_REPORT_NAME_SUFFIX;
openTestReport(projectName, path, path.toString(), browserTabTitle, browserTabTitle);
}
} catch (Exception e) {
String msg = "An error was detected when the view integration test report request was processed on project " + projectName
+ ".";
Expand Down Expand Up @@ -637,22 +627,13 @@ public void openMavenUnitTestReport(IProject inputProject) {
}

// Get the path to the test report.
Path path = getMavenUnitTestReportPath(projectPath);
if (!path.toFile().exists()) {
String msg = "No unit test results were found for project " + projectName + ". Select \""
+ DashboardView.APP_MENU_ACTION_RUN_TESTS + "\" before you select \""
+ DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT + "\" on the menu.";
if (Trace.isEnabled()) {
Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op. Path: " + path);
}
ErrorHandler.processErrorMessage(NLS.bind(Messages.mvn_unit_test_report_none_found, new String[] { projectName,
DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT }), true);
return;
}
Path path = getMavenUnitTestReportPath(projectPath, projectName);

// Display the report on the browser. Browser display is based on eclipse configuration preferences.
String browserTabTitle = projectName + " " + BROWSER_MVN_UT_REPORT_NAME_SUFFIX;
openTestReport(projectName, path, path.toString(), browserTabTitle, browserTabTitle);
if (path != null) {
// Display the report on the browser. Browser display is based on eclipse configuration preferences.
String browserTabTitle = projectName + " " + BROWSER_MVN_UT_REPORT_NAME_SUFFIX;
openTestReport(projectName, path, path.toString(), browserTabTitle, browserTabTitle);
}
} catch (Exception e) {
String msg = "An error was detected when the view unit test report request was processed on project " + projectName + ".";
if (Trace.isEnabled()) {
Expand Down Expand Up @@ -983,10 +964,23 @@ public void run() {
*
* @return The path of the HTML file containing the integration test report.
*/
public static Path getMavenIntegrationTestReportPath(String projectPath) {
Path path = Paths.get(projectPath, "target", "site", "failsafe-report.html");
public static Path getMavenIntegrationTestReportPath(String projectPath, String projectName) {
Path path1 = Paths.get(projectPath, "target", "failsafe-report.html");
Path path2 = Paths.get(projectPath, "target", "site", "failsafe-report.html");

if (!path1.toFile().exists() && !path2.toFile().exists()) {
String msg = "No integration test results were found for project " + projectName + ". Select \""
+ DashboardView.APP_MENU_ACTION_RUN_TESTS + "\" before you select \""
+ DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT + "\" on the menu.";
if (Trace.isEnabled()) {
Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op. Paths checked: " + path1 + ", " + path2);
}
ErrorHandler.processErrorMessage(NLS.bind(Messages.mvn_int_test_report_none_found, new String[] { projectName,
DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT }), true);
return null;
}

return path;
return path1.toFile().exists() ? path1 : path2;
}

/**
Expand All @@ -996,10 +990,23 @@ public static Path getMavenIntegrationTestReportPath(String projectPath) {
*
* @return The path of the HTML file containing the unit test report.
*/
public static Path getMavenUnitTestReportPath(String projectPath) {
Path path = Paths.get(projectPath, "target", "site", "surefire-report.html");
public static Path getMavenUnitTestReportPath(String projectPath, String projectName) {
Path path1 = Paths.get(projectPath, "target", "surefire-report.html");
Path path2 = Paths.get(projectPath, "target", "site", "surefire-report.html");

if (!path1.toFile().exists() && !path2.toFile().exists()) {
String msg = "No unit test results were found for project " + projectName + ". Select \""
+ DashboardView.APP_MENU_ACTION_RUN_TESTS + "\" before you select \""
+ DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT + "\" on the menu.";
if (Trace.isEnabled()) {
Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op. Paths checked: " + path1 + ", " + path2);
}
ErrorHandler.processErrorMessage(NLS.bind(Messages.mvn_unit_test_report_none_found, new String[] { projectName,
DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT }), true);
return null;
}

return path;
return path1.toFile().exists() ? path1 : path2;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion releng/io.openliberty.tools.update/category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<category-def name="io.openliberty.tools.eclipse" label="Liberty Tools" />

<repository-reference location="https://download.eclipse.org/jdtls/milestones/1.34.0/repository" enabled="true" />
<repository-reference location="https://download.eclipse.org/jdtls/milestones/1.39.0/repository" enabled="true" />
<repository-reference location="https://download.eclipse.org/lsp4mp/releases/0.11.3/repository" enabled="true" />
<repository-reference location="https://download.eclipse.org/lsp4j/updates/releases/0.22.0" enabled="true" />
<repository-reference location="https://download.eclipse.org/lsp4jakarta/releases/0.2.1/repository" enabled="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<unit id="org.eclipse.lsp4j.jsonrpc" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/jdtls/milestones/1.34.0/repository/"/>
<repository location="https://download.eclipse.org/jdtls/milestones/1.39.0/repository/"/>
<unit id="org.eclipse.jdt.ls.core" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
Expand Down

0 comments on commit c02a2c7

Please sign in to comment.