org.apache.maven.report.projectinfo
Class AbstractProjectInfoTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.codehaus.plexus.PlexusTestCase
              extended by org.apache.maven.plugin.testing.AbstractMojoTestCase
                  extended by org.apache.maven.report.projectinfo.AbstractProjectInfoTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
CimReportTest, DependenciesReportTest, DependencyConvergenceReportTest, DependencyManagementReportTest, IssueTrackingReportTest, LicenseReportTest, MailingListsReportTest, ModulesReportTest, PluginManagementReportTest, ProjectIndexPageReportTest, ProjectSummaryReportTest, ScmReportTest, TeamListReportTest

public abstract class AbstractProjectInfoTestCase
extends AbstractMojoTestCase

Abstract class to test reports generation with HTTPUnit framework.

Version:
$Id: AbstractProjectInfoTestCase.java 1100828 2011-05-08 22:34:59Z hboutemy $
Author:
Edwin Punzalan, Vincent Siveton

Field Summary
protected static Locale DEFAULT_LOCALE
          The default locale is English.
 
Fields inherited from class org.codehaus.plexus.PlexusTestCase
basedir, container
 
Constructor Summary
AbstractProjectInfoTestCase()
           
 
Method Summary
protected  File generateReport(String goal, String pluginXml)
          Generate the report and return the generated file
protected  InputStream getCustomConfiguration()
           
protected  File getGeneratedReport(String name)
          Get the generated report as file in the test maven project.
protected  String getString(String key)
          Gets a trimmed String for the given key from the resource bundle defined by Plexus.
protected  MavenProject getTestMavenProject()
          Get the current Maven project
protected  void setUp()
           
protected  void tearDown()
           
 
Methods inherited from class org.apache.maven.plugin.testing.AbstractMojoTestCase
configureMojo, configureMojo, extractPluginConfiguration, extractPluginConfiguration, getVariablesAndValuesFromObject, getVariablesAndValuesFromObject, getVariableValueFromObject, lookupEmptyMojo, lookupEmptyMojo, lookupMojo, lookupMojo, lookupMojo, setVariableValueToObject
 
Methods inherited from class org.codehaus.plexus.PlexusTestCase
createContainerInstance, customizeContext, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getContainer, getResourceAsStream, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, release
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_LOCALE

protected static final Locale DEFAULT_LOCALE
The default locale is English.

Constructor Detail

AbstractProjectInfoTestCase

public AbstractProjectInfoTestCase()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class AbstractMojoTestCase
Throws:
Exception

getCustomConfiguration

protected InputStream getCustomConfiguration()
                                      throws Exception
Overrides:
getCustomConfiguration in class org.codehaus.plexus.PlexusTestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class org.codehaus.plexus.PlexusTestCase
Throws:
Exception

getString

protected String getString(String key)
Gets a trimmed String for the given key from the resource bundle defined by Plexus.

Parameters:
key - the key for the desired string
Returns:
the string for the given key

getTestMavenProject

protected MavenProject getTestMavenProject()
Get the current Maven project

Returns:
the maven project

getGeneratedReport

protected File getGeneratedReport(String name)
                           throws IOException
Get the generated report as file in the test maven project.

Parameters:
name - the name of the report.
Returns:
the generated report as file
Throws:
IOException - if the return file doesnt exist

generateReport

protected File generateReport(String goal,
                              String pluginXml)
                       throws Exception
Generate the report and return the generated file

Parameters:
goal - the mojo goal.
pluginXml - the name of the xml file in "src/test/resources/plugin-configs/".
Returns:
the generated HTML file
Throws:
Exception - if any


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.