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

Fixes #282 - project detection in dashboard #284

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0ba1870
Added liberty dashboard test
aparnamichael Aug 18, 2023
d5c063f
Test case for detect project with src/main/liberty/config/server.xml …
aparnamichael Aug 25, 2023
cb966ab
Merge remote-tracking branch 'upstream/main' into issue282_projectDet…
aparnamichael Aug 25, 2023
611b128
Changed the variable names
aparnamichael Sep 1, 2023
abbbc18
changed the variable names in the method
aparnamichael Sep 1, 2023
6230fce
Formatting changes in libertydashboardinitproject file
aparnamichael Sep 1, 2023
68b838b
Formatted the import statement in liberty dashboard test file
aparnamichael Sep 1, 2023
901b551
Removed the extra spacing after import
aparnamichael Sep 1, 2023
911f107
Formatted the spacing in testutils file.
aparnamichael Sep 1, 2023
44c9214
Formatted the test case files & added a check for timeout error
aparnamichael Sep 1, 2023
1c5e1bb
Added LGP and LMP with no server xml test
aparnamichael Sep 4, 2023
f8a1b71
Added test case for plugins block method
aparnamichael Sep 4, 2023
468c3d0
Merge remote-tracking branch 'upstream/main' into issue282_projectDet…
aparnamichael Nov 20, 2023
f48f443
Merge remote-tracking branch 'upstream/main' into issue282_projectDet…
aparnamichael Oct 24, 2024
332319d
Adding header to the new test file - DashboardLGPInitProjects.ts file
aparnamichael Oct 29, 2024
7f24c5c
Added header in new test file - DashboardLGPTest
aparnamichael Oct 29, 2024
116f4fb
Added licence header for DashboardLMPInitProject
aparnamichael Oct 29, 2024
f8167d8
Added licence header for DashboardLMPTest
aparnamichael Oct 29, 2024
09fbd97
Added licence header for LibertyDashboardInitProject
aparnamichael Oct 29, 2024
3ce8616
Added licence header for DashboardTest
aparnamichael Oct 29, 2024
08af3e7
Merge pull request #1 from aparnamichael/issue282_add_headerfiles
aparnamichael Oct 29, 2024
8cb3949
Merge remote-tracking branch 'upstream/main' into issue282_projectDet…
aparnamichael Dec 11, 2024
f484d82
Moved the newly added methods to the bottom of the file.
aparnamichael Dec 12, 2024
d7f7a93
Merge remote-tracking branch 'upstream/main' into issue282_projectDet…
aparnamichael Jan 17, 2025
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@
"buildJakarta": "gulp buildJakartaJdt buildJakartaLs",
"test": "npm run test-compile && extest setup-and-run -o .vscode/settings.json 'out/test/*.js'",
"test-mac-maven":"npm run test-compile && extest setup-and-run -o .vscode/settings.json 'out/test/M*.js'",
"test-mac-gradle": "npm run test-compile && extest setup-and-run -o .vscode/settings.json 'out/test/G*.js'"
"test-mac-gradle": "npm run test-compile && extest setup-and-run -o .vscode/settings.json 'out/test/G*.js'",
"test-mac-dashboard": "npm run test-compile && extest setup-and-run -o .vscode/settings.json 'out/test/L*.js'"
},
"devDependencies": {
"@types/chai": "^4.3.4",
Expand Down
18 changes: 18 additions & 0 deletions src/test/LibertyDashboardInitProject.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { WebDriver, VSBrowser } from 'vscode-extension-tester';
import * as utils from './utils/testUtils';

describe('Open Maven Server xml Project', () => {

let driver: WebDriver;

before(() => {
driver = VSBrowser.instance.driver;
});

it('Open Sample Maven Project with no server.xml', async () => {
await VSBrowser.instance.openResources(utils.getMvnServerXmlProjectPath());
}).timeout(15000);

});


65 changes: 65 additions & 0 deletions src/test/LibertyDashboardTest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { expect } from 'chai';
import { SideBarView, ViewItem, ViewSection, DefaultTreeItem, DebugView } from 'vscode-extension-tester';
import * as utils from './utils/testUtils';
import * as constants from './definitions/constants';
import path = require('path');

describe('Liberty dashboard project detection tests', () => {
let sidebar: SideBarView;
let debugView: DebugView;
let section: ViewSection;
let menu: ViewItem[];
let item: DefaultTreeItem;
let tabs: string[];

before(() => {
sidebar = new SideBarView();
debugView = new DebugView();
});

it('Delete server.xml from config.', async () => {

const dest = path.join(utils.getMvnServerXmlProjectPath(), "src", "main", "liberty", "config", "server.xml");
const deleteServerxml = await utils.deleteReports(dest);
expect(deleteServerxml).to.be.true;

}).timeout(80000);

it('getViewControl works with the correct label', async () => {

const contentPart = sidebar.getContent();
section = await contentPart.getSection('Liberty Dashboard');
console.log("Found Liberty Dashboard test....");
expect(section).not.undefined;

}).timeout(10000);

it('Liberty dashboard is empty', async () => {

await utils.delay(30000);
const isEmpty = await utils.isViewSectionEmpty(section);
expect(isEmpty).true;

}).timeout(70000);

it('Copy server.xml to config folder', async () => {

await utils.delay(50000);
const serverxmlPath = path.join(utils.getMvnServerXmlProjectPath(), "src", "main", "liberty", "config", "serverxml", "server.xml");
const dest = path.join(utils.getMvnServerXmlProjectPath(), "src", "main", "liberty", "config", "server.xml");
await utils.copyFile(serverxmlPath, dest);
console.log("Finished copying file....");

}).timeout(90000);

it('Open dasboard shows items - Maven', async () => {

await utils.delay(50000);
const menu = await section.getVisibleItems();
expect(menu).not.empty;
item = await section.findItem(constants.MAVEN_SERVERXML_PROJECT) as DefaultTreeItem;
expect(item).not.undefined;

}).timeout(80000);

});
1 change: 1 addition & 0 deletions src/test/definitions/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

export const MAVEN_PROJECT = "liberty.maven.test.wrapper.app";
export const MAVEN_SERVERXML_PROJECT = "liberty.maven.serverxml.test.wrapper.app";
export const GRADLE_PROJECT= "liberty.gradle.test.wrapper.app";
export const START_DASHBOARD_ACTION = "Start";
export const STOP_DASHBOARD_ACTION = "Stop";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM icr.io/appcafe/open-liberty:kernel-slim-java17-openj9-ubi

COPY --chown=1001:0 /src/main/liberty/config /config

RUN features.sh

COPY --chown=1001:0 target/*.war /config/apps

RUN configure.sh
Loading