Browse Source

Add IT test on PMD XPath rule

tags/2.6
fmallet 13 years ago
parent
commit
157d76eb67

+ 16
- 2
tests/integration/pmd-extensions/pmd-extensions.xml View File

@@ -12,6 +12,20 @@
<name>Avoid if without using brace</name>
<configKey>rulesets/extensions.xml/AvoidIfWithoutBrace</configKey>
<category name="Usability"/>
<description>éviter les if sans crochet.</description>
</rule>
<description></description>
</rule>
<rule key="PreventUseOfEmptyClass" priority="MAJOR">
<name><![CDATA[Prevent use of EmptyClass]]></name>
<configKey><![CDATA[net.sourceforge.pmd.rules.XPathRule]]></configKey>
<category name="Maintainability"/>
<description></description>
<param key="xpath" type="s">
<description><![CDATA[XPath expressions.]]></description>
<defaultValue>//VariableDeclarator[../Type/ReferenceType/ClassOrInterfaceType[@Image='EmptyClass']]</defaultValue>
</param>
<param key="message" type="s">
<description><![CDATA[Message to display when a violation occurs.]]></description>
<defaultValue>Prevent use of EmptyClass class</defaultValue>
</param>
</rule>
</rules>

+ 15
- 0
tests/integration/tests/src/it/integration-tests-backup.xml View File

@@ -1891,6 +1891,21 @@
<plugin><![CDATA[findbugs]]></plugin>
<level><![CDATA[ERROR]]></level>
</active-rule>
<active-rule>
<key><![CDATA[PreventUseOfEmptyClass]]></key>
<plugin><![CDATA[pmd]]></plugin>
<level><![CDATA[INFO]]></level>
<params>
<param>
<key><![CDATA[xpath]]></key>
<value><![CDATA[//VariableDeclarator[../Type/ReferenceType/ClassOrInterfaceType[@Image='EmptyClass']]]]></value>
</param>
<param>
<key><![CDATA[message]]></key>
<value><![CDATA[Prevent use of EmptyClass class]]></value>
</param>
</params>
</active-rule>
</active-rules>
<alerts>
<alert>

+ 3
- 0
tests/integration/tests/src/it/selenium/all-tests.html View File

@@ -440,6 +440,9 @@
<tr>
<td><a href="rules/check_rules_extensions.html">rules/check_rules_extensions</a></td>
</tr>
<tr>
<td><a href="rules/pmd_xpath_rule_extension.html">rules/pmd_xpath_rule_extension</a></td>
</tr>
<tr>
<td><a href="rules/copy_a_provided_profile_and_modify_a_rule_param.html">rules/copy_a_provided_profile_and_modify_a_rule_param</a>
</td>

+ 47
- 0
tests/integration/tests/src/it/selenium/rules/pmd_xpath_rule_extension.html View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" />
<title>pmd_xpath_rule_extension</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">pmd_xpath_rule_extension</td></tr>
</thead><tbody>
<tr>
<td>store</td>
<td>Methods Count Check</td>
<td>CHECKSTYLE_EXTENSION</td>
</tr>
<tr>
<td>store</td>
<td>org.sonar.tests:reference</td>
<td>PROJECT_ID</td>
</tr>
<tr>
<td>store</td>
<td>Prevent use of EmptyClass</td>
<td>RULE_TITLE</td>
</tr>
<tr>
<td>open</td>
<td>/drilldown/violations/${PROJECT_ID}</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=${RULE_TITLE}</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>InterfaceWithConstants</td>
<td></td>
</tr>

</tbody></table>
</body>
</html>

Loading…
Cancel
Save