Преглед изворни кода

PMD.MethodNameRules - ignore unit test methods

Ranides Atterwim пре 10 година
родитељ
комит
ae9e272e5c
1 измењених фајлова са 5 додато и 3 уклоњено
  1. 5 3
      assira.rules/src/main/resources/rulesets/java/assira.custom.xml

+ 5 - 3
assira.rules/src/main/resources/rulesets/java/assira.custom.xml

@@ -165,9 +165,11 @@
         <priority>3</priority>
         <priority>3</priority>
         <properties><property name="xpath" pluginname="true"><value>
         <properties><property name="xpath" pluginname="true"><value>
             <![CDATA[
             <![CDATA[
-            //MethodDeclaration/MethodDeclarator[
-                not(matches(@Image,'^(m_|\$)?([a-z][a-zA-Z0-9]*)$'))
-            ]
+            //ClassOrInterfaceBodyDeclaration
+                [not(Annotation/MarkerAnnotation/Name[@Image='Test'])]
+                [not(Annotation/MarkerAnnotation/Name[@Image='InterfaceTest'])]
+            /MethodDeclaration/MethodDeclarator
+                [not(matches(@Image,'^(m_|\$)?([a-z][a-zA-Z0-9]*)$'))]
             ]]>
             ]]>
         </value></property></properties>
         </value></property></properties>
     </rule>
     </rule>