Package net.ggtools.grand.utils
Class AbstractAntTester
- java.lang.Object
-
- org.apache.tools.ant.BuildFileTest
-
- net.ggtools.grand.utils.AbstractAntTester
-
- Direct Known Subclasses:
AntProjectTest
,ConnectedToNodeFilterTest
,FromNodeFilterTest
,GrandTaskPropertyTest
,GrandTaskTest
,GraphCrawlerTest
,GraphFilterFactoryTest
,GraphFilterTypeTest
,IsolatedNodeFilterTest
,MissingNodeFilterTest
,NodeRemoverFilterTest
,PrefixedNodeFilterTest
,ToNodeFilterTest
public abstract class AbstractAntTester extends BuildFileTest
An abstract class for Ant test featuring a standard project setup and a tearDown method removing temporary file after running a test. This clean up is disabled is the test fails. However this behaviour can be overridden by setting theCleanupOnError
system property totrue
.- Author:
- Christophe Labouisse
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
JUNIT_TEST_NAME
Field JUNIT_TEST_NAME.protected static String
TEMP_FILE_PROP
Field TEMP_FILE_PROP.protected static String
TESTCASES_DIR
Field TESTCASES_DIR.org.junit.rules.TestWatcher
watchman
Field watchman.-
Fields inherited from class org.apache.tools.ant.BuildFileTest
project
-
-
Constructor Summary
Constructors Constructor Description AbstractAntTester()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
assertFullLogContaining(String substring)
Method assertFullLogContaining.protected void
assertTempFileMatchExpected(String reference)
Compares the temporary file with a reference file.protected void
expectFullLogContaining(String target, String log)
Assert that the given message has been logged when running the given target.-
Methods inherited from class org.apache.tools.ant.BuildFileTest
assertLogContaining, assertPropertyEquals, assertPropertySet, assertPropertyUnset, configureProject, configureProject, executeTarget, expectBuildException, expectBuildExceptionContaining, expectDebuglog, expectLog, expectLogContaining, expectOutput, expectOutputAndError, expectPropertySet, expectPropertySet, expectPropertyUnset, expectSpecificBuildException, getBuildException, getError, getFullLog, getLog, getOutput, getProject, getProjectDir, getResource
-
-
-
-
Field Detail
-
JUNIT_TEST_NAME
protected static final String JUNIT_TEST_NAME
Field JUNIT_TEST_NAME. (value is "junit.test.name")- See Also:
- Constant Field Values
-
TEMP_FILE_PROP
protected static final String TEMP_FILE_PROP
Field TEMP_FILE_PROP. (value is "temp.file")- See Also:
- Constant Field Values
-
TESTCASES_DIR
protected static final String TESTCASES_DIR
Field TESTCASES_DIR. (value is "src/test/resources/testcases/")- See Also:
- Constant Field Values
-
watchman
public final org.junit.rules.TestWatcher watchman
Field watchman.
-
-
Method Detail
-
assertTempFileMatchExpected
protected final void assertTempFileMatchExpected(String reference) throws IOException
Compares the temporary file with a reference file.- Parameters:
reference
- String- Throws:
IOException
- if comparator fails
-
assertFullLogContaining
protected final void assertFullLogContaining(String substring)
Method assertFullLogContaining.- Parameters:
substring
- String
-
-