/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008 Sun Microsystems, Inc.
* Portions copyright 2012 ForgeRock AS.
*/
private boolean verbose = false;
private boolean enabled = true;
"TD,TH {background:white;margin:0;line-height:100%;padding-left:0.5em;padding-right:0.5em;} " +
"TD {border-width:0 1px 0 0;} TH {border-width:1px 1px 1px 0;} " +
"TR TD.h {color:red;} " +
"TABLE {border-spacing:0; border-collapse:collapse;border-width:0 0 1px 1px;} " +
"P,H1,H2,H3,TH {font-family:verdana,arial,sans-serif;font-size:10pt;} " +
"TD {font-family:courier,monospace;font-size:10pt;} " +
"TABLE.hdft {border-spacing:0;border-collapse:collapse;border-style:none;} " +
"TABLE.hdft TH,TABLE.hdft TD {border-style:none;line-height:normal;} " +
"TABLE.hdft TH.tl,TABLE.hdft TD.tl {background:#6699CC;color:white;} " +
"TABLE.hdft TD.nv {background:#6633DD;color:white;} " +
".nv A:link {color:white;} .nv A:visited {color:white;} " +
".nv A:active {color:yellow;} " +
"TABLE.hdft A:link {color:white;} " +
"TABLE.hdft A:visited {color:white;} " +
"TABLE.hdft A:active {color:yellow;} " +
".in {color:#356085;} " +
"TABLE.s TD {padding-left:0.25em;padding-right:0.25em;} " +
"TABLE.s TD.ddt {padding-left:0.25em;padding-right:0.25em;color:#AAAAAA;}" +
"TABLE.s TD.ds {padding-left:0.25em;padding-right:0.25em;text-align:right;background:#F0F0F0;} " +
"TABLE.s TD.dm {padding-left:0.25em;padding-right:0.25em;text-align:right;background:#BCCFF9;} " +
"TABLE.s TD.dd {padding-left:0.25em;padding-right:0.25em;text-align:right;background:#AAAAAA;color:#FFFFFF} " +
"TABLE.s TH {padding-left:0.25em;padding-right:0.25em;text-align:left;background:#F0F0F0;} " +
"TABLE.s TD.cz {background:#FF9999;} " +
"TABLE.s TD.cp {background:#FFFF88;} " +
"TABLE.s TD.cc {background:#CCFFCC;} " +
"A:link {color:#0000EE;text-decoration:none;} " +
"A:visited {color:#0000EE;text-decoration:none;} " +
"A:hover {color:#0000EE;text-decoration:underline;} " +
"TABLE.cn {border-width:0 0 1px 0;} " +
"TABLE.s {border-width:1px 0 1px 1px;} " +
"TD.h {color:red;border-width:0 1px 0 0;} " +
"TD.f {border-width:0 1px 0 1px;} " +
"TD.hf {color:red;border-width:0 1px 0 1px;} " +
"TH.f {border-width:1px 1px 1px 1px;} " +
"TR.cis TD {background:#F0F0F0;} " +
"TR.cis TD {border-width:1px 1px 1px 0;} " +
"TR.cis TD.h {color:red;border-width:1px 1px 1px 0;} " +
"TR.cis TD.f {border-width:1px 1px 1px 1px;} " +
"TR.cis TD.hf {color:red;border-width:1px 1px 1px 1px;} " +
"TD.b {border-style:none;background:transparent;line-height:50%;} " +
"TD.bt {border-width:1px 0 0 0;background:transparent;line-height:50%;} " +
"TR.o TD {background:#F0F0F0;}" +
"TABLE.it {border-style:none;}" +
"TABLE.it TD,TABLE.it TH {border-style:none;}";
// The SVN revision to perform the diff against when calculating
// the coverage diff. It can be a revision number, a timestamp,
// or a revision keyword (BASE, COMMITTED, and PREV make the
// most sense). The primary use case for this setting is to do
// a coverage diff against the previous revision when there are
// no changes in the working copy. It defaults to BASE.
{
}
{
}
{
}
{
}
{
}
{
this.fromRevision = fromRevision;
}
try {
innerExecute();
} catch (BuildException e) {
throw e;
} catch (Throwable e) {
e.printStackTrace();
}
}
{
verboseOut("Starting to execute coveragediff.");
if(emmaDataPath == null)
{
throw new BuildException("emmaDataPath attribute is not set. It must be set to the path of the EMMA data directory");
}
if(outputPath == null)
{
throw new BuildException("outputPath attribute is not set. It must be set to a valid directory where the report will be generated");
}
if(fromRevision == null)
{
throw new BuildException("fromRevision attribute is not set. It must be set to the revision from which the diff is generated (e.g. BASE).");
}
if(!enabled)
{
return;
}
// So we can go over http:// and https:// when diff'ing against previous versions
try
{
verboseOut("Loaded EMMA data.");
}
catch(IOException ie)
{
"data. Report will not contain any coverage information.");
}
try
{
}
catch(IOException ie)
{
System.out.println("ERROR: An error occurred while processing diff output: " + ie.toString() + " Quitting...");
return;
}
}
{
if(emmaCoverageDataDir == null)
{
throw new IOException("Emma Converage Data Directory is null");
}
int emmaCoverageDataFileCount = 0;
{
throw new IOException("No EMMA data files found");
}
verboseOut("processing input files ...");
// merge all data files:
else
}
else
}
}
verboseOut(emmaCoverageDataFileCount + " file(s) read and merged in " + (System.currentTimeMillis() - start) + " ms");
return null;
}
return null;
}
System.out.println("no collected coverage data found in any of the data files [Diff output will not include coverage data]");
return null;
}
System.out.println("no collected line coverage data found in any of the data files [Diff output will not include coverage data]");
return null;
}
return m_view;
}
throws IOException, SVNException {
// Most often this will be 'BASE' but it could also be 'PREVIOUS'
diffFile)));
}
throws IOException {
new BufferedWriter (new OutputStreamWriter (
{
//Diffed file
{
}
else
{
}
}
{
if (modCoverage != null) {
}
}
{
}
else
{
}
}
if(emmaDataView != null)
{
}
else
{
}
boolean odd = true;
int count = 0;
"s" + count, true, true);
count++;
}
}
}
throws IOException
{
{
return;
}
//Try to get the package information if its a Java file
if(srcFilePath.isFile())
{
if(emmaDataView != null)
{
}
}
//Figure out the flag for the working copy.
// Skip over binary files
return;
}
{
}
else
{
}
{
}
else
{
}
{
workingCopyFlag = "+";
otherCopyFlag = "-";
}
{
}
else
{
{
//Found a chunk indicator.
{
if(chunkModCoverage != null)
{
}
}
//Not any of the above so this line must be diffed text
else
{
}
}
//Finishing process whatever we have queued up
if(chunkModCoverage != null)
{
}
}
{
}
{
}
if(emmaSourceItem != null)
{
addItemRow(srcFilePath.toString(), emmaSourceItem, modCoverage, false, coverageTable, null, false, false);
}
else
{
html.addH(2, "Coverage Information Not Available (e.g. file is not in src/, is not java, is an interface, or was deleted)", null);
}
{
}
}
{
{
return null;
}
int workingCopyBegin;
int workingCopyRange;
int otherCopyBegin;
if(emmaSrcItem != null)
{
}
int workingCopyLine = workingCopyBegin;
int otherCopyLine = otherCopyBegin;
{
if(lineCoverageMap != null)
{
}
} else {
}
//This line is either a modified line or a unchanged line
{
//Determine if this line is a modified line or a unchange line
{
modCoverage[MOD_LINES] ++;
if(lCoverageData != null)
{
modCoverage[MOD_EXE_LINES] ++;
switch(lCoverageData.m_coverageStatus)
{
break;
break;
break;
default:
}
}
}
else
{
}
}
else
{
modCoverage[DEL_LINES] ++;
}
{
}
{
}
}
return modCoverage;
}
throws IOException {
new InputStreamReader(srcFile));
{
if(beginIdx > -1)
{
if(endIdx > -1)
{
}
}
}
return null;
}
{
{
return null;
}
{
{
{
{
return sourceItem;
}
}
}
}
return null;
}
{
// header row:
if(includeName)
{
}
for (int c = 1; c <= 4; ++ c)
{
{
}
{
}
else
{
}
}
{
}
else
{
}
}
/*
* No header row, just data rows.
*/
final Double[] modCoverage,
final boolean odd,
final boolean anchor,
final boolean includeName)
{
if(includeName)
{
{
}
else
{
}
}
for (int c = 1; c <=4; ++ c)
{
{
}
{
//final boolean fail = (m_metrics [attrID] > 0) && ! attr.passes (item, m_metrics [attrID]);
//if (fail) cell.setClass (CSS_DATA_HIGHLIGHT);
}
else
{
}
}
{
{
}
else
{
}
}
else
{
}
}
// Enable this with -Dtest.diff.verbose=true from the commandline
{
if (verbose)
{
}
}
}