Class SimpleLicenseTester
java.lang.Object
org.spdx.licenselistpublisher.licensegenerator.SimpleLicenseTester
- All Implemented Interfaces:
ILicenseTester
Tests licenses against cononical text.
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetExceptionTestText(String licenseExceptionId) getLicenseTestText(String licenseId) testException(ListedExceptionContainer exceptionContainer) Test exception against the test files directorytestLicense(ListedLicenseContainer licenseContainer) Test a license against the license test files
-
Constructor Details
-
SimpleLicenseTester
- Parameters:
testFileDir- Directory containing license texts in the format [license-id].txt
-
-
Method Details
-
testException
public List<String> testException(ListedExceptionContainer exceptionContainer) throws IOException, org.spdx.core.InvalidSPDXAnalysisException Description copied from interface:ILicenseTesterTest exception against the test files directory- Specified by:
testExceptionin interfaceILicenseTester- Parameters:
exceptionContainer-- Returns:
- Throws:
IOExceptionorg.spdx.core.InvalidSPDXAnalysisException
-
testLicense
public List<String> testLicense(ListedLicenseContainer licenseContainer) throws IOException, org.spdx.core.InvalidSPDXAnalysisException Description copied from interface:ILicenseTesterTest a license against the license test files- Specified by:
testLicensein interfaceILicenseTester- Parameters:
licenseContainer- license to test- Returns:
- list of test failure descriptions. List is empty if all tests pass.
- Throws:
IOExceptionorg.spdx.core.InvalidSPDXAnalysisException
-
getLicenseTestText
- Specified by:
getLicenseTestTextin interfaceILicenseTester- Parameters:
licenseId-- Returns:
- text for the test for a license ID, null if no license text is found
- Throws:
IOException
-
getExceptionTestText
- Specified by:
getExceptionTestTextin interfaceILicenseTester- Parameters:
licenseExceptionId-- Returns:
- text for the test for a exception ID, null if no license text is found
- Throws:
IOException
-