Package net.sourceforge.pmd.test
Class AbstractAntTestHelper
- java.lang.Object
-
- net.sourceforge.pmd.test.AbstractAntTestHelper
-
public abstract class AbstractAntTestHelper extends Object
Base test class for ant tests.Usage template:
class MyPMDTaskTest extends AbstractAntTestHelper { MyPMDTaskTest() { antTestScriptFilename = "mypmdtasktest.xml"; } @Test void myTest() { executeTarget("testMyTarget"); assertOutputContaining("Expected Violation Message"); } }- Author:
- Romain Pelisse <[email protected]>
-
-
Field Summary
Fields Modifier and Type Field Description protected StringantTestScriptFilenameprotected StringpathToTestScript
-
Constructor Summary
Constructors Constructor Description AbstractAntTestHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertContains(String text, String toFind)voidassertDoesntContain(String text, String toFind)voidassertOutputContaining(String text)FilecurrentTempFile()Returns the current temporary file.StringexecuteTarget(String target)protected StringgetLog()voidsetUp()
-
-
-
Method Detail
-
setUp
@BeforeEach public void setUp() throws IOException- Throws:
IOException
-
currentTempFile
public File currentTempFile()
Returns the current temporary file. Replaced by a fresh (inexistent) file before each test.
-
getLog
protected String getLog()
-
assertOutputContaining
public void assertOutputContaining(String text)
-
-