Package org.apache.deltacloud.client

Examples of org.apache.deltacloud.client.Property


    new HardwareProfileUnmarshaller().unmarshall(inputStream, profile);
    assertNotNull(profile);
    assertEquals(HardwareProfile2Response.id, profile.getId());
    assertEquals(HardwareProfile2Response.propMemValue + ' ' + HardwareProfile2Response.propMemUnit,
        profile.getMemory());
    Property property = profile.getNamedProperty(Property.Names.MEMORY);
    assertNotNull(property);
    assertEquals(HardwareProfile2Response.propMemRangeFirst, property.getRange().getFirst());
    assertEquals(HardwareProfile2Response.propMemRangeLast, property.getRange().getLast());
    assertEquals(HardwareProfile2Response.propStorageValue + ' ' + HardwareProfile2Response.propStorageUnit,
        profile.getStorage());
    property = profile.getNamedProperty(Property.Names.STORAGE);
    assertNotNull(property);
    assertNotNull(property.getEnums());
    assertEquals(2, property.getEnums().size());
    assertEquals(HardwareProfile2Response.propStorageEnum1, property.getEnums().get(0));
    assertEquals(HardwareProfile2Response.propStorageEnum2, property.getEnums().get(1));
    assertEquals(HardwareProfile2Response.propCPUValue, profile.getCPU());
    assertEquals(HardwareProfile2Response.propArchValue, profile.getArchitecture());
  }
View Full Code Here


  }

  private List<Property> createProperties(NodeList propertiesList) {
    List<Property> properties = new ArrayList<Property>();
    for (int i = 0; i < propertiesList.getLength(); i++) {
      Property property = createProperty(propertiesList.item(i));
      properties.add(property);
    }
    return properties;
  }
View Full Code Here

  }

  private Property createProperty(Node node) {
    Assert.isTrue(node instanceof Element);
    Element element = (Element) node;
    Property property = new Property();
    property.setName(element.getAttribute("name"));
    property.setId(element.getAttribute("id"));
    property.setUnit(element.getAttribute("unit"));
    property.setValue(element.getAttribute("value"));
    String kind = element.getAttribute("kind");
    Assert.isTrue(kind != null);
    kind = kind.toUpperCase();
    property.setKind(kind);
    if (Kind.RANGE.toString().equals(property.getKind())) {
      setRange(element, property);
    } else if (Kind.ENUM.toString().equals(property.getKind())) {
      setEnum(element, property);
    } else if (Kind.FIXED.toString().equals(property.getKind())) {
      // no special treatement
    }
    return property;
  }
View Full Code Here

TOP

Related Classes of org.apache.deltacloud.client.Property

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.