@@ -147,9 +147,29 @@ def test_build_long_cli_options
147147 . build
148148 end
149149
150+ def test_build_pmd7
151+ @pmd_version = '7.0.0-SNAPSHOT'
152+ project_list = 'test/resources/pmd_report_builder/project-list.xml'
153+ projects = PmdTester ::ProjectsParser . new . parse ( project_list )
154+ assert_equal ( 1 , projects . size )
155+ argv = %w[ -r target/repositories/pmd -b master -p pmd_releases/6.1.0
156+ -c config/design.xml --debug --error-recovery -l ]
157+ argv . push project_list
158+ options = PmdTester ::Options . new ( argv )
159+
160+ projects [ 0 ] . auxclasspath = 'extra:dirs'
161+ record_expectations ( 'sha1abc' , 'sha1abc' , true )
162+ record_expectations_after_build
163+ record_expectations_project_build ( 'sha1abc' , true , true , true )
164+
165+ PmdTester ::PmdReportBuilder
166+ . new ( projects , options , options . base_config , options . base_branch )
167+ . build
168+ end
169+
150170 private
151171
152- def record_expectations_project_build ( sha1 , error = false , long_cli_options = false )
172+ def record_expectations_project_build ( sha1 , error = false , long_cli_options = false , no_progress_bar = false )
153173 PmdTester ::ProjectBuilder . any_instance . stubs ( :clone_projects ) . once
154174 PmdTester ::ProjectBuilder . any_instance . stubs ( :build_projects ) . once
155175 PmdTester ::SimpleProgressLogger . any_instance . stubs ( :start ) . once
@@ -165,7 +185,8 @@ def record_expectations_project_build(sha1, error = false, long_cli_options = fa
165185 '-R target/reports/master/checkstyle/config.xml ' \
166186 '-r target/reports/master/checkstyle/pmd_report.xml ' \
167187 "#{ fail_on_violation } -t 1 " \
168- "#{ auxclasspath } " ) . once
188+ "#{ auxclasspath } " \
189+ "#{ no_progress_bar ? ' --no-progress' : '' } " ) . once
169190 PmdTester ::PmdReportDetail . any_instance . stubs ( :save ) . once
170191 end
171192
0 commit comments