-
Notifications
You must be signed in to change notification settings - Fork 162
Test Plan
Sheng Chen edited this page Aug 12, 2019
·
46 revisions
The following projects can be used (but not limited to):
- Junit4:
- Junit5:
- TestNG:
- Invisible Project:
- Java 12 project
- Check the version is equal to the current milestone.
- Check the changelog has the right version and no typo.
- The following events will startup the extension:
- Workspace contains pom.xml
- Workspace contains build.gradle
- Test explorer gets focus
- Trigger the extension commands
- The startup activation time of the extension should no more than 1000ms.
- The explorer should perform as lazy-load behavior: only load the children nodes if the parent nodes are expanded.
- The nodes should all be sorted alphabetically.
- If the method has annotated with
@DisplayName(a JUnit 5 annotation), the node will use the annotation value as it's display name. - The hierarchy should be correct - Both for Single-Root or Multi-Root scenarios.
- Click on the class/method level node, the editor should jump to the correct position of the source file.
- Update/Delete/Create test code, the explorer should be updated accordingly.
- The explorer can be refreshed if the user clicks refresh in either
navigation barorcontext menu.
- There are actions called
run test/debug testsin bothnavigation barorcontext menu. In other words, the tests can be run/debug in the following level:- Workspace Root
- Workspace Folder
- Package
- Class/Inner Class
- Method
- After executing
run tests/debug tests, all the tests under the target node will be run. - After executing
run tests/debug tests, in the notification window at the right-bottom side, it will show the status of the current test tasks, such as:searching test items..., thenrunning tests...
- Code Lens should be shown at the following places:
- Test Methods (Annotated with
@Test). - Classes which contains test methods.
- Test Methods (Annotated with
- By default, the Code Lens Contains following actions:
Run TestDebug Test
- After tests are run, a new status icon should be added as the third Code Lens action. For those tests that have not been run, the status icon should not be shown for it.
- Click
Run Testwill run the tests - Click
Debug Testwill debug tests - Click the status icon should show the Test Report
- User can set the visibility of the Code Lens by using the setting
java.test.editor.enableShortcuts
- Only show the filter button when necessary. For example, the
Failedbutton will appear only when there are failed tests. All of them can filter the results correctly. - Test report theme updates when the user changes the color theme.
- The report can auto-update if the user reruns the tests and get different results.
- The test report is read-only. (Not prompt saving when closing it).
- The methods are categorized by classes.
- Can navigate to the method source from the report.
- Can config the report position through
java.test.report.position.- When the report is not opened in the editor, reveal it as the setting specified.
- When the report is opened in the editor, just update the report and do not change its column.
- Can config whether to automatically show the report after execution, default is
onFailure. Other available values are:alwaysandnever.
- Should show
Running Tests...during running. - When the status bar is showing
Running Tests..., click it should open the output channel. - After running/debugging tests, the status bar should show the result.
- Click the result, will open the Test Report.
- start a test run that lasts for a long period, for example, add
Thread.sleepin your test. - click
Cancelbutton on the notification message, the running job should be stopped.
- Can trigger command
Java: Show Test Outputto open the output channel. - Can trigger command
Java: Open Test Runner Logto show the log file. - Can set log level:
verbose,info,error - Can print the Chinese character correctly (providing that the user has correctly setup the project).
- The extension will only honor the
java.test.configif it exists. -
java.test.configcould be either an array or an object - If
java.test.configis not empty, user will see a list to select the configuration - After the user selects the configuration, the extension will pop up a message box. The user can:
Yes: Set the selected config as default,No: Do nothingorNever show: Do not show this message any more - The ${workspaceFolder} is available in
workdingDirectory,args,vmargsand the value of entries inenv
- Should be able to migrate the content in
launch.test.jsoninto the workspace setting, usingJava: Migrate Deprecated 'launch.test.json'. - After migration, user can:
- open setting
- remove deprecated files
- view more details
- For a Spring Boot project, if both
src/main/resourceandsrc/test/resourcecontainapplication.propertiesfile, the test runner should pick the one insrc/test/resource. - Star import should also be supported. (For example,
import org.junit.*) - JUnit 4:
- org.junit.Test
- org.junit.experimental.theories.Theory
- org.junit.runner.RunWith (class level)
- JUnit 5:
- org.junit.jupiter.api.Test
- org.junit.jupiter.params.ParameterizedTest
- org.junit.jupiter.api.RepeatedTest
- org.junit.jupiter.api.TestFactory
- org.junit.jupiter.api.Nested
- org.junit.jupiter.api.TestTemplate
- Meta Annotation
- TestNG:
- org.testng.annotations.Test