Package jodd.typeconverter.impl

Examples of jodd.typeconverter.impl.BooleanArrayConverter.convert()


  @Test
  public void testConversion() {
    BooleanArrayConverter booleanArrayConverter = (BooleanArrayConverter) TypeConverterManager.lookup(boolean[].class);

    assertNull(booleanArrayConverter.convert(null));

    boolean[] primitiveArray = new boolean[]{false, true, false};
    Object convertedArray = booleanArrayConverter.convert(primitiveArray);
    assertEquals(boolean[].class, convertedArray.getClass());
View Full Code Here


    BooleanArrayConverter booleanArrayConverter = (BooleanArrayConverter) TypeConverterManager.lookup(boolean[].class);

    assertNull(booleanArrayConverter.convert(null));

    boolean[] primitiveArray = new boolean[]{false, true, false};
    Object convertedArray = booleanArrayConverter.convert(primitiveArray);
    assertEquals(boolean[].class, convertedArray.getClass());

    Boolean[] booleanArray = new Boolean[]{Boolean.FALSE, Boolean.TRUE, Boolean.FALSE};
    convertedArray = booleanArrayConverter.convert(booleanArray);
    assertEquals(boolean[].class, convertedArray.getClass());    // boolean[]!
View Full Code Here

    boolean[] primitiveArray = new boolean[]{false, true, false};
    Object convertedArray = booleanArrayConverter.convert(primitiveArray);
    assertEquals(boolean[].class, convertedArray.getClass());

    Boolean[] booleanArray = new Boolean[]{Boolean.FALSE, Boolean.TRUE, Boolean.FALSE};
    convertedArray = booleanArrayConverter.convert(booleanArray);
    assertEquals(boolean[].class, convertedArray.getClass());    // boolean[]!

    assertEq(arrl(true), booleanArrayConverter.convert(Boolean.TRUE));
    assertEq(arrl(true), booleanArrayConverter.convert("true"));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrl(true, false, true)));
View Full Code Here

    Boolean[] booleanArray = new Boolean[]{Boolean.FALSE, Boolean.TRUE, Boolean.FALSE};
    convertedArray = booleanArrayConverter.convert(booleanArray);
    assertEquals(boolean[].class, convertedArray.getClass());    // boolean[]!

    assertEq(arrl(true), booleanArrayConverter.convert(Boolean.TRUE));
    assertEq(arrl(true), booleanArrayConverter.convert("true"));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrl(true, false, true)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arri(-7, 0, 3)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrf(-7.0f, 0.0f, 3.0f)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs("true", "0", "yes")));
View Full Code Here

    Boolean[] booleanArray = new Boolean[]{Boolean.FALSE, Boolean.TRUE, Boolean.FALSE};
    convertedArray = booleanArrayConverter.convert(booleanArray);
    assertEquals(boolean[].class, convertedArray.getClass());    // boolean[]!

    assertEq(arrl(true), booleanArrayConverter.convert(Boolean.TRUE));
    assertEq(arrl(true), booleanArrayConverter.convert("true"));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrl(true, false, true)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arri(-7, 0, 3)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrf(-7.0f, 0.0f, 3.0f)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs("true", "0", "yes")));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs(" true ", "0", " yes ")));
View Full Code Here

    convertedArray = booleanArrayConverter.convert(booleanArray);
    assertEquals(boolean[].class, convertedArray.getClass());    // boolean[]!

    assertEq(arrl(true), booleanArrayConverter.convert(Boolean.TRUE));
    assertEq(arrl(true), booleanArrayConverter.convert("true"));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrl(true, false, true)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arri(-7, 0, 3)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrf(-7.0f, 0.0f, 3.0f)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs("true", "0", "yes")));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs(" true ", "0", " yes ")));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(" true , 0,  yes "));
View Full Code Here

    assertEquals(boolean[].class, convertedArray.getClass());    // boolean[]!

    assertEq(arrl(true), booleanArrayConverter.convert(Boolean.TRUE));
    assertEq(arrl(true), booleanArrayConverter.convert("true"));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrl(true, false, true)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arri(-7, 0, 3)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrf(-7.0f, 0.0f, 3.0f)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs("true", "0", "yes")));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs(" true ", "0", " yes ")));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(" true , 0,  yes "));
  }
View Full Code Here

    assertEq(arrl(true), booleanArrayConverter.convert(Boolean.TRUE));
    assertEq(arrl(true), booleanArrayConverter.convert("true"));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrl(true, false, true)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arri(-7, 0, 3)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrf(-7.0f, 0.0f, 3.0f)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs("true", "0", "yes")));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs(" true ", "0", " yes ")));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(" true , 0,  yes "));
  }
View Full Code Here

    assertEq(arrl(true), booleanArrayConverter.convert(Boolean.TRUE));
    assertEq(arrl(true), booleanArrayConverter.convert("true"));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrl(true, false, true)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arri(-7, 0, 3)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrf(-7.0f, 0.0f, 3.0f)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs("true", "0", "yes")));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs(" true ", "0", " yes ")));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(" true , 0,  yes "));
  }

  @Test
View Full Code Here

    assertEq(arrl(true), booleanArrayConverter.convert("true"));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrl(true, false, true)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arri(-7, 0, 3)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrf(-7.0f, 0.0f, 3.0f)));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs("true", "0", "yes")));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs(" true ", "0", " yes ")));
    assertEq(arrl(true, false, true), booleanArrayConverter.convert(" true , 0,  yes "));
  }

  @Test
  public void testArrayConversion() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.