Skip to content

Commit

Permalink
Test case added for server.env LCLS
Browse files Browse the repository at this point in the history
  • Loading branch information
SuparnaSuresh committed Dec 9, 2024
1 parent b1d39e1 commit ebcad9d
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/test/GradleSingleModLCLSTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,36 @@ describe('LCLS tests for Gradle Project', function () {

}).timeout(10000);

it('Should show diagnostic for server.xml invalid value', async () => {

await VSBrowser.instance.openResources(path.join(utils.getGradleProjectPath(), 'src', 'main', 'liberty', 'config', 'server.xml'));
editor = await new EditorView().openEditor('server.xml') as TextEditor;

const hverExpectdOutcome = `'wrong' is not a valid value of union type 'booleanType'.`;
const testHverTarget = '<logging appsWriteJson = \"wrong\" />';

await editor.typeTextAt(17, 5, testHverTarget);
const focusTargtElemnt = editor.findElement(By.xpath("//*[contains(text(), 'wrong')]"));
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(hverExpectdOutcome), 'Did not get expected diagnostic in server.xml');

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

}).timeout(35000);

it('Should apply quick fix for invalid value in server.xml', async () => {
const section = await new SideBarView().getContent().getSection(constants.GRADLE_PROJECT);
section.expand();
Expand Down Expand Up @@ -115,7 +145,7 @@ describe('LCLS tests for Gradle Project', function () {

it('Should show hover support for server.xml Liberty Server Feature', async () => {

await VSBrowser.instance.openResources(path.join(utils.getGradleProjectPath(), 'src', 'main', 'liberty', 'config2', 'server.xml'));
await VSBrowser.instance.openResources(path.join(utils.getGradleProjectPath(), 'src', 'main', 'liberty', 'config', 'server.xml'));
editor = await new EditorView().openEditor('server.xml') as TextEditor;

const hverExpectdOutcome = `Description: This feature provides support for the MicroProfile Health specification.`;
Expand Down Expand Up @@ -195,6 +225,7 @@ describe('LCLS tests for Gradle Project', function () {

editor = await new EditorView().openEditor('server.xml') as TextEditor;
const stanzaSnipet = "log";

const insertedConfig = "<logging></logging>";
await editor.typeTextAt(17, 5, stanzaSnipet);
await utils.delay(5000);
Expand Down

0 comments on commit ebcad9d

Please sign in to comment.