Skip to content

Commit 2684c63

Browse files
authored
Update manual integration test for OracleDBUtils (#129)
The project OracleDBUtils has been added with pmd/pmd#5539
1 parent 2e01c3c commit 2684c63

File tree

3 files changed

+33
-17
lines changed

3 files changed

+33
-17
lines changed

History.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ projects. You might need to add `<tag>master</tag>` for some projects.
2020
## Fixed Issues
2121
* [#126](https://github.com/pmd/pmd-regression-tester/pull/126): Fix integration tests
2222
* [#127](https://github.com/pmd/pmd-regression-tester/pull/127): Fix manual integration tests
23+
* [#129](https://github.com/pmd/pmd-regression-tester/pull/129): Update manual integration tests
2324

2425
## External Contributions
2526

test/manual_integration_tests.rb

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,23 @@ def test_case_1_single_java_rule_changed
4646
assert_equal(0, @summary[:violations][:changed], 'found changed violations')
4747
assert_equal(0, @summary[:violations][:new], 'found new violations')
4848
# These are the artificially created false-negatives for AbstractClassWithoutAbstractMethod rule
49-
# checkstyle: 195 violations
50-
# spring-framework: 280 violations
51-
# openjdk11: 29 violations
52-
# java-regression-tests: 1 violation
49+
# checkstyle: 195 removed violations
50+
# spring-framework: 280 removed violations
51+
# openjdk11: 29 removed violations
52+
# java-regression-tests: 1 removed violation
5353
# -> total = 505
5454
assert_equal(195 + 280 + 29 + 1, @summary[:violations][:removed], 'found removed violations')
5555

5656
# errors might have been caused in the baseline for other rules (only visible in the stacktrace)
5757
# hence they might appear as removed
5858

59+
# project "OracleDBUtils" has 2 errors removed, since we only executed java rules
5960
# project "apex-link" has 2 errors removed, since we only executed java rules
60-
# project "checkstyle" has 0 errors removed and 1 changed
61+
# project "checkstyle" has 1 errors removed (that's an sql file...) and 1 changed
6162
# project "openjdk-11" has 0 errors removed or changed
62-
# project "spring-framework" has 0 errors removed or changed
63+
# project "spring-framework" has 20 errors removed (these are all sql files...) and 0 changed
6364
# project "java-regression-tests" has 0 errors removed or changed
64-
# each project has 1 config error removed (LoosePackageCoupling dysfunctional): in total 7 config errors removed
65-
assert_equal(2, @summary[:errors][:removed], 'found removed errors')
65+
assert_equal(2 + 2 + 1 + 20, @summary[:errors][:removed], 'found removed errors')
6666
# The stack overflow exception might vary in the beginning/end of the stack frames shown
6767
# This stack overflow error is from checkstyle's InputIndentationLongConcatenatedString.java
6868
# instead of assert_equal(0, @summary[:errors][:changed], 'found changed errors')
@@ -71,11 +71,12 @@ def test_case_1_single_java_rule_changed
7171
assert_equal(0, @summary[:errors][:new], 'found new errors')
7272
assert_equal(0, @summary[:configerrors][:changed], 'found changed configerrors')
7373
assert_equal(0, @summary[:configerrors][:new], 'found new configerrors')
74-
assert_equal(7, @summary[:configerrors][:removed], 'found removed configerrors')
74+
# each project has 1 config error removed (LoosePackageCoupling dysfunctional): in total 8 config errors removed
75+
assert_equal(8, @summary[:configerrors][:removed], 'found removed configerrors')
7576

7677
assert_equal("This changeset changes 0 violations,\n" \
7778
"introduces 0 new violations, 0 new errors and 0 new configuration errors,\n" \
78-
'removes 505 violations, 2 errors and 7 configuration errors.',
79+
'removes 505 violations, 25 errors and 8 configuration errors.',
7980
create_summary_message)
8081

8182
assert_file_equals("#{PATCHES_PATH}/expected_patch_config_1.xml", 'target/reports/diff/patch_config.xml')
@@ -100,12 +101,13 @@ def test_case_2_single_xpath_rule_changed
100101
# errors might have been caused in the baseline for other rules (only visible in the stacktrace)
101102
# hence they might appear as removed
102103

104+
# project "OracleDBUtils" has 2 errors removed, since we only executed java rules
103105
# project "apex-link" has 2 errors removed, since we only executed java rules
104-
# project "checkstyle" has 0 errors removed and 1 errors changed
106+
# project "checkstyle" has 1 error removed (that's an sql file...) and 1 error changed
105107
# project "openjdk-11" has 0 errors removed or changed
106-
# project "spring-framework" has 0 errors removed or changed
107-
# each project has 1 config error removed (LoosePackageCoupling dysfunctional): in total 7 config errors removed
108-
assert_equal(2, @summary[:errors][:removed], 'found removed errors')
108+
# project "spring-framework" has 20 errors removed (sql files) and 0 changed
109+
# each project has 1 config error removed (LoosePackageCoupling dysfunctional): in total 8 config errors removed
110+
assert_equal(2 + 2 + 1 + 20, @summary[:errors][:removed], 'found removed errors')
109111
# The stack overflow exception might vary in the beginning/end of the stack frames shown
110112
# This stack overflow error is from checkstyle's InputIndentationLongConcatenatedString.java
111113
# instead of assert_equal(0, @summary[:errors][:changed], 'found changed errors')
@@ -114,11 +116,11 @@ def test_case_2_single_xpath_rule_changed
114116
assert_equal(0, @summary[:errors][:new], 'found new errors')
115117
assert_equal(0, @summary[:configerrors][:changed], 'found changed configerrors')
116118
assert_equal(0, @summary[:configerrors][:new], 'found new configerrors')
117-
assert_equal(7, @summary[:configerrors][:removed], 'found removed configerrors')
119+
assert_equal(8, @summary[:configerrors][:removed], 'found removed configerrors')
118120

119121
assert_equal("This changeset changes 0 violations,\n" \
120122
"introduces 0 new violations, 0 new errors and 0 new configuration errors,\n" \
121-
'removes 22 violations, 2 errors and 7 configuration errors.',
123+
'removes 22 violations, 25 errors and 8 configuration errors.',
122124
create_summary_message)
123125

124126
assert_file_equals("#{PATCHES_PATH}/expected_patch_config_2.xml", 'target/reports/diff/patch_config.xml')
@@ -271,6 +273,7 @@ def assert_main_baseline
271273
assert_main_baseline_project('apex-link', 10 * 1024)
272274
assert_main_baseline_project('fflib-apex-common', 400 * 1024)
273275
assert_main_baseline_project('Schedul-o-matic-9000', 20 * 1024)
276+
assert_main_baseline_project('OracleDBUtils', 400 * 1024)
274277
end
275278

276279
def assert_main_baseline_project(project_name, report_size_in_bytes)

test/resources/manual_integration_tests/expected_patch_config_3.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
55
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
66
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
7-
<description>Every apex and java rule in PMD which is used for the regression tests with pmdtester</description>
7+
<description>Every apex, plsql and java rule in PMD which is used for the regression tests with pmdtester</description>
8+
9+
<!-- plsql: avoid long parse time by skipping the problematic file fow now, see #5521 -->
10+
<exclude-pattern>.*/OracleDBUtils/p_utils_tests.sql</exclude-pattern>
811

912
<rule ref="category/apex/bestpractices.xml" />
1013
<rule ref="category/apex/codestyle.xml" />
@@ -15,6 +18,15 @@
1518
<rule ref="category/apex/performance.xml" />
1619
<rule ref="category/apex/security.xml" />
1720

21+
<rule ref="category/plsql/bestpractices.xml" />
22+
<rule ref="category/plsql/codestyle.xml" />
23+
<rule ref="category/plsql/design.xml" />
24+
<!-- no rules <rule ref="category/plsql/documentation.xml" /> -->
25+
<rule ref="category/plsql/errorprone.xml" />
26+
<!-- no rules <rule ref="category/plsql/multithreading.xml" /> -->
27+
<!-- no rules <rule ref="category/plsql/performance.xml" /> -->
28+
<!-- no rules <rule ref="category/plsql/security.xml" /> -->
29+
1830
<rule ref="category/java/bestpractices.xml" />
1931
<rule ref="category/java/codestyle.xml" />
2032
<rule ref="category/java/design.xml" />

0 commit comments

Comments
 (0)