Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update jdtls #519

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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", "reports", "failsafe.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", "reports", "surefire.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
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ public void testDashboardStartWithCustomConfigAction() {
deleteLibertyToolsRunConfigEntriesFromAppRunAs(MVN_APP_NAME);

// Delete the test report files before we start this test.
Path pathToITReport = Paths.get(projectPath.toString(), "target", "site", "failsafe-report.html");
Path pathToITReport = Paths.get(projectPath.toString(), "target", "reports", "failsafe.html");
boolean testReportDeleted = LibertyPluginTestUtils.deleteFile(pathToITReport.toFile());
Assertions.assertTrue(testReportDeleted, () -> "File: " + pathToITReport + " was not be deleted.");

Expand Down Expand Up @@ -508,7 +508,7 @@ public void testDashboardDebugWithCustomConfigAction() {
deleteLibertyToolsRunConfigEntriesFromAppRunAs(MVN_APP_NAME);

// Delete the test report files before we start this test.
Path pathToITReport = Paths.get(projectPath.toString(), "target", "site", "failsafe-report.html");
Path pathToITReport = Paths.get(projectPath.toString(), "target", "reports", "failsafe.html");
boolean testReportDeleted = LibertyPluginTestUtils.deleteFile(pathToITReport.toFile());
Assertions.assertTrue(testReportDeleted, () -> "File: " + pathToITReport + " was not be deleted.");

Expand Down Expand Up @@ -544,11 +544,11 @@ public void testDashboardDebugWithCustomConfigAction() {
public void testDashboardActions() {

// Delete the test report files before we start this test.
Path pathToITReport = Paths.get(projectPath.toString(), "target", "site", "failsafe-report.html");
Path pathToITReport = Paths.get(projectPath.toString(), "target", "reports", "failsafe.html");
boolean itReportDeleted = LibertyPluginTestUtils.deleteFile(pathToITReport.toFile());
Assertions.assertTrue(itReportDeleted, () -> "Test report file: " + pathToITReport + " was not be deleted.");

Path pathToUTReport = Paths.get(projectPath.toString(), "target", "site", "surefire-report.html");
Path pathToUTReport = Paths.get(projectPath.toString(), "target", "reports", "surefire.html");
boolean utReportDeleted = LibertyPluginTestUtils.deleteFile(pathToITReport.toFile());
Assertions.assertTrue(utReportDeleted, () -> "Test report file: " + pathToITReport + " was not be deleted.");

Expand Down Expand Up @@ -622,7 +622,7 @@ public void testStartWithCustomRunAsConfig() {
deleteLibertyToolsRunConfigEntriesFromAppRunAs(MVN_APP_NAME);

// Delete the test report files before we start this test.
Path pathToITReport = Paths.get(projectPath.toString(), "target", "site", "failsafe-report.html");
Path pathToITReport = Paths.get(projectPath.toString(), "target", "reports", "failsafe.html");
boolean testReportDeleted = LibertyPluginTestUtils.deleteFile(pathToITReport.toFile());
Assertions.assertTrue(testReportDeleted, () -> "File: " + pathToITReport + " was not be deleted.");

Expand Down Expand Up @@ -655,11 +655,11 @@ public void testRunAsShortcutActions() {
deleteLibertyToolsRunConfigEntriesFromAppRunAs(MVN_APP_NAME);

// Delete the test report files before we start this test.
Path pathToITReport = Paths.get(projectPath.toString(), "target", "site", "failsafe-report.html");
Path pathToITReport = Paths.get(projectPath.toString(), "target", "reports", "failsafe.html");
boolean itReportDeleted = LibertyPluginTestUtils.deleteFile(pathToITReport.toFile());
Assertions.assertTrue(itReportDeleted, () -> "Test report file: " + pathToITReport + " was not be deleted.");

Path pathToUTReport = Paths.get(projectPath.toString(), "target", "site", "surefire-report.html");
Path pathToUTReport = Paths.get(projectPath.toString(), "target", "reports", "surefire.html");
boolean utReportDeleted = LibertyPluginTestUtils.deleteFile(pathToITReport.toFile());
Assertions.assertTrue(utReportDeleted, () -> "Test report file: " + pathToITReport + " was not be deleted.");

Expand Down Expand Up @@ -706,7 +706,7 @@ public void testStartWithCustomDebugAsConfig() {
deleteLibertyToolsRunConfigEntriesFromAppRunAs(MVN_APP_NAME);

// Delete the test report files before we start this test.
Path pathToITReport = Paths.get(projectPath.toString(), "target", "site", "failsafe-report.html");
Path pathToITReport = Paths.get(projectPath.toString(), "target", "reports", "failsafe.html");
boolean testReportDeleted = LibertyPluginTestUtils.deleteFile(pathToITReport.toFile());
Assertions.assertTrue(testReportDeleted, () -> "File: " + pathToITReport + " was not be deleted.");

Expand Down
Loading