File tree Expand file tree Collapse file tree 6 files changed +72
-1
lines changed
Expand file tree Collapse file tree 6 files changed +72
-1
lines changed Original file line number Diff line number Diff line change @@ -547,7 +547,7 @@ public void testIssue408Regression_xmlToJson_externalReferenceBom() throws Excep
547547
548548 @ Test
549549 public void testIssue562 () throws Exception {
550- Version version = Version .VERSION_15 ;
550+ Version version = Version .VERSION_16 ;
551551 Bom bom = createCommonJsonBom ("/regression/issue562.json" );
552552
553553
@@ -558,7 +558,18 @@ public void testIssue562() throws Exception {
558558 assertTrue (parser .isValid (loadedFile , version ));
559559 }
560560
561+ @ Test
562+ public void testIssue492 () throws Exception {
563+ Version version = Version .VERSION_14 ;
564+ Bom bom = createCommonJsonBom ("/regression/issue492.json" );
565+
561566
567+ BomJsonGenerator generator = BomGeneratorFactory .createJson (version , bom );
568+ File loadedFile = writeToFile (generator .toJsonString ());
569+
570+ JsonParser parser = new JsonParser ();
571+ assertTrue (parser .isValid (loadedFile , version ));
572+ }
562573
563574 private void assertExternalReferenceInfo (Bom bom ) {
564575 assertEquals (3 , bom .getExternalReferences ().size ());
Original file line number Diff line number Diff line change @@ -730,6 +730,19 @@ public void testIssue562() throws Exception {
730730 assertTrue (parser .isValid (loadedFile , version ));
731731 }
732732
733+ @ Test
734+ public void testIssue492 () throws Exception {
735+ Version version = Version .VERSION_15 ;
736+ Bom bom = createCommonBomXml ("/regression/issue492.xml" );
737+
738+ BomXmlGenerator generator = BomGeneratorFactory .createXml (version , bom );
739+
740+ File loadedFile = writeToFile (generator .toXmlString ());
741+
742+ XmlParser parser = new XmlParser ();
743+ assertTrue (parser .isValid (loadedFile , version ));
744+ }
745+
733746 private void addExtensibleTypes (Bom bom ) {
734747 ExtensibleType t1 = new ExtensibleType ("abc" , "test" , "test" );
735748 ExtensibleType t2 = new ExtensibleType ("abc" , "test" , "test1" );
Original file line number Diff line number Diff line change @@ -575,4 +575,10 @@ public void testIssue562Regression() throws Exception {
575575 assertEquals (2 , bom .getMetadata ().getToolChoice ().getComponents ().size ());
576576 assertEquals (2 , bom .getMetadata ().getAuthors ().size ());
577577 }
578+
579+ @ Test
580+ public void testIssue492Regression () throws Exception {
581+ final Bom bom = getJsonBom ("regression/issue492.json" );
582+ assertEquals (2 , bom .getMetadata ().getTools ().size ());
583+ }
578584}
Original file line number Diff line number Diff line change @@ -720,4 +720,10 @@ public void testIssue562Regression() throws Exception {
720720 assertEquals (2 , bom .getMetadata ().getToolChoice ().getComponents ().size ());
721721 assertEquals (2 , bom .getMetadata ().getAuthors ().size ());
722722 }
723+
724+ @ Test
725+ public void testIssue492Regression () throws Exception {
726+ final Bom bom = getXmlBom ("regression/issue492.xml" );
727+ assertEquals (2 , bom .getMetadata ().getTools ().size ());
728+ }
723729}
Original file line number Diff line number Diff line change 1+ {
2+ "bomFormat" :" CycloneDX" ,
3+ "specVersion" :" 1.4" ,
4+ "serialNumber" :" urn:uuid:0c81ff2e-d64e-4897-bfa4-2f0f7d8ab767" ,
5+ "version" : 1 ,
6+ "metadata" : {
7+ "timestamp" :" 2024-12-09T21:56:45Z" ,
8+ "tools" : [
9+ {
10+ "name" : " tool-a"
11+ },
12+ {
13+ "name" : " tool-b"
14+ }
15+ ]
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" standalone =" no" ?>
2+ <bom xmlns =" http://cyclonedx.org/schema/bom/1.4" serialNumber =" urn:uuid:0c81ff2e-d64e-4897-bfa4-2f0f7d8ab767" version =" 1" >
3+ <metadata >
4+ <timestamp >2024-12-09T21:56:45Z</timestamp >
5+ <tools >
6+ <tool >
7+ <vendor >corp A</vendor >
8+ <name >tool A</name >
9+ <version >1-A</version >
10+ </tool >
11+ <tool >
12+ <vendor >corp B</vendor >
13+ <name >tool B</name >
14+ <version >1-B</version >
15+ </tool >
16+ </tools >
17+ </metadata >
18+ </bom >
You can’t perform that action at this time.
0 commit comments