Class AbstractIgnoreBuilderTest
java.lang.Object
org.apache.rat.config.exclusion.fileprocessors.AbstractIgnoreBuilderTest
- Direct Known Subclasses:
BazaarIgnoreBuilderTest,CVSIgnoreBuilderTest,GitIgnoreBuilderTest,HgIgnoreBuilderTest
The base class for FileProcessor builder tests.
Provides supporting methods for creating test files and for validating results.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertCorrect(List<MatcherSet> matcherSets, DocumentName baseDir, Iterable<String> matching, Iterable<String> notMatching) Asserts the correctness of the matcher.protected voidassertCorrect(AbstractFileProcessorBuilder builder, Iterable<String> matching, Iterable<String> notMatching) Asserts the correctness of the excluder.protected voidsetup()protected FileWrites a text file to the baseDir directory.
-
Field Details
-
tmpPath
-
baseName
-
-
Constructor Details
-
AbstractIgnoreBuilderTest
public AbstractIgnoreBuilderTest()
-
-
Method Details
-
setup
@BeforeEach protected void setup() -
writeFile
Writes a text file to the baseDir directory.- Parameters:
name- the name of the file.lines- the lines to write to the file.- Returns:
- the File that was written.
- Throws:
IOException- if file cannot be created.
-
assertCorrect
protected void assertCorrect(AbstractFileProcessorBuilder builder, Iterable<String> matching, Iterable<String> notMatching) Asserts the correctness of the excluder. An excluder returns false if the document name is matched.- Parameters:
builder- An FileProcessorBuilder that will create the excluder.matching- the matching strings.notMatching- the non-matching strings.
-
assertCorrect
protected void assertCorrect(List<MatcherSet> matcherSets, DocumentName baseDir, Iterable<String> matching, Iterable<String> notMatching) Asserts the correctness of the matcher.- Parameters:
matcherSets- the list of matchers to create the DocumentNameMatcher from.baseDir- the base directory for the excluder test.matching- the matching strings (i.e. that should be ignored)notMatching- the non-matching strings (i.e. that should be checked)
-