test_class.file: org.eclipse.winery.crawler/src/test/java/org/eclipse/winery/crawler/chefcookbooks/chefcookbook/CookbookConfigurationToscaConverterTest.java
test_class.identifier: CookbookConfigurationToscaConverterTest
test_case.body: @Test
      public void createMyAppNode() {
          List<TNodeType> nodeTypes;
          ChefCookbookConfiguration cookbookConfiguration = new ChefCookbookConfiguration();
          cookbookConfiguration.setName("myapp");
          cookbookConfiguration.setVersion("1.0.0");
          cookbookConfiguration.setSupports(new Platform("ubuntu", "16.04"));
          cookbookConfiguration.addRequiredPackage(new ChefPackage("openjdk-8-jdk"));
          cookbookConfiguration.addRequiredPackage(new ChefPackage("openjdk-8-jre-headless"));
          cookbookConfiguration.addInstalledPackage(new ChefPackage("myapp", "1.1"));
          cookbookConfiguration.addInstalledPackage(new ChefPackage("myappaddon", "1.2"));
          nodeTypes = new CookbookConfigurationToscaConverter().convertCookbookConfigurationToToscaNode(cookbookConfiguration, 1);
  
          assertEquals(2, nodeTypes.size());
          assertEquals(true, nodeTypes.get(0).getCapabilityDefinitions().getCapabilityDefinition().get(0).getCapabilityType().toString().endsWith("myapp-1.1"));
          assertEquals(true, nodeTypes.get(0).getCapabilityDefinitions().getCapabilityDefinition().get(1).getCapabilityType().toString().endsWith("myappaddon-1.2"));
          assertEquals(true, nodeTypes.get(0).getRequirementDefinitions().getRequirementDefinition().get(1).getRequirementType().toString().endsWith("openjdk-8-jdk"));
          assertEquals(true, nodeTypes.get(0).getRequirementDefinitions().getRequirementDefinition().get(2).getRequirementType().toString().endsWith("openjdk-8-jre-headless"));
  
          assertEquals(true, nodeTypes.get(1).getCapabilityDefinitions().getCapabilityDefinition().get(0).getCapabilityType().toString().endsWith("ubuntu_16.04" + WineryVersion.WINERY_VERSION_SEPARATOR + WineryVersion.WINERY_VERSION_PREFIX + "1"));
      }
test_case.class_method_signature: CookbookConfigurationToscaConverterTest.createMyAppNode()
test_case.full_signature: @Test public void createMyAppNode()
test_case.identifier: createMyAppNode
test_case.invocations: setName setVersion setSupports addRequiredPackage addRequiredPackage addInstalledPackage addInstalledPackage convertCookbookConfigurationToToscaNode assertEquals size assertEquals endsWith toString getCapabilityType get getCapabilityDefinition getCapabilityDefinitions get assertEquals endsWith toString getCapabilityType get getCapabilityDefinition getCapabilityDefinitions get assertEquals endsWith toString getRequirementType get getRequirementDefinition getRequirementDefinitions get assertEquals endsWith toString getRequirementType get getRequirementDefinition getRequirementDefinitions get assertEquals endsWith toString getCapabilityType get getCapabilityDefinition getCapabilityDefinitions get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createMyAppNode()
focal_class.file: org.eclipse.winery.crawler/src/main/java/org/eclipse/winery/crawler/chefcookbooks/chefcookbook/CookbookConfigurationToscaConverter.java
focal_class.identifier: CookbookConfigurationToscaConverter
focal_class.class_method_signature: CookbookConfigurationToscaConverter.convertCookbookConfigurationToToscaNode(ChefCookbookConfiguration cookbookConfiguration, int counter)
focal_class.full_signature: public List<TNodeType> convertCookbookConfigurationToToscaNode(ChefCookbookConfiguration cookbookConfiguration, int counter)
focal_class.identifier: convertCookbookConfigurationToToscaNode
focal_class.modifiers: public
focal_class.parameters: (ChefCookbookConfiguration cookbookConfiguration, int counter)
focal_class.return: List<TNodeType>
focal_class.signature: List<TNodeType> convertCookbookConfigurationToToscaNode(ChefCookbookConfiguration cookbookConfiguration, int counter)
focal_class.class_method_signature: CookbookConfigurationToscaConverter.saveToscaNodeType(TNodeType tNodeType)
focal_class.full_signature: public void saveToscaNodeType(TNodeType tNodeType)
focal_class.identifier: saveToscaNodeType
focal_class.modifiers: public
focal_class.parameters: (TNodeType tNodeType)
focal_class.return: void
focal_class.signature: void saveToscaNodeType(TNodeType tNodeType)
focal_class.class_method_signature: CookbookConfigurationToscaConverter.convertInstalledPackagesToCapabilities(LinkedHashMap<String, ChefPackage> installedPackages, String namespace)
focal_class.full_signature: private List<TCapabilityDefinition> convertInstalledPackagesToCapabilities(LinkedHashMap<String, ChefPackage> installedPackages, String namespace)
focal_class.identifier: convertInstalledPackagesToCapabilities
focal_class.modifiers: private
focal_class.parameters: (LinkedHashMap<String, ChefPackage> installedPackages, String namespace)
focal_class.return: List<TCapabilityDefinition>
focal_class.signature: List<TCapabilityDefinition> convertInstalledPackagesToCapabilities(LinkedHashMap<String, ChefPackage> installedPackages, String namespace)
focal_class.class_method_signature: CookbookConfigurationToscaConverter.convertRequiredPackagesToRequirements(LinkedHashMap<String, ChefPackage> requiredPackages, String namespace)
focal_class.full_signature: private List<TRequirementDefinition> convertRequiredPackagesToRequirements(LinkedHashMap<String, ChefPackage> requiredPackages, String namespace)
focal_class.identifier: convertRequiredPackagesToRequirements
focal_class.modifiers: private
focal_class.parameters: (LinkedHashMap<String, ChefPackage> requiredPackages, String namespace)
focal_class.return: List<TRequirementDefinition>
focal_class.signature: List<TRequirementDefinition> convertRequiredPackagesToRequirements(LinkedHashMap<String, ChefPackage> requiredPackages, String namespace)
focal_class.class_method_signature: CookbookConfigurationToscaConverter.convertPackageToCapability(ChefPackage chefPackage, String namespace, int counter)
focal_class.full_signature: private TCapabilityDefinition convertPackageToCapability(ChefPackage chefPackage, String namespace, int counter)
focal_class.identifier: convertPackageToCapability
focal_class.modifiers: private
focal_class.parameters: (ChefPackage chefPackage, String namespace, int counter)
focal_class.return: TCapabilityDefinition
focal_class.signature: TCapabilityDefinition convertPackageToCapability(ChefPackage chefPackage, String namespace, int counter)
focal_class.class_method_signature: CookbookConfigurationToscaConverter.convertPackageToRequirement(ChefPackage chefPackage, String namespace, int counter)
focal_class.full_signature: private TRequirementDefinition convertPackageToRequirement(ChefPackage chefPackage, String namespace, int counter)
focal_class.identifier: convertPackageToRequirement
focal_class.modifiers: private
focal_class.parameters: (ChefPackage chefPackage, String namespace, int counter)
focal_class.return: TRequirementDefinition
focal_class.signature: TRequirementDefinition convertPackageToRequirement(ChefPackage chefPackage, String namespace, int counter)
focal_class.class_method_signature: CookbookConfigurationToscaConverter.convertPlatformToRequirement(Platform platform, String namespace)
focal_class.full_signature: private TRequirementDefinition convertPlatformToRequirement(Platform platform, String namespace)
focal_class.identifier: convertPlatformToRequirement
focal_class.modifiers: private
focal_class.parameters: (Platform platform, String namespace)
focal_class.return: TRequirementDefinition
focal_class.signature: TRequirementDefinition convertPlatformToRequirement(Platform platform, String namespace)
focal_class.class_method_signature: CookbookConfigurationToscaConverter.convertPlatformToCapability(Platform platform, String namespace)
focal_class.full_signature: private TCapabilityDefinition convertPlatformToCapability(Platform platform, String namespace)
focal_class.identifier: convertPlatformToCapability
focal_class.modifiers: private
focal_class.parameters: (Platform platform, String namespace)
focal_class.return: TCapabilityDefinition
focal_class.signature: TCapabilityDefinition convertPlatformToCapability(Platform platform, String namespace)
focal_class.class_method_signature: CookbookConfigurationToscaConverter.buildNamespaceForCookbookConfigs(String cookbookName, String cookbookVersion)
focal_class.full_signature: private String buildNamespaceForCookbookConfigs(String cookbookName, String cookbookVersion)
focal_class.identifier: buildNamespaceForCookbookConfigs
focal_class.modifiers: private
focal_class.parameters: (String cookbookName, String cookbookVersion)
focal_class.return: String
focal_class.signature: String buildNamespaceForCookbookConfigs(String cookbookName, String cookbookVersion)
focal_class.class_method_signature: CookbookConfigurationToscaConverter.buildNamespaceForPlatforms()
focal_class.full_signature: private String buildNamespaceForPlatforms()
focal_class.identifier: buildNamespaceForPlatforms
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String buildNamespaceForPlatforms()
focal_class.class_method_signature: CookbookConfigurationToscaConverter.convertPlatformToNodeType(Platform platform, String namespace)
focal_class.full_signature: private TNodeType convertPlatformToNodeType(Platform platform, String namespace)
focal_class.identifier: convertPlatformToNodeType
focal_class.modifiers: private
focal_class.parameters: (Platform platform, String namespace)
focal_class.return: TNodeType
focal_class.signature: TNodeType convertPlatformToNodeType(Platform platform, String namespace)
focal_method.body: public List<TNodeType> convertCookbookConfigurationToToscaNode(ChefCookbookConfiguration cookbookConfiguration, int counter) {
          List<TNodeType> nodeTypes = new ArrayList<>();
          String cookbookName = cookbookConfiguration.getName();
          String version = cookbookConfiguration.getVersion();
  
          String namespace = buildNamespaceForCookbookConfigs(cookbookName, version);
  
          TNodeType.Builder configurationNodeType = new TNodeType.Builder(cookbookName + WineryVersion.WINERY_VERSION_SEPARATOR + WineryVersion.WINERY_VERSION_PREFIX + counter);
          configurationNodeType.setTargetNamespace(namespace);
  
          TRequirementDefinition platform = convertPlatformToRequirement(cookbookConfiguration.getSupports(), namespace);
          configurationNodeType.addRequirementDefinitions(platform);
  
          TCapabilityDefinition installedPackage;
          List<TCapabilityDefinition> installedPackages = convertInstalledPackagesToCapabilities(cookbookConfiguration.getInstalledPackages(), namespace);
          for (int i = 0; i < installedPackages.size(); i++) {
              installedPackage = installedPackages.get(i);
              configurationNodeType.addCapabilityDefinitions(installedPackage);
          }
  
          TRequirementDefinition requiredPackage;
          List<TRequirementDefinition> requiredPackages = convertRequiredPackagesToRequirements(cookbookConfiguration.getRequiredPackages(), namespace);
          for (int i = 0; i < requiredPackages.size(); i++) {
              requiredPackage = requiredPackages.get(i);
              configurationNodeType.addRequirementDefinitions(requiredPackage);
          }
  
          TNodeType tNodeType = new TNodeType(configurationNodeType);
  
          TNodeType platformNodeType = convertPlatformToNodeType(cookbookConfiguration.getSupports(), namespace);
  
          nodeTypes.add(tNodeType);
          nodeTypes.add(platformNodeType);
          return nodeTypes;
      }
focal_method.class_method_signature: CookbookConfigurationToscaConverter.convertCookbookConfigurationToToscaNode(ChefCookbookConfiguration cookbookConfiguration, int counter)
focal_method.full_signature: public List<TNodeType> convertCookbookConfigurationToToscaNode(ChefCookbookConfiguration cookbookConfiguration, int counter)
focal_method.identifier: convertCookbookConfigurationToToscaNode
focal_method.invocations: getName getVersion buildNamespaceForCookbookConfigs setTargetNamespace convertPlatformToRequirement getSupports addRequirementDefinitions convertInstalledPackagesToCapabilities getInstalledPackages size get addCapabilityDefinitions convertRequiredPackagesToRequirements getRequiredPackages size get addRequirementDefinitions convertPlatformToNodeType getSupports add add
focal_method.modifiers: public
focal_method.parameters: (ChefCookbookConfiguration cookbookConfiguration, int counter)
focal_method.return: List<TNodeType>
focal_method.signature: List<TNodeType> convertCookbookConfigurationToToscaNode(ChefCookbookConfiguration cookbookConfiguration, int counter)