Skip to content

Commit 544db94

Browse files
authored
tests: testcases initial 1.7 (#583)
1. enabled test runner for schema 1.7 1. copied all test cases from 1.6 to 1.7 1. renamed the files from `*.1.6.*` to `*.1.7.*` 1. migrated the test cases from schema 1.6 to schema 1.7 see the diff/delta of each individual commit for details java tests are expected to fail, as long as #256 is not done
2 parents a998cfc + 6262459 commit 544db94

File tree

194 files changed

+11258
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+11258
-3
lines changed

tools/src/test/java/org/cyclonedx/schema/BaseSchemaVerificationTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ List<String> getAllResources() throws Exception {
3030
files.addAll(getResources("1.4/"));
3131
files.addAll(getResources("1.5/"));
3232
files.addAll(getResources("1.6/"));
33+
files.addAll(getResources("1.7/"));
3334
return files;
3435
}
3536

tools/src/test/java/org/cyclonedx/schema/JsonSchemaVerificationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Collection<DynamicTest> dynamicTestsWithCollection() throws Exception {
4545
schemaVersion = Version.VERSION_15;
4646
} else if (file.endsWith("-1.6.json")) {
4747
schemaVersion = Version.VERSION_16;
48+
} else if (file.endsWith("-1.7.json")) {
49+
schemaVersion = Version.VERSION_17;
4850
} else {
4951
schemaVersion = null;
5052
}

tools/src/test/java/org/cyclonedx/schema/XmlSchemaVerificationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Collection<DynamicTest> dynamicTestsWithCollection() throws Exception {
5555
schemaVersion = Version.VERSION_15;
5656
} else if (file.endsWith("-1.6.xml")) {
5757
schemaVersion = Version.VERSION_16;
58+
} else if (file.endsWith("-1.7.xml")) {
59+
schemaVersion = Version.VERSION_17;
5860
} else {
5961
schemaVersion = null;
6062
}

tools/src/test/js/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
"@types/node": ">=18.3"
1616
},
1717
"scripts": {
18-
"test": "run-s test:*",
18+
"test": "run-s test:\\*",
1919
"test:json-schema-lint": "node -- json-schema-lint-tests.js",
20-
"test:json-schema-functional": "run-s test:json-schema-functional:*",
20+
"test:json-schema-functional": "run-s test:json-schema-functional:\\*",
21+
"test:json-schema-functional:1.7": "node -- json-schema-functional-tests.js -v 1.7",
2122
"test:json-schema-functional:1.6": "node -- json-schema-functional-tests.js -v 1.6",
2223
"test:json-schema-functional:1.5": "node -- json-schema-functional-tests.js -v 1.5",
2324
"test:json-schema-functional:1.4": "node -- json-schema-functional-tests.js -v 1.4",

tools/src/test/php/composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,21 @@
1818
],
1919
"test:json-schema-lint": "@php -f json-schema-lint-tests.php --",
2020
"test:json-schema-functional": [
21+
"@test:json-schema-functional:1.7",
2122
"@test:json-schema-functional:1.6",
2223
"@test:json-schema-functional:1.5",
2324
"@test:json-schema-functional:1.4",
2425
"@test:json-schema-functional:1.3",
2526
"@test:json-schema-functional:1.2"
2627
],
28+
"test:json-schema-functional:1.7": "@php -f json-schema-functional-tests.php -- -v 1.7 --",
2729
"test:json-schema-functional:1.6": "@php -f json-schema-functional-tests.php -- -v 1.6 --",
2830
"test:json-schema-functional:1.5": "@php -f json-schema-functional-tests.php -- -v 1.5 --",
2931
"test:json-schema-functional:1.4": "@php -f json-schema-functional-tests.php -- -v 1.4 --",
3032
"test:json-schema-functional:1.3": "@php -f json-schema-functional-tests.php -- -v 1.3 --",
3133
"test:json-schema-functional:1.2": "@php -f json-schema-functional-tests.php -- -v 1.2 --",
3234
"test:xml-schema-functional": [
35+
"@test:xml-schema-functional:1.7",
3336
"@test:xml-schema-functional:1.6",
3437
"@test:xml-schema-functional:1.5",
3538
"@test:xml-schema-functional:1.4",
@@ -38,6 +41,7 @@
3841
"@test:xml-schema-functional:1.1",
3942
"@test:xml-schema-functional:1.0"
4043
],
44+
"test:xml-schema-functional:1.7": "@php -f xml-schema-functional-tests.php -- -v 1.7 --",
4145
"test:xml-schema-functional:1.6": "@php -f xml-schema-functional-tests.php -- -v 1.6 --",
4246
"test:xml-schema-functional:1.5": "@php -f xml-schema-functional-tests.php -- -v 1.5 --",
4347
"test:xml-schema-functional:1.4": "@php -f xml-schema-functional-tests.php -- -v 1.4 --",
@@ -50,4 +54,4 @@
5054
"test": "run all tests",
5155
"test:json-schema-lint": "lint JSON schema."
5256
}
53-
}
57+
}

tools/src/test/proto/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ function schema-breaking-version () {
7272
--error-format "$LOG_FORMAT"
7373
}
7474

75+
compare '1.7' '1.6'
7576
# compare '1.6' '1.5' # <-- possible breaks are acknowledged
7677
# compare '1.5' '1.4' # <-- possible breaks are acknowledged
7778
compare '1.4' '1.3'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
3+
"bomFormat": "AnotherFormat",
4+
"specVersion": "1.7",
5+
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
6+
"version": 1,
7+
"components": [
8+
]
9+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
3+
"bomFormat": "CycloneDX",
4+
"specVersion": "1.7",
5+
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
6+
"version": 1,
7+
"components": [
8+
{
9+
"type": "library",
10+
"bom-ref": "123",
11+
"name": "acme-library",
12+
"version": "1.0.0"
13+
},
14+
{
15+
"type": "library",
16+
"bom-ref": "",
17+
"name": "acme-library",
18+
"version": "1.0.0"
19+
}
20+
]
21+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0"?>
2+
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
3+
<components>
4+
<component type="library" bom-ref="123">
5+
<name>acme-library</name>
6+
<version>1.0.0</version>
7+
<components>
8+
<component type="library" bom-ref="123">
9+
<!-- duplicate value in attribute `bom-ref` -->
10+
<name>acme-library</name>
11+
<version>1.0.0</version>
12+
</component>
13+
<component type="library" bom-ref="123">
14+
<name>acme-library2</name>
15+
<version>1.0.0</version>
16+
</component>
17+
<component type="library" bom-ref="">
18+
<!-- empty value in attribute `bom-ref` -->
19+
<name>acme-library</name>
20+
<version>1.0.0</version>
21+
</component>
22+
</components>
23+
</component>
24+
</components>
25+
</bom>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
3+
"bomFormat": "CycloneDX",
4+
"specVersion": "1.7",
5+
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
6+
"version": 1,
7+
"components": [
8+
{
9+
"type": "application",
10+
"author": "Acme Super Heros",
11+
"name": "Acme Application",
12+
"version": "9.1.1",
13+
"swid": {
14+
"name": "Acme Application",
15+
"version": "9.1.1"
16+
}
17+
}
18+
]
19+
}

0 commit comments

Comments
 (0)