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, PluginManagementReportTest, ProjectIndexPageReportTest, ProjectSummaryReportTest, ScmReportTest, TeamListReportTest

public abstract class AbstractProjectInfoTestCase
extends org.apache.maven.plugin.testing.AbstractMojoTestCase

Abstract class to test reports generation with HTTPUnit framework.

Version:
$Id: AbstractProjectInfoTestCase.java 728546 2008-12-21 22:56:51Z bentmann $
Author:
Edwin Punzalan, Vincent Siveton

Field Summary
protected static java.util.Locale DEFAULT_LOCALE
          The default locale is English.
 
Fields inherited from class org.codehaus.plexus.PlexusTestCase
basedir, container
 
Constructor Summary
AbstractProjectInfoTestCase()
           
 
Method Summary
protected  java.io.File generateReport(java.lang.String goal, java.lang.String pluginXml)
          Generate the report and return the generated file
protected  java.io.InputStream getCustomConfiguration()
          
protected  java.io.File getGeneratedReport(java.lang.String name)
          Get the generated report as file in the test maven project.
protected  java.lang.String getString(java.lang.String key)
          Gets a trimmed String for the given key from the resource bundle defined by Plexus.
protected  org.apache.maven.project.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 java.util.Locale DEFAULT_LOCALE
The default locale is English.

Constructor Detail

AbstractProjectInfoTestCase

public AbstractProjectInfoTestCase()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception

Overrides:
setUp in class org.apache.maven.plugin.testing.AbstractMojoTestCase
Throws:
java.lang.Exception

getCustomConfiguration

protected java.io.InputStream getCustomConfiguration()
                                              throws java.lang.Exception

Overrides:
getCustomConfiguration in class org.codehaus.plexus.PlexusTestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception

Overrides:
tearDown in class org.codehaus.plexus.PlexusTestCase
Throws:
java.lang.Exception

getString

protected java.lang.String getString(java.lang.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
Throws:
java.lang.IllegalArgumentException - if the parameter is empty.

getTestMavenProject

protected org.apache.maven.project.MavenProject getTestMavenProject()
Get the current Maven project

Returns:
the maven project

getGeneratedReport

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

Returns:
the generated report as file
Throws:
java.io.IOException - if the return file doesnt exist

generateReport

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

Parameters:
goal -
pluginXml -
Returns:
the generated HTML file
Throws:
java.lang.Exception - if any


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