assertReports( new ArrayList(), child );
}
private void assertReports( List expectedPlugins, Model child )
{
Reporting childBuild = child.getReporting();
if ( expectedPlugins != null && !expectedPlugins.isEmpty() )
{
assertNotNull( childBuild );
Map childPluginsMap = childBuild.getReportPluginsAsMap();
if ( childPluginsMap != null )
{
assertEquals( expectedPlugins.size(), childPluginsMap.size() );
for ( Iterator it = expectedPlugins.iterator(); it.hasNext(); )
{
ReportPlugin expectedPlugin = (ReportPlugin) it.next();
ReportPlugin childPlugin = (ReportPlugin) childPluginsMap.get( expectedPlugin.getKey() );
assertReportsEqual( expectedPlugin, childPlugin );
}
}
else
{
fail( "child plugins collection is null, but expectations map is not." );
}
}
else
{
assertTrue( childBuild == null || childBuild.getPlugins() == null || childBuild.getPlugins().isEmpty() );
}
}