From 525435bd681f3eee97708d523fe3b696fd42d776 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 3 Oct 2024 19:59:29 +0200 Subject: [PATCH] [java] Keep bestpractices.xml sorted alphabetically --- .../resources/category/java/bestpractices.xml | 294 +++++++++--------- 1 file changed, 147 insertions(+), 147 deletions(-) diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 684a2cf539..6e53d21ba4 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -672,61 +672,6 @@ public class GoodTest { - - -The rule will detect any test method starting with "test" that is not properly annotated, and will therefore not be run. - -In JUnit 4, only methods annotated with the @Test annotation are executed. -In JUnit 5, one of the following annotations should be used for tests: @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest. -In TestNG, only methods annotated with the @Test annotation are executed. - - 3 - - - - - - - - - - - - - - - -Unit assertions should include an informative message - i.e., use the three-argument version of -assertEquals(), not the two-argument version. - -This rule supports tests using JUnit (3, 4 and 5) and TestNG. - - 3 - - - - - - - -Unit tests should not contain too many asserts. Many asserts are indicative of a complex test, for which -it is harder to verify correctness. Consider breaking the test scenario into multiple, shorter test scenarios. -Customize the maximum number of assertions used by this Rule to suit your needs. - -This rule checks for JUnit (3, 4 and 5) and TestNG Tests. - - 3 - - - - - - - -Unit tests should include at least one assertion. This makes the tests more robust, and using assert -with messages provide the developer a clearer idea of what the test does. - -This rule checks for JUnit (3, 4 and 5) and TestNG Tests. - - 3 - - - - - + + +Unit assertions should include an informative message - i.e., use the three-argument version of +`assertEquals()`, not the two-argument version. + +This rule supports tests using JUnit (3, 4 and 5) and TestNG. + + 3 + + + + + + + + Unit tests should not contain too many asserts. Many asserts are indicative of a complex test, for which + it is harder to verify correctness. Consider breaking the test scenario into multiple, shorter test scenarios. + Customize the maximum number of assertions used by this Rule to suit your needs. + + This rule checks for JUnit (3, 4 and 5) and TestNG Tests. + + 3 + + + + + + + + The rule will detect any test method starting with "test" that is not properly annotated, and will therefore not be run. + + In JUnit 4, only methods annotated with the `@Test` annotation are executed. + In JUnit 5, one of the following annotations should be used for tests: `@Test`, `@RepeatedTest`, `@TestFactory`, `@TestTemplate` or `@ParameterizedTest`. + In TestNG, only methods annotated with the `@Test` annotation are executed. + + 3 + + + + + + + + + + + + + + + + Unit tests should include at least one assertion. This makes the tests more robust, and using assert + with messages provide the developer a clearer idea of what the test does. + + This rule checks for JUnit (3, 4 and 5) and TestNG Tests. + + 3 + + + + +