public abstract class AbstractPmdReportTestCase
extends org.apache.maven.plugin.testing.AbstractMojoTestCase
Constructor and Description |
---|
AbstractPmdReportTestCase() |
Modifier and Type | Method and Description |
---|---|
protected AbstractPmdReport |
createReportMojo(String goal,
File pluginXmlFile) |
protected File |
generateReport(AbstractPmdReport mojo,
File pluginXmlFile) |
protected File |
generateReport(String goal,
String pluginXml)
Generate the report and return the generated file
|
protected File |
getGeneratedReport(String name)
Get the generated report as file in the test maven project.
|
protected org.apache.maven.project.MavenProject |
getTestMavenProject()
Get the current Maven project
|
static boolean |
lowerCaseContains(String text,
String contains)
Checks, whether the string
contained is contained in
the given text ignoring case. |
protected String |
readFile(File pmdTestDir,
String fileName)
Read the contents of the specified file object into a string
|
protected void |
setUp() |
addGuiceModules, configureMojo, configureMojo, extractPluginConfiguration, extractPluginConfiguration, getContainer, getPluginDescriptorLocation, getPluginDescriptorPath, getPublicDescriptorStream, getVariablesAndValuesFromObject, getVariablesAndValuesFromObject, getVariableValueFromObject, lookupConfiguredMojo, lookupConfiguredMojo, lookupEmptyMojo, lookupEmptyMojo, lookupMojo, lookupMojo, lookupMojo, newMavenSession, newMojoExecution, setupContainer, setupContainerConfiguration, setVariableValueToObject
customizeContainerConfiguration, customizeContext, getBasedir, getClassLoader, getConfigurationName, getCustomConfigurationName, getResourceAsStream, getTestConfiguration, getTestConfiguration, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, lookup, lookup, release, tearDown, teardownContainer
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
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
protected void setUp() throws Exception
setUp
in class org.apache.maven.plugin.testing.AbstractMojoTestCase
Exception
protected org.apache.maven.project.MavenProject getTestMavenProject()
protected File getGeneratedReport(String name) throws IOException
name
- the name of the report.IOException
- if the return file doesnt existprotected File generateReport(String goal, String pluginXml) throws Exception
goal
- the mojo goal.pluginXml
- the name of the xml file in "src/test/resources/plugin-configs/".Exception
- if anyprotected AbstractPmdReport createReportMojo(String goal, File pluginXmlFile) throws Exception
Exception
protected File generateReport(AbstractPmdReport mojo, File pluginXmlFile) throws Exception
Exception
protected String readFile(File pmdTestDir, String fileName) throws IOException
IOException
public static boolean lowerCaseContains(String text, String contains)
contained
is contained in
the given text
ignoring case.text
- the string in which the search is executedcontains
- the string, the should be searchedtrue
if the string is contained, otherwise false
.Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.