test_class.declarator: basedir
test_class.modifier: private
test_class.original_string: private String basedir;
test_class.type: String
test_class.var_name: basedir
test_class.file: oneops-model/src/test/java/com/oneops/yaml/OneOpsYamlReaderTest.java
test_class.identifier: OneOpsYamlReaderTest
test_case.body: @Test
    public void validateReadingAssembly() throws Exception {
  
      OneOpsYamlReader reader = new OneOpsYamlReader();
      OneOps oneops = reader.read(yaml("src/test/yaml/oo-v2", "assembly.yaml"), OneOps.class);
  
      assertEquals("auth-key", oneops.getApikey());
      assertEquals("https://localhost:9000/", oneops.getHost());
      assertEquals("local-org", oneops.getOrganization());
  
      Assembly assembly = oneops.getAssembly();
      // Assembly
      assertEquals("assembly-name", assembly.getName());
      Map<String, String> variables = assembly.getVariables();
      assertEquals("variable-value-0", variables.get("variable-0"));
      assertEquals("variable-value-1", variables.get("variable-1"));
  
      Map<String, String> encryptedVariables = assembly.getEncryptedvariables();
      assertEquals("encrypted-variable-value-0", encryptedVariables.get("encrypted-variable-0"));
  
      // Tags
      Map<String, String> tags = assembly.getTags();
      assertEquals("tag-value-0", tags.get("tag-0"));
      assertEquals("tag-value-1", tags.get("tag-1"));
      // Platform 0
      List<Platform> platforms = assembly.getPlatformList();
      Platform p0 = platforms.get(0);
      assertEquals("platform-0", p0.getName());
      assertEquals("source/pack-platform-0", p0.getPack());
      assertEquals("1", p0.getPackVersion());
      // Links
      List<String> links = p0.getLinks();
      assertEquals("platform-0-link-0", links.get(0));
      assertEquals("platform-0-link-1", links.get(1));
      // Variables
      Map<String, String> platformVariables = p0.getVariables();
      assertEquals("pack-platform-0-variable-0-value",
          platformVariables.get("pack-platform-variable-0"));
      assertEquals("pack-platform-0-variable-1-value",
          platformVariables.get("pack-platform-variable-1"));
  
      Map<String, String> encryptedPlatformVariables = p0.getEncryptedvariables();
      assertEquals("encrypted-pack-platform-0-variable-0-value",
          encryptedPlatformVariables.get("encrypted-pack-platform-variable-0"));
      // Components
      List<Component> components = p0.getComponentList();
      Component c0 = components.get(0);
      assertEquals("component-0", c0.getId());
      Map<String, String> config = c0.getConfiguration();
      assertEquals("platform-0-config-0-value", config.get("config-0"));
      assertEquals("platform-0-config-1-value", config.get("config-1"));
      // Platform 1
      assertEquals("platform-1", platforms.get(1).getName());
      assertEquals("1", platforms.get(1).getConfiguration().get("version"));
      List<Component> pcomps = platforms.get(1).getComponentList();
      // Attachment
      List<Attachment> pAttachments = pcomps.get(0).getAttachmentList();
      Attachment pa0 = pAttachments.get(0);
      assertEquals("attachment1", pa0.getId());
      Map<String, String> paconfig0 = pa0.getConfiguration();
      assertEquals("before-add,before-update,before-replace", paconfig0.get("run_on"));
  
      // Environment
      List<Environment> environments = assembly.getEnvironmentList();
      Environment e0 = environments.get(0);
      assertEquals("environment-0", e0.getName());
      assertTrue(e0.isGlobaldns());
      assertEquals("redundant", e0.getAvailability());
      //Environment global variable
      assertEquals("variable-new-value-0", e0.getVariables().get("variable-0"));
      assertEquals("encrypted-variable-new-value-0",
          e0.getEncryptedvariables().get("encrypted-variable-0"));
      //Environment platform
      List<Platform> environmentPlatforms = e0.getPlatformList();
      Platform ep0 = environmentPlatforms.get(0);
      assertEquals("platform-1", ep0.getName());
      assertEquals("false", ep0.getEnable());
  
      //auto-healing
      Map<String, String> ep0config = ep0.getConfiguration();
      assertEquals("redundant", ep0config.get("availability"));
      assertEquals("false", ep0config.get("autorepair"));
      assertEquals("true", ep0config.get("autoreplace"));
      assertEquals("55", ep0config.get("replace_after_minutes"));
      assertEquals("4", ep0config.get("replace_after_repairs"));
      //scale
      Map<String, Map<String, String>> scale = ep0.getScale();
      Map<String, String> computeScale = scale.get("compute");
      assertEquals("3", computeScale.get("current"));
      assertEquals("1", computeScale.get("min"));
      assertEquals("5", computeScale.get("max"));
  
      //Environment platform variable
      assertEquals("pack-platform-0-variable-0-new-value",
          ep0.getVariables().get("pack-platform-variable-0"));
  
      List<Component> environmentComponents = ep0.getComponentList();
      Component epc0 = environmentComponents.get(0);
      assertEquals("component-0", epc0.getId());
      assertEquals("component-0-type", epc0.getType());
      assertEquals("true", epc0.getTouch());
      Map<String, String> config0 = epc0.getConfiguration();
      assertEquals("platform-1-config-0-value", config0.get("config-2"));
      assertEquals("platform-1-config-1-value", config0.get("config-3"));
      // Attachment
      List<Attachment> epAttachments = epc0.getAttachmentList();
      Attachment epa0 = epAttachments.get(0);
      assertEquals("attachment1", epa0.getId());
      Map<String, String> epaconfig0 = epa0.getConfiguration();
      assertEquals("before-add,before-update,before-replace", epaconfig0.get("run_on"));
      // Cloud
      List<Cloud> clouds = e0.getCloudList();
      Cloud cloud = clouds.get(0);
      assertEquals(1, cloud.getPriority());
      assertEquals(1, cloud.getDeploymentorder());
      assertEquals(100, cloud.getScalepercentage());
    }
test_case.class_method_signature: OneOpsYamlReaderTest.validateReadingAssembly()
test_case.full_signature: @Test public void validateReadingAssembly()
test_case.identifier: validateReadingAssembly
test_case.invocations: read yaml assertEquals getApikey assertEquals getHost assertEquals getOrganization getAssembly assertEquals getName getVariables assertEquals get assertEquals get getEncryptedvariables assertEquals get getTags assertEquals get assertEquals get getPlatformList get assertEquals getName assertEquals getPack assertEquals getPackVersion getLinks assertEquals get assertEquals get getVariables assertEquals get assertEquals get getEncryptedvariables assertEquals get getComponentList get assertEquals getId getConfiguration assertEquals get assertEquals get assertEquals getName get assertEquals get getConfiguration get getComponentList get getAttachmentList get get assertEquals getId getConfiguration assertEquals get getEnvironmentList get assertEquals getName assertTrue isGlobaldns assertEquals getAvailability assertEquals get getVariables assertEquals get getEncryptedvariables getPlatformList get assertEquals getName assertEquals getEnable getConfiguration assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get getScale get assertEquals get assertEquals get assertEquals get assertEquals get getVariables getComponentList get assertEquals getId assertEquals getType assertEquals getTouch getConfiguration assertEquals get assertEquals get getAttachmentList get assertEquals getId getConfiguration assertEquals get getCloudList get assertEquals getPriority assertEquals getDeploymentorder assertEquals getScalepercentage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void validateReadingAssembly()
focal_class.file: oneops-model/src/main/java/com/oneops/yaml/OneOpsYamlReader.java
focal_class.identifier: OneOpsYamlReader
focal_class.class_method_signature: OneOpsYamlReader.read(File yamlfile, Class<T> yamlModelClass)
focal_class.full_signature: public T read(File yamlfile, Class<T> yamlModelClass)
focal_class.identifier: read
focal_class.modifiers: public
focal_class.parameters: (File yamlfile, Class<T> yamlModelClass)
focal_class.return: T
focal_class.signature: T read(File yamlfile, Class<T> yamlModelClass)
focal_method.body: public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException {
      Yaml yaml = new Yaml();
      T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass);
      return yamlmodel;
    }
focal_method.class_method_signature: OneOpsYamlReader.read(File yamlfile, Class<T> yamlModelClass)
focal_method.full_signature: public T read(File yamlfile, Class<T> yamlModelClass)
focal_method.identifier: read
focal_method.invocations: loadAs
focal_method.modifiers: public
focal_method.parameters: (File yamlfile, Class<T> yamlModelClass)
focal_method.return: T
focal_method.signature: T read(File yamlfile, Class<T> yamlModelClass)