10 KiB
10 KiB
Test Plan
Basic view
Explore Items
- Clone code from https://github.com/Microsoft/todo-app-java-on-azure.git
- Open the cloned project.
- Verify:
- The project item is listed in sidebar.
- Expand the project node, it's a "Plugins" node.
- Expand "Plugins" node, plguins are listed.
- Expand a plugin node, plugin specified goals are listed.
- Right click a goal, choose "Execute", it can execute the corresponding command in the terminal.
Open corresponding POM file
- Click on project item
- Verify:
- It opens the corresponding POM file in editor.
Generate Effective POM file
- Right-click on project item
- Click
Effective POM
- Verify:
- It shows
Generating effective pom ...
in status bar during generating. - Once the operation is over, message is cleaned from status bar, and it opens the Effective POM in editor.
- It shows
- Right-click on
pom.xml
in the file explorer view. - Click on
Effective POM
- Verify that it should have the same behaviour as above.
Execute Maven goals
- Right-click on project item
- Click
clean
/validate
/compile
/test
/package
/verify
/install
/site
/deploy
. - Verify:
- It opens an integrated terminal and sends the corresponding maven command to the terminal.
- The maven command works.
Execute custom goals
- Right-click on project item
- Click
Custom goals ...
- Input a valid string of goals, e.g.
clean package -DskipTests
, pressEnter
. - Verify:
- It execute the corresponding maven command.
Maven Command History
- Open a folder with more than one maven project.
- Open command palatte.
- Select
Maven: History ...
- Verify:
- It lists recently executed maven commands for all projects in workspaces, with information of goals and pom file path.
- Select one of them, it should execute the corresponding command.
- Right-click on one of the project item, click
History...
. - Verify:
- It lists recently executed maven commands for this project, with information of goals and pom file path.
- Select one of them, it should execute the corresponding command.
Maven Archetypes
Generate project from maven archetypes
- Right-click a target folder in file explorer view.
- Click
Generate from Maven Archetype
. - Verify:
- It should show a dropdown list of popular maven archetypes.
- The first item is
More ...
.
- Select one of the listed archetype.
- Select the target folder in the popup dialog.
- Verify:
- It opens an integrated terminal, and navigates to the target folder you previously selected.
- It issues the corresponding maven command (archetype:generate) with correct parameters.
- You can interactively continue to fill in missing params in the terminal to complete the task.
Generate project from maven archetypes (for empty workspace)
- Open Command Palette.
- Click
Maven: Generate from Maven Archetype
. - Verify:
- It should show a dropdown list of popular maven archetypes.
- The first item is
More ...
.
- Select one of the listed archetype.
- Select the target folder in the popup dialog.
- Verify:
- It opens an integrated terminal, and navigates to the target folder you previously selected.
- It issues the corresponding maven command (archetype:generate) with correct parameters.
- You can interactively continue to fill in missing params in the terminal to complete the task.
Update Maven Archetype Catalog
- Open command palatte
- Find and select
Maven: Update Maven Archetype Catalog
. - Verify:
- It shows
updating archetype catalog ...
in progress bar during updating. - Once the operation is over, progress bar is cleaned.
- The
archetypes.json
file located in$HOME/.vscode/extensions/vscjava.vscode-maven-<version>/resources
is updated.
- It shows
Executable related
Maven Wrapper support
- Clone code https://github.com/Microsoft/todo-app-java-on-azure.git
- Test
clean
,Generate project from Maven Archetype
andEffective POM
. - Verify:
- It uses
./mvnw
in the root folder as executable, and no error occurs.
- It uses
Non-in-PATH maven executable Support
- Clone code https://github.com/Microsoft/todo-app-java-on-azure.git
- Open
User Settings
. - Change value of
maven.executable.path
according to the maven executable absolute path.- For maven executables, use path of
mvn
/mvn.cmd
- For maven wrapper, use path of
mvnw
/mvnw.cmd
- For maven executables, use path of
- Test
clean
,Generate project from Maven Archetype
andEffective POM
. - Verify:
- Corresponding executable is used and commands can be successfully executed with no error.
Pom.xml file watcher
The tree view of maven projects should update when any pom.xml is created/modified/deleted in the current workspace.
Create a pom.xml
- Open an empty folder in VS Code.
- Create a project with a valid pom.xml file. E.g. using
Generate from Maven Archetype
command. - After the pom.xml file is successfully created, verify:
- A corresponding project item is automatically added into the sidebar.
Modify a pom.xml
- Open an existing maven project in VS Code.
- Find the corresponding pom.xml file, and change the value of
artifactId
. - Verify:
- The corresponding project item in the sidebar is updated with new value of artifact Id.
Delete a pom.xml
- Open an existing maven project in VS Code.
- Find the corresponding pom.xml file and delete it.
- Verify:
- The corresponding project item is removed from the sidebar.
Maven Executable Options and Enviroment Variables
Maven Options
- Open user settings, set a value for
maven.executable.options
, e.g. "-o". - Right click on a project to trigger a maven command.
- Verify:
- The command executed in the terminal should have the options appended.
Special Handling for JAVA_HOME
- Install Red Hat's Java Language Support extension.
- Specify
java.home
in user settings for that extension:"java.home": "<some value>" // Red Hat Java Language Support Setting
- Add following entry in user settings:
"maven.terminal.useJavaHome": true // Use the Red Hat Java Language Support Setting for JAVA_HOME
- Trigger a maven command, in the newly created terminal, verify:
- value of env
JAVA_HOME
should be the value you just set injava.home
- value of env
General Environment Variables
- Specify a environment variable
MAVEN_OPTS
in settings, e.g.{ "maven.terminal.customEnv": [ { "environmentVariable": "MAVEN_OPTS", // variable name "value": "-Xms1024m -Xmx4096m" // value } ] }
- Trigger a maven command, in the newly created terminal, verify:
- value of env
MAVEN_OPTS
should be the value you just set in settings.
- value of env
Guide to Troubleshooting page if error occurs.
- Make sure
mvn
is not in PATH, or you have set wrongmaven.executable.path
in VS Code. - Open VS Code, open a project, execute
Effective POM
, verify:- It shows a message box for the issue and detailed error message.
- Click
Learn more
, it previewsTroubleshooting.md
in the editor.
Others
Multi-root Workspace Support
- Clone code from https://github.com/spring-projects/spring-hadoop-samples.git
- Clone code https://github.com/Microsoft/todo-app-java-on-azure.git
- Open both above projects in the same VSCode windows under workspace features
- Verify:
- Projects are listed properly, grouped by root folder.
Cross-platform Support
- Open
User Settings
. - Check supported platforms and terminals in README
- Change value of
terminal.integrated.shell.windows/linux/osx
according to the targeted system and terminal. - Test
Custom goals ...
,Generate project from Maven Archetype
andEffective POM
. - Verify:
- Commands can be successfully executed in above tasks.
For Telemetry
After above tests, verify corresponding entries in Application Insight portal (vscode maven telemetry test).
Legacy (Still need to verify for now)
- For each command executed, verify:
- There are records named
vscjava.vscode-maven/commandStart
andvscjava.vscode-maven/commandEnd
with samecustomDimensions.sessionId
. - For record
vscjava.vscode-maven/commandEnd
, value (ms) ofcustomMeasurements.duration
is reasonable.
- There are records named
- For command
Generate from Maven Archetype
, verify:- values of
customDimensions.extra.finishedSteps
,customDimensions.extra.artifactId
andcustomDimensions.extra.groupId
are reasonable.- finishedSteps: The steps user goes through after triggering the command. Candidates are
TargetFolder
,ListMore
andArchetype
. - groupId: Group Id of selected archetype.
- artifactId: Artifact Id of selected archetype.
- finishedSteps: The steps user goes through after triggering the command. Candidates are
- values of
New
- For extension activation and each command executed, verify:
- There are records named
vscjava.vscode-maven/opStart
andvscjava.vscode-maven/opEnd
with samecustomDimensions.operationId
,customDimensions.operationName
- In
opEnd
, checkcustomDimensions.errorCode
- 0 for no error.
- Non-zero values indicate there's an error, check
message
,stack
,errorType
incustomDimensions
. - For non-zero values, there should be an extra record
vscjava.vscode-maven/error
carrying the same error information.
- There are records named
- For command
Generate from Maven Archetype
, verify:- Records named
vscjava.vscode-maven/opStep
are sent after each step is executed. - For some steps, an extra
vscjava.vscode-maven/info
is sent carrying information. E.g.:- groupId: Group Id of selected archetype.
- artifactId: Artifact Id of selected archetype.
- Records named