Read the JUnit source code record (1): JUnit core package class analysis

It's just a record of personal reading, Xiaobai has just started reading the source code, begging for a blow 
 
Refer to the method in the article to read the JUnit source code, the article link https://blog.interlinked.org/programming/how_to_dive_into_legacy_code.html
 

1. First, analyze dependencies and modules, and use pictures to draw the interdependence between each module.

 maven project, view the pom.xml file. Depends only on the hamcrest jar package (Matcher library).

 
  

 

The runner package should be the core package, which contains the runner class that executes the test. The runner package depends on the validator, rules, and matcher packages.

 

2. Analyze each package individually

2.1 validator package

 

org.junit.validator.AnnotationValidator Validate classes, methods, and parameters individually org.junit.validator.AnnotationsValidator Executes all validations at once .junit.validator.TestClassValidator Validation test class interface

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326394265&siteId=291194637