Skip to content

Commit 32b73df

Browse files
committed
tests: add latest features to test cases
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 5462e66 commit 32b73df

File tree

3 files changed

+150
-6
lines changed

3 files changed

+150
-6
lines changed

tools/src/test/resources/1.7/valid-license-declared-concluded-mix-1.7.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,54 @@
110110
}
111111
}
112112
]
113+
},
114+
{
115+
"type": "library",
116+
"group": "com.example",
117+
"name": "situation-E",
118+
"version": "1",
119+
"description": "Multiple licenses with urls: declared ids/names, and a concluded expression",
120+
"licenses": [
121+
{
122+
"license": {
123+
"id": "MIT",
124+
"acknowledgement": "declared",
125+
"url": "https://example.com/licenses/MIT"
126+
}
127+
},
128+
{
129+
"license": {
130+
"id": "PostgreSQL",
131+
"acknowledgement": "declared",
132+
"url": "https://example.com/licenses/PostgreSQL"
133+
}
134+
},
135+
{
136+
"license": {
137+
"name": "Apache Software License",
138+
"acknowledgement": "declared",
139+
"url": "https://example.com/licenses/Apache-2.0"
140+
}
141+
},
142+
{
143+
"expression": "(MIT AND PostgreSQL AND Apache-2.0)",
144+
"acknowledgement": "concluded",
145+
"expressionDetails": [
146+
{
147+
"licenseIdentifier": "MIT",
148+
"url": "https://example.com/licenses/MIT"
149+
},
150+
{
151+
"licenseIdentifier": "PostgreSQL",
152+
"url": "https://example.com/licenses/PostgreSQL"
153+
},
154+
{
155+
"licenseIdentifier": "Apache-2.0",
156+
"url": "https://example.com/licenses/Apache-2.0"
157+
}
158+
]
159+
}
160+
]
113161
}
114162
]
115163
}

tools/src/test/resources/1.7/valid-license-declared-concluded-mix-1.7.textproto

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,50 @@ components {
105105
}
106106
}
107107
}
108+
109+
components {
110+
type: CLASSIFICATION_LIBRARY
111+
group: "com.example"
112+
name: "situation-E"
113+
version: "1"
114+
description: "Multiple licenses with urls: declared ids/names, and a concluded expression"
115+
licenses {
116+
license {
117+
id: "MIT"
118+
url: "https://example.com/licenses/MIT"
119+
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED
120+
}
121+
}
122+
licenses {
123+
license {
124+
id: "PostgreSQL"
125+
url: "https://example.com/licenses/PostgreSQL"
126+
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED
127+
}
128+
}
129+
licenses {
130+
license {
131+
name: "Apache Software License"
132+
url: "https://example.com/licenses/Apache-2.0"
133+
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED
134+
}
135+
}
136+
licenses {
137+
expression_detailed {
138+
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_CONCLUDED
139+
expression: "(MIT AND PostgreSQL AND Apache-2.0)"
140+
details {
141+
license_identifier: "MIT"
142+
url: "https://example.com/licenses/MIT"
143+
}
144+
details {
145+
license_identifier: "PostgreSQL"
146+
url: "https://example.com/licenses/PostgreSQL"
147+
}
148+
details {
149+
license_identifier: "Apache-2.0"
150+
url: "https://example.com/licenses/Apache-2.0"
151+
}
152+
}
153+
}
154+
}

tools/src/test/resources/1.7/valid-license-declared-concluded-mix-1.7.xml

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
This is not a real law-case!
88
-->
99
<metadata>
10-
<lifecycles><lifecycle><phase>design</phase></lifecycle></lifecycles>
10+
<lifecycles>
11+
<lifecycle>
12+
<phase>design</phase>
13+
</lifecycle>
14+
</lifecycles>
1115
</metadata>
1216
<components>
1317
<component type="library">
@@ -16,9 +20,15 @@
1620
<version>1</version>
1721
<description>Multiple licenses: declared ids/names, and a concluded expression</description>
1822
<licenses>
19-
<license acknowledgement="declared"><id>MIT</id></license>
20-
<license acknowledgement="declared"><id>PostgreSQL</id></license>
21-
<license acknowledgement="declared"><name>Apache Software License</name></license>
23+
<license acknowledgement="declared">
24+
<id>MIT</id>
25+
</license>
26+
<license acknowledgement="declared">
27+
<id>PostgreSQL</id>
28+
</license>
29+
<license acknowledgement="declared">
30+
<name>Apache Software License</name>
31+
</license>
2232
<expression acknowledgement="concluded">(MIT OR PostgreSQL OR Apache-2.0)</expression>
2333
</licenses>
2434
</component>
@@ -39,7 +49,9 @@
3949
<description>Multiple license: one declared expression, one concluded id</description>
4050
<licenses>
4151
<expression acknowledgement="declared">GPL-3.0-or-later OR GPL-2.0</expression>
42-
<license acknowledgement="concluded"><id>GPL-3.0-only</id></license>
52+
<license acknowledgement="concluded">
53+
<id>GPL-3.0-only</id>
54+
</license>
4355
</licenses>
4456
</component>
4557
<component type="library">
@@ -48,7 +60,10 @@
4860
<version>1</version>
4961
<description>Multiple license with texts: one declared expression, one concluded id</description>
5062
<licenses>
51-
<expression-detailed expression="GPL-3.0-or-later OR GPL-2.0" acknowledgement="declared">
63+
<expression-detailed
64+
expression="GPL-3.0-or-later OR GPL-2.0"
65+
acknowledgement="declared"
66+
>
5267
<details license-identifier="GPL-3.0-or-later">
5368
<text>specific GPL-3.0-or-later license text</text>
5469
</details>
@@ -62,5 +77,39 @@
6277
</license>
6378
</licenses>
6479
</component>
80+
<component type="library">
81+
<group>com.example</group>
82+
<name>situation-E</name>
83+
<version>1</version>
84+
<description>Multiple licenses with urls: declared ids/names, and a concluded expression</description>
85+
<licenses>
86+
<license acknowledgement="declared">
87+
<id>MIT</id>
88+
<url>https://example.com/licenses/MIT</url>
89+
</license>
90+
<license acknowledgement="declared">
91+
<id>PostgreSQL</id>
92+
<url>https://example.com/licenses/PostgreSQL</url>
93+
</license>
94+
<license acknowledgement="declared">
95+
<name>Apache Software License</name>
96+
<url>https://example.com/licenses/Apache-2.0</url>
97+
</license>
98+
<expression-detailed
99+
expression="(MIT AND PostgreSQL AND Apache-2.0)"
100+
acknowledgement="concluded"
101+
>
102+
<details license-identifier="MIT">
103+
<url>https://example.com/licenses/MIT</url>
104+
</details>
105+
<details license-identifier="PostgreSQL">
106+
<url>https://example.com/licenses/PostgreSQL</url>
107+
</details>
108+
<details license-identifier="Apache-2.0">
109+
<url>https://example.com/licenses/Apache-2.0</url>
110+
</details>
111+
</expression-detailed>
112+
</licenses>
113+
</component>
65114
</components>
66115
</bom>

0 commit comments

Comments
 (0)