Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/test/java/org/spdx/tools/VerifyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class VerifyTest extends TestCase {
static final String TEST_WARNING_FILE_PATH = TEST_DIR + File.separator + "SPDXTagExample-v2.2-warning.spdx";
static final String BAD_JSON_FILE_PATH = TEST_DIR + File.separator + "BadJSON.spdx.json";
static final String DOUBLE_JSON_LD_FILE_PATH = TEST_DIR + File.separator + "double.jsonld";
static final String JSONLD_CASE_SENSITIVE_ID = TEST_DIR + File.separator + "SPDXJsonLDExample-casesensitive.json";

protected void setUp() throws Exception {
super.setUp();
Expand Down Expand Up @@ -106,4 +107,9 @@ public void testVerifyDouble() throws SpdxVerificationException {
List<String> result = Verify.verify(DOUBLE_JSON_LD_FILE_PATH, SerFileType.JSONLD);
assertEquals(0, result.size());
}

public void testCaseSensitive() throws SpdxVerificationException {
List<String> result = Verify.verify(JSONLD_CASE_SENSITIVE_ID, SerFileType.JSONLD);
assertTrue(result.isEmpty());
}
}
98 changes: 98 additions & 0 deletions testResources/SPDXJsonLDExample-casesensitive.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"@context": "https://spdx.org/rdf/3.0.1/spdx-context.jsonld",
"@graph": [
{
"type": "CreationInfo",
"@id": "_:creationinfo",
"createdBy": [
"http://spdx.example.com/Agent/JoshuaWatt"
],
"specVersion": "3.0.1",
"created": "2024-03-06T00:00:00Z"
},
{
"type": "Person",
"spdxId": "http://spdx.example.com/Agent/JoshuaWatt",
"name": "Joshua Watt",
"creationInfo": "_:creationinfo",
"externalIdentifier": [
{
"type": "ExternalIdentifier",
"externalIdentifierType": "email",
"identifier": "JPEWhacker@gmail.com"
}
]
},
{
"type": "SpdxDocument",
"spdxId": "http://spdx.example.com/Document1",
"creationInfo": "_:creationinfo",
"rootElement": [
"http://spdx.example.com/BOM1"
],
"element": [
"http://spdx.example.com/BOM1",
"http://spdx.example.com/Agent/JoshuaWatt",
"http://spdx.example.com/Package1/myprogram",
"http://spdx.example.com/Relationship/1"
],
"profileConformance": [
"core",
"software"
]
},
{
"type": "software_Sbom",
"spdxId": "http://spdx.example.com/BOM1",
"creationInfo": "_:creationinfo",
"rootElement": [
"http://spdx.example.com/Package1"
],
"element": [
"http://spdx.example.com/Package1/myprogram",
"http://spdx.example.com/Package1"
],
"software_sbomType": [
"build"
]
},
{
"type": "software_Package",
"spdxId": "http://spdx.example.com/MyProgram",
"creationInfo": "_:creationinfo",
"name": "my-package",
"software_packageVersion": "1.0",
"software_downloadLocation": "http://dl.example.com/my-package_1.0.0.tar",
"builtTime": "2024-03-06T00:00:00Z",
"originatedBy": [
"http://spdx.example.com/Agent/JoshuaWatt"
]
},
{
"type": "software_File",
"spdxId": "http://spdx.example.com/myprogram",
"creationInfo": "_:creationinfo",
"name": "myprogram",
"software_primaryPurpose": "executable",
"software_additionalPurpose": [
"application"
],
"software_copyrightText": "Copyright 2024, Joshua Watt",
"builtTime": "2024-03-06T00:00:00Z",
"originatedBy": [
"http://spdx.example.com/Agent/JoshuaWatt"
]
},
{
"type": "Relationship",
"spdxId": "http://spdx.example.com/Relationship/1",
"creationInfo": "_:creationinfo",
"from": "http://spdx.example.com/Package1",
"relationshipType": "contains",
"to": [
"http://spdx.example.com/Package1/myprogram"
],
"completeness": "complete"
}
]
}
Loading