Usage:
1. Select project – right click – build path – add Libraries – JUnit – next – junit4 – finish
2. Write @ test on the method body to be tested
Note:
1. The test method must be modified with public
2. The return value must be void
3. There can be no parameters in the method
4. There can be no class named test under the package
if the test code is OK, an error is still reported, initialization error is not reported in other classes,
it may be because there is an error method in this class
2 Or there are multiple @ test annotations in a class, one of which adds static or has other errors.
Read More:
- Junit4 unit test reports an error invalid project specified
- Spring configuration transaction, JUnit unit test error “failed to load ApplicationContext”
- import org.junit.Test And @ test error reporting — solutions
- Troubleshooting of Jenkins upgrade to 2.42 JUnit test report
- [Solved] Unit test automatically injects error reporting nullpointer
- Maven skip unit test
- Solve the problem of springboot and unit test starting applicationrunner
- Maven skip unit test- maven.test.skip And skipstests
- Error in idea unit test command line is too long
- Android studio failed to resolve: junit:junit : 4.12 solutions
- org.junit.platform.commons.JUnitException: TestEngine with ID ‘junit-vintage‘ failed to discover tes
- Multithreading: when doing unit test, use thread pool to find that the specified code is not running and skip directly
- [Solved] Failed to resolve org.junit.platform:junit-platform-launcher:1.7.2
- java.lang.NoClassDefFoundError: org/junit/platform/launcher/TestExecutionListener
- Failed to resolve org.junit.platform:junit-platform-launcher:1.7.0
- Java and Android commons codec usage and nosuch method error
- Initialization order of Java objects
- Spring integrates JUnit configuration
- Error: transfer of control bypasses initialization of: variable XXX solution
- Python normality test: test whether the data obey the normal distribution