test_class.declarator: CSAR_OUTPUT_FOLDER = Paths.get("./target/csarTests")
test_class.modifier: private static final
test_class.original_string: private static final Path CSAR_OUTPUT_FOLDER = Paths.get("./target/csarTests");
test_class.type: Path
test_class.var_name: CSAR_OUTPUT_FOLDER
test_class.declarator: tmpArchiveName = "tosca-base-types-tags.csar"
test_class.modifier: private static final
test_class.original_string: private static final String tmpArchiveName = "tosca-base-types-tags.csar";
test_class.type: String
test_class.var_name: tmpArchiveName
test_class.declarator: tmpArchiveNameWithError = "tosca-base-types-tags-error.csar"
test_class.modifier: private static final
test_class.original_string: private static final String tmpArchiveNameWithError = "tosca-base-types-tags-error.csar";
test_class.type: String
test_class.var_name: tmpArchiveNameWithError
test_class.declarator: PATH_TOSCA_BASE_TYPES = Paths.get("src/test/resources/org/alien4cloud/tosca/catalog/index/archive-image-loader-test")
test_class.modifier: private static final
test_class.original_string: private static final Path PATH_TOSCA_BASE_TYPES = Paths.get("src/test/resources/org/alien4cloud/tosca/catalog/index/archive-image-loader-test");
test_class.type: Path
test_class.var_name: PATH_TOSCA_BASE_TYPES
test_class.declarator: PATH_TOSCA_BASE_TYPES_ERROR = Paths.get("src/test/resources/org/alien4cloud/tosca/catalog/index/archive-image-loader-test-error")
test_class.modifier: private static final
test_class.original_string: private static final Path PATH_TOSCA_BASE_TYPES_ERROR = Paths.get("src/test/resources/org/alien4cloud/tosca/catalog/index/archive-image-loader-test-error");
test_class.type: Path
test_class.var_name: PATH_TOSCA_BASE_TYPES_ERROR
test_class.declarator: imageLoader
test_class.modifier: @Resource
      private
test_class.original_string: @Resource
      private ArchiveImageLoader imageLoader;
test_class.type: ArchiveImageLoader
test_class.var_name: imageLoader
test_class.declarator: parser
test_class.modifier: @Resource
      private
test_class.original_string: @Resource
      private ArchiveParser parser;
test_class.type: ArchiveParser
test_class.var_name: parser
test_class.declarator: imageDAO
test_class.modifier: @Resource
      private
test_class.original_string: @Resource
      private IImageDAO imageDAO;
test_class.type: IImageDAO
test_class.var_name: imageDAO
test_class.declarator: imageGenericIdDAO
test_class.modifier: @Resource(name = "image-dao")
      private
test_class.original_string: @Resource(name = "image-dao")
      private IGenericIdDAO imageGenericIdDAO;
test_class.type: IGenericIdDAO
test_class.var_name: imageGenericIdDAO
test_class.file: alien4cloud-core/src/test/java/org/alien4cloud/tosca/catalog/index/ArchiveImageLoaderTest.java
test_class.identifier: ArchiveImageLoaderTest
test_case.body: @Test
      public void importToscaElementImages() throws IOException, ParsingException {
          Path csarFileForTesting = Paths.get(CSAR_OUTPUT_FOLDER.toString(), tmpArchiveName);
  
          // Zip the csarSourceFolder and write it to csarFileForTesting
          FileUtil.zip(PATH_TOSCA_BASE_TYPES, csarFileForTesting);
  
          Path imagesPath = Paths.get("target/alien/images");
          if (!Files.exists(imagesPath)) {
              Files.createDirectories(imagesPath);
          }
  
          // Parse the archive for definitions
          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.assertFalse(result.hasError(ParsingErrorLevel.WARNING));
  
          checkImages(result.getResult().getNodeTypes());
      }
test_case.class_method_signature: ArchiveImageLoaderTest.importToscaElementImages()
test_case.full_signature: @Test public void importToscaElementImages()
test_case.identifier: importToscaElementImages
test_case.invocations: get toString zip get exists createDirectories parse importImages getResult getParsingErrors getContext assertFalse hasError assertFalse hasError checkImages getNodeTypes getResult
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void importToscaElementImages()
focal_class.declarator: ALIEN_ICON_TAG = "icon"
focal_class.modifier: private static final
focal_class.original_string: private static final String ALIEN_ICON_TAG = "icon";
focal_class.type: String
focal_class.var_name: ALIEN_ICON_TAG
focal_class.declarator: UUID_PATTERN = Pattern.compile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern UUID_PATTERN = Pattern.compile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$");
focal_class.type: Pattern
focal_class.var_name: UUID_PATTERN
focal_class.declarator: imageDAO
focal_class.modifier: @Inject
      private
focal_class.original_string: @Inject
      private IImageDAO imageDAO;
focal_class.type: IImageDAO
focal_class.var_name: imageDAO
focal_class.file: alien4cloud-core/src/main/java/org/alien4cloud/tosca/catalog/index/ArchiveImageLoader.java
focal_class.identifier: ArchiveImageLoader
focal_class.class_method_signature: ArchiveImageLoader.importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors)
focal_class.full_signature: public void importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors)
focal_class.identifier: importImages
focal_class.modifiers: public
focal_class.parameters: (Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors)
focal_class.return: void
focal_class.signature: void importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors)
focal_class.class_method_signature: ArchiveImageLoader.importImages(Path archiveFile, Map<String, ? extends AbstractInheritableToscaType> toscaInheritableElement, List<ParsingError> parsingErrors)
focal_class.full_signature: private void importImages(Path archiveFile, Map<String, ? extends AbstractInheritableToscaType> toscaInheritableElement, List<ParsingError> parsingErrors)
focal_class.identifier: importImages
focal_class.modifiers: private
focal_class.parameters: (Path archiveFile, Map<String, ? extends AbstractInheritableToscaType> toscaInheritableElement, List<ParsingError> parsingErrors)
focal_class.return: void
focal_class.signature: void importImages(Path archiveFile, Map<String, ? extends AbstractInheritableToscaType> toscaInheritableElement, List<ParsingError> parsingErrors)
focal_class.class_method_signature: ArchiveImageLoader.importImages(Path archiveFile, List<Tag> tags, List<ParsingError> parsingErrors)
focal_class.full_signature: private void importImages(Path archiveFile, List<Tag> tags, List<ParsingError> parsingErrors)
focal_class.identifier: importImages
focal_class.modifiers: private
focal_class.parameters: (Path archiveFile, List<Tag> tags, List<ParsingError> parsingErrors)
focal_class.return: void
focal_class.signature: void importImages(Path archiveFile, List<Tag> tags, List<ParsingError> parsingErrors)
focal_class.class_method_signature: ArchiveImageLoader.importImage(Path archiveFile, List<ParsingError> parsingErrors, Tag iconTag)
focal_class.full_signature: private void importImage(Path archiveFile, List<ParsingError> parsingErrors, Tag iconTag)
focal_class.identifier: importImage
focal_class.modifiers: private
focal_class.parameters: (Path archiveFile, List<ParsingError> parsingErrors, Tag iconTag)
focal_class.return: void
focal_class.signature: void importImage(Path archiveFile, List<ParsingError> parsingErrors, Tag iconTag)
focal_class.class_method_signature: ArchiveImageLoader.safeToString(Path path)
focal_class.full_signature: private String safeToString(Path path)
focal_class.identifier: safeToString
focal_class.modifiers: private
focal_class.parameters: (Path path)
focal_class.return: String
focal_class.signature: String safeToString(Path path)
focal_class.class_method_signature: ArchiveImageLoader.getIconTag(List<Tag> tags)
focal_class.full_signature: public static Tag getIconTag(List<Tag> tags)
focal_class.identifier: getIconTag
focal_class.modifiers: public static
focal_class.parameters: (List<Tag> tags)
focal_class.return: Tag
focal_class.signature: Tag getIconTag(List<Tag> tags)
focal_method.body: public void importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors) {
          // Import archive icons
          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);
          // Import topology icon
          importImages(archiveFile, archiveRoot.getArchive().getTags(), parsingErrors);
          if (archiveRoot.getArchive().isHasTopology()) {
              importImages(archiveFile, archiveRoot.getTopology().getTags(), parsingErrors);
          }
      }
focal_method.class_method_signature: ArchiveImageLoader.importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors)
focal_method.full_signature: public void importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors)
focal_method.identifier: importImages
focal_method.invocations: importImages getNodeTypes importImages getRelationshipTypes importImages getCapabilityTypes importImages getArtifactTypes importImages getPolicyTypes importImages getTags getArchive isHasTopology getArchive importImages getTags getTopology
focal_method.modifiers: public
focal_method.parameters: (Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors)
focal_method.return: void
focal_method.signature: void importImages(Path archiveFile, ArchiveRoot archiveRoot, List<ParsingError> parsingErrors)