Skip to content

Commit 6aa6fba

Browse files
committed
tests: examples
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 714813c commit 6aa6fba

File tree

3 files changed

+77
-28
lines changed

3 files changed

+77
-28
lines changed

tools/src/test/resources/1.7/valid-license-expression-with-text-1.7.json

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@
22
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
33
"bomFormat": "CycloneDX",
44
"specVersion": "1.7",
5-
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
5+
"serialNumber": "urn:uuid:8ad91ceb-1741-4d58-8d22-4488a0f68dbe",
66
"version": 1,
77
"components": [
88
{
99
"type": "application",
10-
"publisher": "Acme Inc",
11-
"group": "com.acme",
12-
"name": "tomcat-catalina",
13-
"version": "9.0.14",
14-
"description": "Modified version of Apache Catalina",
15-
"scope": "required",
10+
"name": "my-application",
11+
"version": "1.33.7",
12+
"description": "This application is composed of multiple things, and therefore has multiple licenses applied:\n* custom code - custom license\n* component A - EPL or GPL\n* component B - MIT\n* component C - MIT",
1613
"licenses": [
1714
{
1815
"bom-ref": "my-license",
1916
"acknowledgement": "declared",
20-
"expression": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
17+
"expression": "LicenseRef-my-custom-license AND (EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0) AND MIT",
2118
"expressionDetails": [
19+
{
20+
"licenseIdentifier": "LicenseRef-my-custom-license",
21+
"text": {
22+
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
23+
}
24+
},
2225
{
2326
"licenseIdentifier": "EPL-2.0",
2427
"text": {
@@ -31,11 +34,22 @@
3134
"contentType": "text/plain",
3235
"content": " GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed...\n\n...\n\nLinking this library statically or dynamically with other modules is making a combined work based on this library..."
3336
}
37+
},
38+
{
39+
"licenseIdentifier": "MIT",
40+
"text": {
41+
"content": "MIT License\n\nCopyright (c) 1996 Component-B-Creators Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"),..."
42+
}
43+
},
44+
{
45+
"licenseIdentifier": "MIT",
46+
"text": {
47+
"content": "MIT License\n\nCopyright (c) 2001 Component-C-Creators Org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"),..."
48+
}
3449
}
3550
]
3651
}
37-
],
38-
"purl": "pkg:maven/com.acme/[email protected]?packaging=jar"
52+
]
3953
}
4054
]
4155
}

tools/src/test/resources/1.7/valid-license-expression-with-text-1.7.textproto

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,23 @@
33

44
spec_version: "1.7"
55
version: 1
6-
serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
6+
serial_number: "urn:uuid:8ad91ceb-1741-4d58-8d22-4488a0f68dbe"
77
components {
88
type: CLASSIFICATION_APPLICATION
9-
publisher: "Acme Inc"
10-
group: "com.acme"
11-
name: "tomcat-catalina"
12-
version: "9.0.14"
13-
description: "Modified version of Apache Catalina"
14-
scope: SCOPE_REQUIRED
9+
name: "my-application"
10+
version: "1.33.7"
11+
description: "This application is composed of multiple things, and therefore has multiple licenses applied:\n* custom code - custom license\n* component A - EPL or GPL\n* component B - MIT\n* component C - MIT"
1512
licenses {
1613
expression_detailed {
1714
bom_ref: "my-license"
1815
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED
19-
expression: "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0"
16+
expression: "LicenseRef-my-custom-license AND (EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0) AND MIT"
17+
details {
18+
license_identifier: "LicenseRef-my-custom-license"
19+
text {
20+
value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
21+
}
22+
}
2023
details {
2124
license_identifier: "EPL-2.0"
2225
text {
@@ -30,7 +33,18 @@ components {
3033
value: " GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed...\n\n...\n\nLinking this library statically or dynamically with other modules is making a combined work based on this library..."
3134
}
3235
}
36+
details {
37+
license_identifier: "MIT"
38+
text {
39+
value: "MIT License\n\nCopyright (c) 1996 Component-B-Creators Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"),..."
40+
}
41+
}
42+
details {
43+
license_identifier: "MIT"
44+
text {
45+
value: "MIT License\n\nCopyright (c) 2001 Component-C-Creators Org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"),..."
46+
}
47+
}
3348
}
3449
}
35-
purl: "pkg:maven/com.acme/[email protected]?packaging=jar"
3650
}

tools/src/test/resources/1.7/valid-license-expression-with-text-1.7.xml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
<?xml version="1.0"?>
2-
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
2+
<bom serialNumber="urn:uuid:8ad91ceb-1741-4d58-8d22-4488a0f68dbe" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
33
<components>
44
<component type="application">
5-
<publisher>Acme Inc</publisher>
6-
<group>com.acme</group>
7-
<name>tomcat-catalina</name>
8-
<version>9.0.14</version>
9-
<description>Modified version of Apache Catalina</description>
10-
<scope>required</scope>
5+
<name>my-application</name>
6+
<version>1.33.7</version>
7+
<description>
8+
This application is composed of multiple things, and therefore has multiple licenses applied:
9+
* custom code - custom license
10+
* component A - EPL or GPL
11+
* component B - MIT
12+
* component C - MIT
13+
</description>
1114
<licenses>
1215
<expression-detailed bom-ref="my-license" acknowledgement="declared"
13-
expression="EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0"
16+
expression="LicenseRef-my-custom-license AND (EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0) AND MIT"
1417
>
18+
<details license-identifier="LicenseRef-my-custom-license">
19+
<text>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</text>
20+
</details>
1521
<details license-identifier="EPL-2.0">
1622
<text><![CDATA[Eclipse Public License - v 2.0
1723
@@ -32,9 +38,24 @@
3238
3339
Linking this library statically or dynamically with other modules is making a combined work based on this library...]]></text>
3440
</details>
41+
<details license-identifier="MIT">
42+
<text><![CDATA[MIT License
43+
44+
Copyright (c) 1996 Component-B-Creators Inc.
45+
46+
Permission is hereby granted, free of charge, to any person obtaining a copy
47+
of this software and associated documentation files (the "Software"),...]]></text>
48+
</details>
49+
<details license-identifier="MIT">
50+
<text><![CDATA[MIT License
51+
52+
Copyright (c) 2001 Component-C-Creators Org
53+
54+
Permission is hereby granted, free of charge, to any person obtaining a copy
55+
of this software and associated documentation files (the "Software"),...]]></text>
56+
</details>
3557
</expression-detailed>
3658
</licenses>
37-
<purl>pkg:maven/com.acme/[email protected]?packaging=jar</purl>
3859
</component>
3960
</components>
4061
</bom>

0 commit comments

Comments
 (0)