Skip to content

Commit

Permalink
Diagnostic support for server platform
Browse files Browse the repository at this point in the history
  • Loading branch information
SuparnaSuresh committed Dec 16, 2024
1 parent 45f2c84 commit bf7369b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/test/GradleSingleModLCLSTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,38 @@ describe('LCLS tests for Gradle Project', function () {

}).timeout(38000);

it('Should show diagnostic for invalid value in server.xml for server platform', async () => {
const section = await new SideBarView().getContent().getSection(constants.GRADLE_PROJECT);
section.expand();
await VSBrowser.instance.openResources(path.join(utils.getGradleProjectPath(), 'src', 'main', 'liberty', 'config2', 'server.xml'));

editor = await new EditorView().openEditor('server.xml') as TextEditor;
const stanzaSnipet = "<platform>jakarta</platform>";
const expectedDiagnosticData = `ERROR: The platform "jakarta" does not exist.`;
await editor.typeTextAt(15, 35, '\n');
await editor.typeTextAt(16, 9, stanzaSnipet);
await utils.delay(2000);
const focusTargtElemnt = await editor.findElement(By.xpath("//*[contains(text(), '\jakarta\')]"));
await utils.delay(3000);
focusTargtElemnt.click();
await editor.click();

const actns = VSBrowser.instance.driver.actions();
await actns.move({ origin: focusTargtElemnt }).perform();
await utils.delay(5000);

const hverContent = editor.findElement(By.className('hover-contents'));
const hverValue = await hverContent.getText();
console.log("Hover text:" + hverValue);

assert(hverValue.includes(expectedDiagnosticData), 'Did not get expected diagnostic in server.xml server platform');

editor.clearText();
editor.setText(actualSeverXMLContent);
console.log("Content restored");

}).timeout(38000);

after(() => {
utils.removeConfigDir(path.join(utils.getGradleProjectPath(), 'src', 'main', 'liberty', 'config2'));
console.log("Removed new config folder:");
Expand Down

0 comments on commit bf7369b

Please sign in to comment.