Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ List<String> getAllResources() throws Exception {
files.addAll(getResources("1.4/"));
files.addAll(getResources("1.5/"));
files.addAll(getResources("1.6/"));
files.addAll(getResources("1.7/"));
return files;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Collection<DynamicTest> dynamicTestsWithCollection() throws Exception {
schemaVersion = Version.VERSION_15;
} else if (file.endsWith("-1.6.json")) {
schemaVersion = Version.VERSION_16;
} else if (file.endsWith("-1.7.json")) {
schemaVersion = Version.VERSION_17;
} else {
schemaVersion = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Collection<DynamicTest> dynamicTestsWithCollection() throws Exception {
schemaVersion = Version.VERSION_15;
} else if (file.endsWith("-1.6.xml")) {
schemaVersion = Version.VERSION_16;
} else if (file.endsWith("-1.7.xml")) {
schemaVersion = Version.VERSION_17;
} else {
schemaVersion = null;
}
Expand Down
5 changes: 3 additions & 2 deletions tools/src/test/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
"@types/node": ">=18.3"
},
"scripts": {
"test": "run-s test:*",
"test": "run-s test:\\*",
"test:json-schema-lint": "node -- json-schema-lint-tests.js",
"test:json-schema-functional": "run-s test:json-schema-functional:*",
"test:json-schema-functional": "run-s test:json-schema-functional:\\*",
"test:json-schema-functional:1.7": "node -- json-schema-functional-tests.js -v 1.7",
"test:json-schema-functional:1.6": "node -- json-schema-functional-tests.js -v 1.6",
"test:json-schema-functional:1.5": "node -- json-schema-functional-tests.js -v 1.5",
"test:json-schema-functional:1.4": "node -- json-schema-functional-tests.js -v 1.4",
Expand Down
6 changes: 5 additions & 1 deletion tools/src/test/php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,21 @@
],
"test:json-schema-lint": "@php -f json-schema-lint-tests.php --",
"test:json-schema-functional": [
"@test:json-schema-functional:1.7",
"@test:json-schema-functional:1.6",
"@test:json-schema-functional:1.5",
"@test:json-schema-functional:1.4",
"@test:json-schema-functional:1.3",
"@test:json-schema-functional:1.2"
],
"test:json-schema-functional:1.7": "@php -f json-schema-functional-tests.php -- -v 1.7 --",
"test:json-schema-functional:1.6": "@php -f json-schema-functional-tests.php -- -v 1.6 --",
"test:json-schema-functional:1.5": "@php -f json-schema-functional-tests.php -- -v 1.5 --",
"test:json-schema-functional:1.4": "@php -f json-schema-functional-tests.php -- -v 1.4 --",
"test:json-schema-functional:1.3": "@php -f json-schema-functional-tests.php -- -v 1.3 --",
"test:json-schema-functional:1.2": "@php -f json-schema-functional-tests.php -- -v 1.2 --",
"test:xml-schema-functional": [
"@test:xml-schema-functional:1.7",
"@test:xml-schema-functional:1.6",
"@test:xml-schema-functional:1.5",
"@test:xml-schema-functional:1.4",
Expand All @@ -38,6 +41,7 @@
"@test:xml-schema-functional:1.1",
"@test:xml-schema-functional:1.0"
],
"test:xml-schema-functional:1.7": "@php -f xml-schema-functional-tests.php -- -v 1.7 --",
"test:xml-schema-functional:1.6": "@php -f xml-schema-functional-tests.php -- -v 1.6 --",
"test:xml-schema-functional:1.5": "@php -f xml-schema-functional-tests.php -- -v 1.5 --",
"test:xml-schema-functional:1.4": "@php -f xml-schema-functional-tests.php -- -v 1.4 --",
Expand All @@ -50,4 +54,4 @@
"test": "run all tests",
"test:json-schema-lint": "lint JSON schema."
}
}
}
1 change: 1 addition & 0 deletions tools/src/test/proto/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function schema-breaking-version () {
--error-format "$LOG_FORMAT"
}

compare '1.7' '1.6'
# compare '1.6' '1.5' # <-- possible breaks are acknowledged
# compare '1.5' '1.4' # <-- possible breaks are acknowledged
compare '1.4' '1.3'
Expand Down
9 changes: 9 additions & 0 deletions tools/src/test/resources/1.7/invalid-bomformat-1.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
"bomFormat": "AnotherFormat",
"specVersion": "1.7",
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
"version": 1,
"components": [
]
}
21 changes: 21 additions & 0 deletions tools/src/test/resources/1.7/invalid-component-ref-1.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.7",
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
"version": 1,
"components": [
{
"type": "library",
"bom-ref": "123",
"name": "acme-library",
"version": "1.0.0"
},
{
"type": "library",
"bom-ref": "",
"name": "acme-library",
"version": "1.0.0"
}
]
}
25 changes: 25 additions & 0 deletions tools/src/test/resources/1.7/invalid-component-ref-1.7.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
<components>
<component type="library" bom-ref="123">
<name>acme-library</name>
<version>1.0.0</version>
<components>
<component type="library" bom-ref="123">
<!-- duplicate value in attribute `bom-ref` -->
<name>acme-library</name>
<version>1.0.0</version>
</component>
<component type="library" bom-ref="123">
<name>acme-library2</name>
<version>1.0.0</version>
</component>
<component type="library" bom-ref="">
<!-- empty value in attribute `bom-ref` -->
<name>acme-library</name>
<version>1.0.0</version>
</component>
</components>
</component>
</components>
</bom>
19 changes: 19 additions & 0 deletions tools/src/test/resources/1.7/invalid-component-swid-1.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.7",
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
"version": 1,
"components": [
{
"type": "application",
"author": "Acme Super Heros",
"name": "Acme Application",
"version": "9.1.1",
"swid": {
"name": "Acme Application",
"version": "9.1.1"
}
}
]
}
11 changes: 11 additions & 0 deletions tools/src/test/resources/1.7/invalid-component-swid-1.7.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
<components>
<component type="application">
<author>Acme Super Heros</author>
<name>Acme Application</name>
<version>9.1.1</version>
<swid name="Acme Application" version="9.1.1" />
</component>
</components>
</bom>
14 changes: 14 additions & 0 deletions tools/src/test/resources/1.7/invalid-component-type-1.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.7",
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
"version": 1,
"components": [
{
"type": "foo",
"name": "acme-library",
"version": "1.0.0"
}
]
}
9 changes: 9 additions & 0 deletions tools/src/test/resources/1.7/invalid-component-type-1.7.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
<components>
<component type="foo">
<name>acme-library</name>
<version>1.0.0</version>
</component>
</components>
</bom>
44 changes: 44 additions & 0 deletions tools/src/test/resources/1.7/invalid-dependency-1.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.7",
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
"version": 1,
"components": [
{
"bom-ref": "library-a",
"type": "library",
"name": "library-a",
"version": "1.0.0"
},
{
"bom-ref": "library-b",
"type": "library",
"name": "library-b",
"version": "1.0.0"
},
{
"bom-ref": "library-c",
"type": "library",
"name": "library-c",
"version": "1.0.0"
}
],
"dependencies": [
{
"dependsOn": []
},
{
"ref": "",
"dependsOn": [
"library-a"
]
},
{
"ref": "library-b",
"dependsOn": [
"library-c"
]
}
]
}
31 changes: 31 additions & 0 deletions tools/src/test/resources/1.7/invalid-dependency-1.7.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0"?>
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
<components>
<component type="library" bom-ref="library-a">
<name>acme-library-a</name>
<version>1.0.0</version>
</component>
<component type="library" bom-ref="library-b">
<name>acme-library-b</name>
<version>1.0.0</version>
</component>
<component type="library" bom-ref="library-c">
<name>acme-library-b</name>
<version>1.0.0</version>
</component>
</components>
<dependencies>
<dependency>
<!-- invalid: missing attribute `ref` -->
</dependency>
<dependency ref="">
<!-- invalid: attribute `ref` is empty -->
<dependency ref="library-a"/>
</dependency>
<dependency ref="library-b">
<dependency ref="library-c">
<!-- valid -->
</dependency>
</dependency>
</dependencies>
</bom>
12 changes: 12 additions & 0 deletions tools/src/test/resources/1.7/invalid-empty-component-1.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.7",
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
"version": 1,
"components": [
{
"type": "library"
}
]
}
7 changes: 7 additions & 0 deletions tools/src/test/resources/1.7/invalid-empty-component-1.7.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
<components>
<component type="application">
</component>
</components>
</bom>
33 changes: 33 additions & 0 deletions tools/src/test/resources/1.7/invalid-hash-alg-1.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.7",
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
"version": 1,
"components": [
{
"type": "library",
"name": "acme-library",
"version": "1.0.0",
"scope": "required",
"hashes": [
{
"alg": "FOO",
"content": "3942447fac867ae5cdb3229b658f4d48"
},
{
"alg": "SHA-1",
"content": "e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a"
},
{
"alg": "SHA-256",
"content": "f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b"
},
{
"alg": "SHA-512",
"content": "e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282"
}
]
}
]
}
16 changes: 16 additions & 0 deletions tools/src/test/resources/1.7/invalid-hash-alg-1.7.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
<components>
<component type="library">
<name>acme-library</name>
<version>1.0.0</version>
<scope>required</scope>
<hashes>
<hash alg="FOO">3942447fac867ae5cdb3229b658f4d48</hash>
<hash alg="SHA-1">e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a</hash>
<hash alg="SHA-256">f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b</hash>
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
</hashes>
</component>
</components>
</bom>
33 changes: 33 additions & 0 deletions tools/src/test/resources/1.7/invalid-hash-md5-1.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.7",
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
"version": 1,
"components": [
{
"type": "library",
"name": "acme-library",
"version": "1.0.0",
"scope": "required",
"hashes": [
{
"alg": "MD5",
"content": "foo"
},
{
"alg": "SHA-1",
"content": "e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a"
},
{
"alg": "SHA-256",
"content": "f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b"
},
{
"alg": "SHA-512",
"content": "e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282"
}
]
}
]
}
16 changes: 16 additions & 0 deletions tools/src/test/resources/1.7/invalid-hash-md5-1.7.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
<components>
<component type="library">
<name>acme-library</name>
<version>1.0.0</version>
<scope>required</scope>
<hashes>
<hash alg="MD5">foo</hash>
<hash alg="SHA-1">e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a</hash>
<hash alg="SHA-256">f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b</hash>
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
</hashes>
</component>
</components>
</bom>
Loading
Loading