Skip to content

Commit

Permalink
Add tests for multiple licenses.
Browse files Browse the repository at this point in the history
  • Loading branch information
khuey committed Nov 18, 2022
1 parent b5fbaf6 commit 34fc389
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/CycloneDX.Core.Tests/Json/v1.4/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class SerializationTests
[InlineData("valid-metadata-timestamp-1.4.json")]
[InlineData("valid-metadata-tool-1.4.json")]
[InlineData("valid-minimal-viable-1.4.json")]
[InlineData("valid-multiple-license-id-1.4.json")]
[InlineData("valid-patch-1.4.json")]
[InlineData("valid-properties-1.4.json")]
[InlineData("valid-release-notes-1.4.json")]
Expand Down Expand Up @@ -91,6 +92,7 @@ public void JsonRoundTripTest(string filename)
[InlineData("valid-metadata-timestamp-1.4.json")]
[InlineData("valid-metadata-tool-1.4.json")]
[InlineData("valid-minimal-viable-1.4.json")]
[InlineData("valid-multiple-license-id-1.4.json")]
[InlineData("valid-patch-1.4.json")]
[InlineData("valid-properties-1.4.json")]
[InlineData("valid-release-notes-1.4.json")]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"bomFormat": "CycloneDX",
"specVersion": "1.4",
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
"version": 1,
"components": [
{
"type": "library",
"publisher": "Acme Inc",
"group": "com.acme",
"name": "tomcat-catalina",
"version": "9.0.14",
"licenses": [
{
"license": {
"id": "Apache-2.0"
}
},
{
"license": {
"id": "MIT"
}
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"bomFormat": "CycloneDX",
"specVersion": "1.4",
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
"version": 1,
"components": [
{
"type": "library",
"publisher": "Acme Inc",
"group": "com.acme",
"name": "tomcat-catalina",
"version": "9.0.14",
"licenses": [
{
"license": {
"id": "Apache-2.0"
}
},
{
"license": {
"id": "MIT"
}
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"bomFormat": "CycloneDX",
"specVersion": "1.4",
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
"version": 1,
"components": [
{
"type": "library",
"publisher": "Acme Inc",
"group": "com.acme",
"name": "tomcat-catalina",
"version": "9.0.14",
"licenses": [
{
"license": {
"id": "Apache-2.0"
}
},
{
"license": {
"id": "MIT"
}
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.4">
<components>
<component type="application">
<publisher>Acme Inc</publisher>
<group>com.acme</group>
<name>tomcat-catalina</name>
<version>9.0.14</version>
<description>Modified version of Apache Catalina</description>
<scope>required</scope>
<hashes>
<hash alg="MD5">3942447fac867ae5cdb3229b658f4d48</hash>
<hash alg="SHA-1">e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a</hash>
<hash alg="SHA-256">f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b</hash>
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
</hashes>
<licenses>
<license>
<id>Apache-2.0</id>
</license>
<license>
<id>MIT</id>
</license>
</licenses>
<purl>pkg:maven/com.acme/tomcat-catalina@9.0.14?packaging=jar</purl>
</component>
</components>
</bom>
2 changes: 2 additions & 0 deletions tests/CycloneDX.Core.Tests/Xml/v1.4/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class SerializationTests
[InlineData("valid-metadata-timestamp-1.4.xml")]
[InlineData("valid-metadata-tool-1.4.xml")]
[InlineData("valid-minimal-viable-1.4.xml")]
[InlineData("valid-multiple-license-id-1.4.xml")]
[InlineData("valid-patch-1.4.xml")]
[InlineData("valid-properties-1.4.xml")]
// [InlineData("valid-random-attributes-1.4.xml")]
Expand Down Expand Up @@ -95,6 +96,7 @@ public void XmlRoundTripTest(string filename)
[InlineData("valid-metadata-timestamp-1.4.xml")]
[InlineData("valid-metadata-tool-1.4.xml")]
[InlineData("valid-minimal-viable-1.4.xml")]
[InlineData("valid-multiple-license-id-1.4.xml")]
[InlineData("valid-patch-1.4.xml")]
[InlineData("valid-properties-1.4.xml")]
// [InlineData("valid-random-attributes-1.4.xml")]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<bom xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.4">
<components>
<component type="application">
<publisher>Acme Inc</publisher>
<group>com.acme</group>
<name>tomcat-catalina</name>
<version>9.0.14</version>
<description>Modified version of Apache Catalina</description>
<scope>required</scope>
<hashes>
<hash alg="MD5">3942447fac867ae5cdb3229b658f4d48</hash>
<hash alg="SHA-1">e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a</hash>
<hash alg="SHA-256">f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b</hash>
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
</hashes>
<licenses>
<license>
<id>Apache-2.0</id>
</license>
<license>
<id>MIT</id>
</license>
</licenses>
<purl>pkg:maven/com.acme/tomcat-catalina@9.0.14?packaging=jar</purl>
</component>
</components>
</bom>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<bom xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.4">
<components>
<component type="application">
<publisher>Acme Inc</publisher>
<group>com.acme</group>
<name>tomcat-catalina</name>
<version>9.0.14</version>
<description>Modified version of Apache Catalina</description>
<scope>required</scope>
<hashes>
<hash alg="MD5">3942447fac867ae5cdb3229b658f4d48</hash>
<hash alg="SHA-1">e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a</hash>
<hash alg="SHA-256">f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b</hash>
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
</hashes>
<licenses>
<license>
<id>Apache-2.0</id>
</license>
<license>
<id>MIT</id>
</license>
</licenses>
<purl>pkg:maven/com.acme/tomcat-catalina@9.0.14?packaging=jar</purl>
</component>
</components>
</bom>

0 comments on commit 34fc389

Please sign in to comment.