@Test public void importToscaElementWithBadImageUri() throws IOException, ParsingException { Path csarFileForTesting = Paths.get(CSAR_OUTPUT_FOLDER.toString(), tmpArchiveNameWithError); FileUtil.zip(PATH_TOSCA_BASE_TYPES_ERROR, csarFileForTesting); ParsingResult<ArchiveRoot> result = parser.parse(csarFileForTesting, AlienConstants.GLOBAL_WORKSPACE_ID); imageLoader.importImages(csarFileForTesting, result.getResult(), result.getContext().getParsingErrors()); Assert.assertFalse(result.hasError(ParsingErrorLevel.ERROR)); Assert.assertTrue(result.hasError(ParsingErrorLevel.WARNING)); }
public void importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors) { importImages(archiveFile, archiveRoot.getNodeTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getRelationshipTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getCapabilityTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getArtifactTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getPolicyTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getArchive().getTags(), parsingErrors); if (archiveRoot.getArchive().isHasTopology()) { importImages(archiveFile, archiveRoot.getTopology().getTags(), parsingErrors); } }
ArchiveImageLoader { public void importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors) { importImages(archiveFile, archiveRoot.getNodeTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getRelationshipTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getCapabilityTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getArtifactTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getPolicyTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getArchive().getTags(), parsingErrors); if (archiveRoot.getArchive().isHasTopology()) { importImages(archiveFile, archiveRoot.getTopology().getTags(), parsingErrors); } } }
ArchiveImageLoader { public void importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors) { importImages(archiveFile, archiveRoot.getNodeTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getRelationshipTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getCapabilityTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getArtifactTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getPolicyTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getArchive().getTags(), parsingErrors); if (archiveRoot.getArchive().isHasTopology()) { importImages(archiveFile, archiveRoot.getTopology().getTags(), parsingErrors); } }  }
ArchiveImageLoader { public void importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors) { importImages(archiveFile, archiveRoot.getNodeTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getRelationshipTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getCapabilityTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getArtifactTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getPolicyTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getArchive().getTags(), parsingErrors); if (archiveRoot.getArchive().isHasTopology()) { importImages(archiveFile, archiveRoot.getTopology().getTags(), parsingErrors); } }  void importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors); static Tag getIconTag(List<Tag> tags); }
ArchiveImageLoader { public void importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors) { importImages(archiveFile, archiveRoot.getNodeTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getRelationshipTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getCapabilityTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getArtifactTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getPolicyTypes(), parsingErrors); importImages(archiveFile, archiveRoot.getArchive().getTags(), parsingErrors); if (archiveRoot.getArchive().isHasTopology()) { importImages(archiveFile, archiveRoot.getTopology().getTags(), parsingErrors); } }  void importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors); static Tag getIconTag(List<Tag> tags);  }