- Addeed JavaNCSS aggregators (Contributed by Siegfried Goeschl) git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@125594 13f79535-47bb-0310-9956-ffa450edef68
96 lines
3.9 KiB
XML
96 lines
3.9 KiB
XML
<!--
|
|
/*
|
|
* Copyright 2001-2004 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"/>
|
|
|
|
<!-- Call goal to test -->
|
|
<j:set var="maven.multiproject.site.goals" value="site,dashboard:report-single"/>
|
|
<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}"/>
|
|
|
|
<x:set var="count" select="count($doc//body/section/table/tr)"/>
|
|
<assert:assertEquals expected="4" value="${count.intValue().toString()}"/>
|
|
|
|
<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)"/>
|
|
<!-- One column for the project name and one for the 23 aggregators -->
|
|
<assert:assertEquals expected="29" value="${countTitleColumn.intValue().toString()}"/>
|
|
<assert:assertEquals expected="29" value="${countContentColumn.intValue().toString()}"/>
|
|
|
|
<!-- TasklistClass aggregator test -->
|
|
<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[2]/td[20])"/>
|
|
<assert:assertEquals expected="1" value="${taskCount}"/>
|
|
|
|
<!-- TasklistMethod aggregator test -->
|
|
<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[2]/td[21])"/>
|
|
<assert:assertEquals expected="2" value="${taskCount}"/>
|
|
|
|
<!-- Tasklist aggregator test -->
|
|
<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[2]/td[22])"/>
|
|
<assert:assertEquals expected="3" value="${taskCount}"/>
|
|
|
|
<!-- SCM Changed Files aggregator test -->
|
|
<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[2]/td[23])"/>
|
|
<assert:assertEquals expected="8" value="${taskCount}"/>
|
|
|
|
<!-- SCM Changed Commit aggregator test -->
|
|
<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[2]/td[24])"/>
|
|
<assert:assertEquals expected="4" value="${taskCount}"/>
|
|
|
|
|
|
|
|
|
|
</goal>
|
|
</project>
|