Class LicenseXmlTester
java.lang.Object
org.spdx.licenselistpublisher.LicenseXmlTester
Tests a license XML file against license text expected to match
TestLicenseXML licenseXmlFile textFile
licenseXmlFile XML - file
textFile - Text file which should match the license text for the licenseXmlFile
testDirectory - optional directory of text files to test with the pattern {license-id}/(license|header|exception)/(good|bad)/{test-id}.txt
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LicenseXmlTester
public LicenseXmlTester()
-
-
Method Details
-
main
- Parameters:
args- arguments - see usage for documentation
-
testLicenseXml
public static List<String> testLicenseXml(File licenseXmlFile, File testFile, @Nullable File testDirectory) throws org.spdx.core.InvalidSPDXAnalysisException, LicenseXmlException, IOException, org.spdx.utility.compare.SpdxCompareException test a license XML against a single file and optionally a directory of test files- Parameters:
licenseXmlFile- file in LicenseXML FormattestFile- single file to comparetestDirectory- optional directory to test against with the pattern {license-id}/(license|header|exception)/(good|bad)/{test-id}.txt- Returns:
- list of errors when comparing - if empty, no errors occurs
- Throws:
org.spdx.core.InvalidSPDXAnalysisException- on SPDX parsing errorsLicenseXmlException- on errors parsing the LicenseXMLIOException- on errors reading either the XML or test filesorg.spdx.utility.compare.SpdxCompareException
-