What are the "test notes" framework commonly used in the Java library?

The commonly used test annotation frameworks in the Java class library mainly include Junit and Testng. Junit is one of the most popular test comments frameworks in Java.It provides a set of annotations and assertions for writing and executing unit testing.Junit uses annotations to mark the test method and provide an assertion method to verify the expected results.The following is an example: import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; public class CalculatorTest { @Test public void testAddition() { Calculator calculator = new Calculator(); int result = calculator.add(2, 3); Assertions.assertEquals(5, result); } } In the above example, the note is used to mark the test method.An assertion method `assereasts.assertequals (5, Result)` The result returned by the addition method used by the calculator is equal to the expected value. Testng is also a test comments framework commonly used in Java.It provides more functions and flexibility, such as testing groups, concurrent execution, dependency management management.Below is an example of using testng: import org.testng.Assert; import org.testng.annotations.Test; public class CalculatorTest { @Test public void testAddition() { Calculator calculator = new Calculator(); int result = calculator.add(2, 3); Assert.assertEquals(result, 5); } } In the above example, the note is used to mark the test method.An assertion method `assert.assertequals (Result, 5)` `The result returned by the addition method used by the calculator is equal to the expected value. In short, Junit and Testng are the test annotation framework commonly used in the Java class library.They all provide simple grammar and rich functions for writing and executing unit testing.Developers can choose suitable frameworks according to their needs.