git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@164229 13f79535-47bb-0310-9956-ffa450edef68
216 lines
13 KiB
XML
216 lines
13 KiB
XML
<!--
|
|
/*
|
|
* Copyright 2001-2005 The Apache Software Foundation.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
-->
|
|
<project default="testPlugin"
|
|
xmlns:util="jelly:util"
|
|
xmlns:j="jelly:core"
|
|
xmlns:ant="jelly:ant"
|
|
xmlns:x="jelly:xml"
|
|
xmlns:assert="assert">
|
|
|
|
<goal name="testPlugin">
|
|
<attainGoal name="fixture"/>
|
|
<attainGoal name="testReportOk"/>
|
|
</goal>
|
|
|
|
<goal name="fixture">
|
|
|
|
<!-- Setup -->
|
|
<j:set var="goal" value="clean"/>
|
|
<attainGoal name="multiproject:goal"/>
|
|
<attainGoal name="clean"/>
|
|
|
|
<!-- Call goal to test -->
|
|
<attainGoal name="multiproject:site"/>
|
|
|
|
</goal>
|
|
|
|
<goal name="testReportOk">
|
|
|
|
<!-- Verifications -->
|
|
<assert:assertFileExists file="${maven.docs.dest}/dashboard-report.html"/>
|
|
<assert:assertFileExists file="${maven.gen.docs}/dashboard-report.xml"/>
|
|
|
|
<util:file var="dashboardAsFile"
|
|
name="${maven.gen.docs}/dashboard-report.xml"/>
|
|
<x:parse var="doc" xml="${dashboardAsFile}"/>
|
|
|
|
<!-- Verify number of rows -->
|
|
<ant:echo>Check nb of rows in the report</ant:echo>
|
|
<x:set var="count" select="count($doc//body/section/table/tr)"/>
|
|
<assert:assertEquals expected="5" value="${count.intValue().toString()}"/>
|
|
|
|
<!-- Verify number of columns. One column for the project name and one for the 28
|
|
aggregators -->
|
|
<ant:echo>Check nb of columns in the report</ant:echo>
|
|
<x:set var="countTitleColumn" select="count($doc//body/section/table/tr[1]/th)"/>
|
|
<x:set var="countContentColumn" select="count($doc//body/section/table/tr[2]/td)"/>
|
|
<assert:assertEquals expected="29" value="${countTitleColumn.intValue().toString()}"/>
|
|
<assert:assertEquals expected="29" value="${countContentColumn.intValue().toString()}"/>
|
|
|
|
<!-- TasklistClass aggregator test -->
|
|
<ant:echo>Check tasklistclass aggregator</ant:echo>
|
|
<x:set var="title" select="string($doc//body/section/table/tr[1]/th[20])"/>
|
|
<assert:assertEquals expected="Classes Tasks" value="${title}"/>
|
|
<x:set var="taskCount" select="string($doc//body/section/table/tr[3]/td[20]/a)"/>
|
|
<assert:assertEquals expected="1" value="${taskCount}"/>
|
|
|
|
<!-- TasklistMethod aggregator test -->
|
|
<ant:echo>Check tasklistmethod aggregator</ant:echo>
|
|
<x:set var="title" select="string($doc//body/section/table/tr[1]/th[21])"/>
|
|
<assert:assertEquals expected="Methods Tasks" value="${title}"/>
|
|
<x:set var="taskCount" select="string($doc//body/section/table/tr[3]/td[21]/a)"/>
|
|
<assert:assertEquals expected="2" value="${taskCount}"/>
|
|
|
|
<!-- Tasklist aggregator test -->
|
|
<ant:echo>Check tasklist aggregator</ant:echo>
|
|
<x:set var="title" select="string($doc//body/section/table/tr[1]/th[22])"/>
|
|
<assert:assertEquals expected="All Tasks" value="${title}"/>
|
|
<x:set var="taskCount" select="string($doc/document/body/section/table/tr[3]/td[22]/a)"/>
|
|
<assert:assertEquals expected="3" value="${taskCount}"/>
|
|
|
|
<!-- SCM Changed Files aggregator test -->
|
|
<ant:echo>Check SCM changed file aggregator</ant:echo>
|
|
<x:set var="title" select="string($doc/document/body/section/table/tr[1]/th[23])"/>
|
|
<assert:assertEquals expected="SCM Changed Files" value="${title}"/>
|
|
<x:set var="taskCount" select="string($doc/document/body/section/table/tr[3]/td[23]/a)"/>
|
|
<assert:assertEquals expected="8" value="${taskCount}"/>
|
|
|
|
<!-- SCM Changed Commit aggregator test -->
|
|
<ant:echo>Check SCM commit aggregator</ant:echo>
|
|
<x:set var="title" select="string($doc/document/body/section/table/tr[1]/th[24])"/>
|
|
<assert:assertEquals expected="SCM commits" value="${title}"/>
|
|
<x:set var="taskCount" select="string($doc/document/body/section/table/tr[3]/td[24]/a)"/>
|
|
<assert:assertEquals expected="4" value="${taskCount}"/>
|
|
|
|
<!-- Check generation of the URL on the index page of each project -->
|
|
<ant:echo>Check that projects have a link to their index.html page</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[1]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/index.html" value="${URL}"/>
|
|
<x:set var="URLText" select="string($doc/document/body/section/table/tr[3]/td[1]/a)"/>
|
|
<assert:assertEquals expected="Test Individual Reports Not Generated By Dashboard" value="${URLText}"/>
|
|
|
|
<!-- Check the link generation to the detail reports -->
|
|
<!-- Subproject1 has report: we check that the link to the report exist -->
|
|
<ant:echo>Check that testIndividualReportsNotGeneratedByDashboard has a link to the checkstyle report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[2]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/checkstyle-report.html" value="${URL}"/>
|
|
<!-- testIndividualReportsGeneratedByDashboard has no HTML report generated (there are no
|
|
reports defined in subproject2's project.xml): we check that the link to the report does
|
|
not exist -->
|
|
<ant:echo>Check that testIndividualReportsGeneratedByDashboard has no link to the checkstyle report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[2]/td[2]/a/@href)"/>
|
|
<assert:assertEquals expected="" value="${URL}"/>
|
|
|
|
<!-- Now we check the link generation for all aggregators -->
|
|
<ant:echo>Check the link to the detailed report for each aggregator</ant:echo>
|
|
<!-- csall -->
|
|
<ant:echo> Check csallreport</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[2]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/checkstyle-report.html" value="${URL}"/>
|
|
<!-- cserrors -->
|
|
<ant:echo> Check cserrors report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[3]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/checkstyle-report.html" value="${URL}"/>
|
|
<!-- cswarnings -->
|
|
<ant:echo> Check cswarnings report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[4]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/checkstyle-report.html" value="${URL}"/>
|
|
<!-- csfiles -->
|
|
<ant:echo> Check csfiles report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[5]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/checkstyle-report.html" value="${URL}"/>
|
|
<!-- clovertpc -->
|
|
<ant:echo> Check clovertpc report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[6]/table/tr/td/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/clover/index.html" value="${URL}"/>
|
|
<!-- cloverloc -->
|
|
<ant:echo> Check cloverloc report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[7]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/clover/index.html" value="${URL}"/>
|
|
<!-- cloverncloc -->
|
|
<ant:echo> Check cloverncloc report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[8]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/clover/index.html" value="${URL}"/>
|
|
<!-- junittests -->
|
|
<ant:echo> Check junittests report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[9]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/junit-report.html" value="${URL}"/>
|
|
<!-- junitpassrate -->
|
|
<ant:echo> Check junitpassrate report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[10]/table/tr[1]/td[1]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/junit-report.html" value="${URL}"/>
|
|
<!-- junitfailures -->
|
|
<ant:echo> Check junitfailures report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[11]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/junit-report.html" value="${URL}"/>
|
|
<!-- juniterrors -->
|
|
<ant:echo> Check juniterrors report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[12]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/junit-report.html" value="${URL}"/>
|
|
<!-- simiantdl -->
|
|
<ant:echo> Check simiantdl report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[13]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/simian-report.html" value="${URL}"/>
|
|
<!-- pmdfiles -->
|
|
<ant:echo> Check pmdfiles report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[14]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/pmd-report.html" value="${URL}"/>
|
|
<!-- pmdviolations 15 -->
|
|
<ant:echo> Check pmdviolations report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[15]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/pmd-report.html" value="${URL}"/>
|
|
<!-- fbfiles -->
|
|
<ant:echo> Check fbfiles report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[16]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/findbugs-report.html" value="${URL}"/>
|
|
<!-- fbviolations -->
|
|
<ant:echo> Check fbviolations report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[17]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/findbugs-report.html" value="${URL}"/>
|
|
<!-- jcoveragelipc -->
|
|
<ant:echo> Check jcoveragelipc report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[18]/table/tr[1]/td[1]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/jcoverage/index.html" value="${URL}"/>
|
|
<!-- jcoverageloc -->
|
|
<ant:echo> Check jcoverageloc report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[19]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/jcoverage/index.html" value="${URL}"/>
|
|
<!-- tasklistclass -->
|
|
<ant:echo> Check tasklistclass report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[20]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/task-list.html" value="${URL}"/>
|
|
<!-- tasklistmethod -->
|
|
<ant:echo> Check tasklistmethod report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[21]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/task-list.html" value="${URL}"/>
|
|
<!-- tasklist -->
|
|
<ant:echo> Check tasklist report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[22]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/task-list.html" value="${URL}"/>
|
|
<!-- scmchangedfiles -->
|
|
<ant:echo> Check scmchangedfiles report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[23]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/file-activity-report.html" value="${URL}"/>
|
|
<!-- scmchangedcommit -->
|
|
<ant:echo> Check scmchangedcommit report</ant:echo>
|
|
<x:set var="URL" select="string($doc/document/body/section/table/tr[3]/td[24]/a/@href)"/>
|
|
<assert:assertEquals expected="multiproject/testIndividualReportsNotGeneratedByDashboard/changelog-report.html" value="${URL}"/>
|
|
|
|
</goal>
|
|
</project>
|