Package org.apache.padaf.xmpbox.type

Examples of org.apache.padaf.xmpbox.type.BooleanType


   * @throws IOException
   */
  @Test
  public void testSeqManagement() throws Exception {
    Calendar date = Calendar.getInstance();
    BooleanType bool = new BooleanType(parent, "rdf", "li", "True");
    String textVal = "seqValue";
    String seqName = "nsSchem:SEQNAME";

    schem.addSequenceDateValue(seqName, date);
    schem.addSequenceValue(seqName, bool);
    schem.addSequenceValue(seqName, textVal);

    List<Calendar> dates = schem.getSequenceDateValueList(seqName);
    Assert.assertEquals(1, dates.size());
    Assert.assertEquals(date, dates.get(0));

    List<String> values = schem.getSequenceValueList(seqName);
    Assert.assertEquals(3, values.size());
    Assert.assertEquals(DateConverter.toISO8601(date), values.get(0));
    Assert.assertEquals(bool.getStringValue(), values.get(1));
    Assert.assertEquals(textVal, values.get(2));

    /*
     * System.out.println("Seq Management :");
     * parent.getFuturOwner().appendChild(schem.getElement()); try {
View Full Code Here


    String bool = "nsSchem:booleanTestProp";
    Boolean boolVal = false;
    schem.setBooleanPropertyValue(bool, boolVal);
    Assert.assertEquals(boolVal, schem.getBooleanPropertyValue(bool));

    BooleanType boolType = new BooleanType(parent, "nsSchem", "boolType",
        false);
    schem.setBooleanProperty(boolType);
    Assert.assertEquals(boolType, schem
        .getBooleanProperty("nsSchem:boolType"));
View Full Code Here

  @Test
  public void testListAndContainerAccessor() throws Exception {
    String boolname = "bool";
    boolean boolVal = true;
    BooleanType bool = new BooleanType(parent, schem.getLocalPrefix(),
        boolname, boolVal);
    Attribute att = new Attribute(null, "rdf", "test", "vgh");
    schem.setAttribute(att);
    schem.setBooleanProperty(bool);
View Full Code Here

  protected void testGetSetBooleanProperty() throws Exception {
    String setName = setMethod(property);
    String getName = getMethod(property);

    BooleanType bt = new BooleanType(metadata, schema.getLocalPrefix(),
        property, value);
    Method setMethod = schemaClass.getMethod(setName, BooleanType.class);
    Method getMethod = schemaClass.getMethod(getName);

    setMethod.invoke(schema, bt);
View Full Code Here

        added = true;
      } else if (type.equals("Integer")) {
        schema.getContent().addProperty(new IntegerType(metadata, prefix, attr.getLocalName(), attr.getValue()));
        added = true;
      } else if (type.equals("Boolean")) {
        schema.getContent().addProperty(new BooleanType(metadata, prefix, attr.getLocalName(), attr.getValue()));
        added = true;
      } else if (type.equals("Real")) {
        schema.getContent().addProperty(new RealType(metadata, prefix, attr.getLocalName(), attr.getValue()));
        added = true;
      } else if (type.equals("Date")) {
View Full Code Here

      } else if (stype == XmpPropertyType.Date) {
        prop = new DateType(metadata, propertyName.getPrefix(),
            propertyName.getLocalPart(), reader.get()
            .getElementText());
      } else if (stype == XmpPropertyType.Boolean) {
        prop = new BooleanType(metadata, propertyName.getPrefix(),
            propertyName.getLocalPart(), reader.get()
            .getElementText());
      } else if (stype == XmpPropertyType.Real) {
        prop = new RealType(metadata, propertyName.getPrefix(),
            propertyName.getLocalPart(), reader.get()
View Full Code Here

   *
   * @throws InappropriateTypeException
   */
  @Test(expected = IllegalArgumentException.class)
  public void testBooleanBadTypeDetection() {
    new BooleanType(parent, "test", "booleen", "Not a Boolean");
  }
View Full Code Here

    boolean boolv = true;
    Calendar datev = Calendar.getInstance();
    int integerv = 1;
    float realv = Float.parseFloat("1.69");
    String textv = "TEXTCONTENT";
    BooleanType bool = new BooleanType(parent, "test", "booleen", boolv);
    DateType date = new DateType(parent, "test", "date", datev);
    IntegerType integer = new IntegerType(parent, "test", "integer",
        integerv);
    RealType real = new RealType(parent, "test", "real", realv);
    TextType text = new TextType(parent, "test", "text", textv);

    Assert.assertEquals(bool.getNamespace(), bool.getElement()
        .getNamespaceURI());
    Assert.assertEquals(bool.getPrefix() + ":" + bool.getPropertyName(),
        bool.getElement().getNodeName());
    Assert.assertEquals(bool.getQualifiedName(), bool.getElement()
        .getNodeName());
    Assert.assertEquals(boolv, bool.getValue());
    Assert.assertEquals(datev, date.getValue());
    Assert.assertEquals(integerv, integer.getValue());
    Assert.assertEquals(realv, real.getValue(), 0);
    Assert.assertEquals(textv, text.getStringValue());
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void testObjectCreationFromJavaType() throws Exception {
    BooleanType bool = new BooleanType(parent, "test", "booleen", true);
    DateType date = new DateType(parent, "test", "date", Calendar
        .getInstance());
    IntegerType integer = new IntegerType(parent, "test", "integer", 1);
    RealType real = new RealType(parent, "test", "real", (float) 1.6);
    TextType text = new TextType(parent, "test", "text", "TEST");

    Element e = parent.getFuturOwner().createElement("TEST");
    parent.getFuturOwner().appendChild(e);
    e.appendChild(bool.getElement());
    e.appendChild(date.getElement());
    e.appendChild(integer.getElement());
    e.appendChild(real.getElement());
    e.appendChild(text.getElement());

View Full Code Here

    String datev = "2010-03-22T14:33:11+01:00";
    String integerv = "10";
    String realv = "1.92";
    String textv = "text";

    BooleanType bool = new BooleanType(parent, "test", "booleen", boolv);
    DateType date = new DateType(parent, "test", "date", datev);
    IntegerType integer = new IntegerType(parent, "test", "integer",
        integerv);
    RealType real = new RealType(parent, "test", "real", realv);
    TextType text = new TextType(parent, "test", "text", textv);

    Assert.assertEquals(boolv, bool.getStringValue());
    Assert.assertEquals(datev, date.getStringValue());
    Assert.assertEquals(integerv, integer.getStringValue());
    Assert.assertEquals(realv, real.getStringValue());
    Assert.assertEquals(textv, text.getStringValue());
  }
View Full Code Here

TOP

Related Classes of org.apache.padaf.xmpbox.type.BooleanType

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.