@@ -387,9 +387,39 @@ public void testVerify() throws InvalidSPDXAnalysisException {
387387 assertEquals (2 , result .size ());
388388 }
389389
390- /**
391- * Test method for {@link org.spdx.library.model.compat.v2.compat.v2.SpdxDocument#getDocumentDescribes()}.
392- */
390+ public void testVerifyBadDocNamespace () throws InvalidSPDXAnalysisException {
391+ SpdxDocument doc = new SpdxDocument (DefaultModelStore .getDefaultModelStore (), "://bad/uri" , gmo .getCopyManager (), true );
392+ doc .setStrict (false );
393+ List <Annotation > annotations = Arrays .asList (new Annotation [] {
394+ ANNOTATION1 , ANNOTATION2
395+ });
396+ List <ExtractedLicenseInfo > extractedLicenseInfos = Arrays .asList (new ExtractedLicenseInfo [] {
397+ LICENSE1 , LICENSE2
398+ });
399+ List <SpdxItem > items = Arrays .asList (new SpdxItem [] {
400+ FILE1 , FILE2 , PACKAGE1 , PACKAGE2
401+ });
402+ List <Relationship > relationships = Arrays .asList (new Relationship [] {
403+ RELATIONSHIP1 , RELATIONSHIP2
404+ });
405+ doc .setAnnotations (annotations );
406+ doc .setComment (DOC_COMMENT1 );
407+ doc .setCreationInfo (CREATIONINFO1 );
408+ doc .setDataLicense (CCO_DATALICENSE );
409+ doc .setExtractedLicenseInfos (extractedLicenseInfos );
410+ doc .setName (DOC_NAME1 );
411+ doc .setRelationships (relationships );
412+ doc .setDocumentDescribes (items );
413+ doc .setSpecVersion (Version .TWO_POINT_THREE_VERSION );
414+ List <String > result = doc .verify ();
415+ assertEquals (1 , result .size ());
416+ assertTrue (result .get (0 ).contains ("namespace" ));
417+ }
418+
419+
420+ /**
421+ * Test method for {@link org.spdx.library.model.compat.v2.compat.v2.SpdxDocument#getDocumentDescribes()}.
422+ */
393423 public void testGetDocumentDescribes () throws InvalidSPDXAnalysisException {
394424 SpdxDocument doc = new SpdxDocument (DefaultModelStore .getDefaultModelStore (), DefaultModelStore .getDefaultDocumentUri (), gmo .getCopyManager (), true );
395425 doc .setStrict (false );
0 commit comments