From 64d461cd848e1f4d46eed0439639fe44104f07f9 Mon Sep 17 00:00:00 2001 From: Sergey Date: Thu, 5 Jan 2017 14:50:43 -0800 Subject: [PATCH] Legacy test class declaration --- .../pmd/lang/apex/rule/security/Helper.java | 6 ++++++ .../apex/rule/security/xml/ApexCRUDViolation.xml | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/Helper.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/Helper.java index 93a8d72b11..3ed3118f5b 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/Helper.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/Helper.java @@ -50,6 +50,12 @@ public final class Helper { return true; } } + + final String className = node.getNode().getDefiningType().getApexName(); + if (className.endsWith("Test")) { + return true; + } + return false; } diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml index 1776c3210b..972d9fbad6 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml @@ -465,6 +465,18 @@ public class Foo { } } } +} + ]]> + + + + No issues found in test classes + 0 +