From 32ec1b2e854bed634d05b6281ac9299004f84eab Mon Sep 17 00:00:00 2001 From: JoshwinThomasIBM Date: Wed, 20 Nov 2024 10:22:02 +0530 Subject: [PATCH] considered AND operator for delete reports testing --- src/liberty/devCommands.ts | 29 +++++++++++++++-------------- src/test/MavenTestDevModeActions.ts | 4 ++-- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/liberty/devCommands.ts b/src/liberty/devCommands.ts index be7ae3f2..cdecf86c 100644 --- a/src/liberty/devCommands.ts +++ b/src/liberty/devCommands.ts @@ -77,17 +77,18 @@ export async function openProject(pomPath: string): Promise { export async function listAllCommands(): Promise { const libertyCommands = Array.from(COMMAND_TITLES.keys()); vscode.window.showQuickPick(libertyCommands).then(selection => { - if (!selection) { - return; - } - const command = COMMAND_TITLES.get(selection); - if (command !== undefined) { - vscode.commands.executeCommand(command); - } else { - // should never happen - console.error("Unable to find corresponding command for " + selection); - } - + if (!selection) { + return; + } + const command = COMMAND_TITLES.get(selection); + if ( command !== undefined ) + { + vscode.commands.executeCommand(command); + } else { + // should never happen + console.error("Unable to find corresponding command for " + selection); + } + }); } @@ -192,11 +193,11 @@ export async function addProject(uri: vscode.Uri): Promise { // scan the folder and get a list of folders with pom.xml and build.gradle const uris: string[] = await projectProvider.getListOfMavenAndGradleFolders(uri.fsPath); console.log(JSON.stringify(uris)); - if (uris.length > 0) { + if ( uris.length > 0) { // present the list to add showListOfPathsToAdd(uris); } - + } else { // clicked on the empty space and workspace has more than one folders, or @@ -398,7 +399,7 @@ export async function customDevMode(libProject?: LibertyProject | undefined, par if (customCommand !== undefined) { // save command customCommand = customCommand.trim(); - if (customCommand.length > 0) { + if ( customCommand.length > 0 ) { const projectStartCmdParam: ProjectStartCmdParam = new ProjectStartCmdParam(libProject.getPath(), customCommand); const projectProvider: ProjectProvider = ProjectProvider.getInstance(); const dashboardData: DashboardData = helperUtil.getStorageData(projectProvider.getContext()); diff --git a/src/test/MavenTestDevModeActions.ts b/src/test/MavenTestDevModeActions.ts index 82c4895d..ace4358e 100755 --- a/src/test/MavenTestDevModeActions.ts +++ b/src/test/MavenTestDevModeActions.ts @@ -102,7 +102,7 @@ it('start maven with options from liberty dashboard', async () => { const alternateReportPath = path.join(utils.getMvnProjectPath(), "target", "reports", "failsafe.html"); // new path to scan for the reports let deleteReport = await utils.deleteReports(reportPath); let deleteAlternateReport = await utils.deleteReports(alternateReportPath); - expect (deleteReport || deleteAlternateReport).to.be.true; // there should be a report available irrespective of the surefire versions we use , so either one needs to be true + expect (deleteReport && deleteAlternateReport).to.be.true; // there should be a report available irrespective of the surefire versions we use , so either one needs to be true await utils.launchDashboardAction(item, constants.START_DASHBOARD_ACTION_WITH_PARAM, constants.START_DASHBOARD_MAC_ACTION_WITH_PARAM); await utils.setCustomParameter("-DhotTests=true"); await utils.delay(30000); @@ -135,7 +135,7 @@ it('start maven with history from liberty dashboard', async () => { const alternateReportPath = path.join(utils.getMvnProjectPath(), "target", "reports", "failsafe.html"); let deleteReport = await utils.deleteReports(reportPath); let deleteAlternateReport = await utils.deleteReports(alternateReportPath); - expect (deleteReport || deleteAlternateReport).to.be.true; + expect (deleteReport && deleteAlternateReport).to.be.true; await utils.launchDashboardAction(item, constants.START_DASHBOARD_ACTION_WITH_PARAM, constants.START_DASHBOARD_MAC_ACTION_WITH_PARAM); const foundCommand = await utils.chooseCmdFromHistory("-DhotTests=true"); expect (foundCommand).to.be.true;