Class SimpleLicenseTester
java.lang.Object
org.spdx.licenselistpublisher.licensegenerator.SimpleLicenseTester
- All Implemented Interfaces:
ILicenseTester
public class SimpleLicenseTester extends Object implements ILicenseTester
Tests licenses against cononical text.
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors Constructor Description SimpleLicenseTester(File testFileDir) -
Method Summary
Modifier and Type Method Description StringgetExceptionTestText(String licenseExceptionId)StringgetLicenseTestText(String licenseId)List<String>testException(org.spdx.library.model.license.LicenseException exception)Test exception against the test files directoryList<String>testLicense(org.spdx.library.model.license.License license)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(org.spdx.library.model.license.LicenseException exception) throws IOException, org.spdx.library.InvalidSPDXAnalysisExceptionDescription copied from interface:ILicenseTesterTest exception against the test files directory- Specified by:
testExceptionin interfaceILicenseTester- Returns:
- Throws:
IOExceptionorg.spdx.library.InvalidSPDXAnalysisException
-
testLicense
public List<String> testLicense(org.spdx.library.model.license.License license) throws IOException, org.spdx.library.InvalidSPDXAnalysisExceptionDescription copied from interface:ILicenseTesterTest a license against the license test files- Specified by:
testLicensein interfaceILicenseTester- Parameters:
license- license to test- Returns:
- list of test failure descriptions. List is empty if all tests pass.
- Throws:
IOExceptionorg.spdx.library.InvalidSPDXAnalysisException
-
getLicenseTestText
- Specified by:
getLicenseTestTextin interfaceILicenseTester- Returns:
- text for the test for a license ID, null if no license text is found
- Throws:
IOException
-
getExceptionTestText
- Specified by:
getExceptionTestTextin interfaceILicenseTester- Returns:
- text for the test for a exception ID, null if no license text is found
- Throws:
IOException
-