Package org.apache.rat
Class ReporterTestUtils
java.lang.Object
org.apache.rat.ReporterTestUtils
Utilities to help analyze report test output.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringapacheLicenseVersion2(int count) Generates the report contents for Apache 2.0 licenses.static StringcounterText(ClaimStatistic.Counter counter, int count, boolean error) Renders report contents of a given counter value, including handling of negation.static StringdocumentOut(boolean approved, Document.Type type, String name) Generates the regex string for a document output line.static StringlicenseOut(String family, String name) Generates the regex string for a license output line.static StringlicenseOut(String family, String id, String name) Generates the regex string for a license output line.static StringunknownLicense(int count) Generates the report contents for unknown licenses.
-
Field Details
-
UNKNOWN_LICENSE
The default license output for an unknown license -
APACHE_LICENSE
The default license output for an Apache 2 license
-
-
Method Details
-
documentOut
Generates the regex string for a document output line. Suitable for regex query.- Parameters:
approved-Trueif this license is approvedtype- The document type.name- The name of the document.- Returns:
- the regular expression string representing the document.
-
licenseOut
Generates the regex string for a license output line. Suitable for regex query.- Parameters:
family- The license family category.name- The license name.- Returns:
- the regular expression string representing the license.
-
licenseOut
Generates the regex string for a license output line. Suitable for regex query.- Parameters:
family- The license family category.id- The license id if different from family.name- The license name.- Returns:
- the regular expression string representing the license.
-
counterText
Renders report contents of a given counter value, including handling of negation.- Parameters:
counter- The expected type of counter in the report.count- The expected number of occurrences of the given counter.error-Trueif the counter does exceed a minimum or maximum value.- Returns:
- the report contents of the given counter.
-
apacheLicenseVersion2
Generates the report contents for Apache 2.0 licenses.- Parameters:
count- The expected number of occurrences of the license.- Returns:
- Report contents for Apache 2.0 licenses in the report.
-
unknownLicense
Generates the report contents for unknown licenses.- Parameters:
count- The expected number of occurrences of the license.- Returns:
- Report contents for unknown licenses in the report.
-