Package jodd.typeconverter.impl

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


  @Test
  public void testConversion() {
    MutableByteConverter mutableByteConverter = (MutableByteConverter) TypeConverterManager.lookup(MutableByte.class);

    assertNull(mutableByteConverter.convert(null));

    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(new MutableByte((byte) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Short.valueOf((short) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Double.valueOf(1.0D)));
View Full Code Here


  public void testConversion() {
    MutableByteConverter mutableByteConverter = (MutableByteConverter) TypeConverterManager.lookup(MutableByte.class);

    assertNull(mutableByteConverter.convert(null));

    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(new MutableByte((byte) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Short.valueOf((short) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Double.valueOf(1.0D)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert("1"));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(" 1 "));
View Full Code Here

    MutableByteConverter mutableByteConverter = (MutableByteConverter) TypeConverterManager.lookup(MutableByte.class);

    assertNull(mutableByteConverter.convert(null));

    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(new MutableByte((byte) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Short.valueOf((short) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Double.valueOf(1.0D)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert("1"));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(" 1 "));
View Full Code Here

    assertNull(mutableByteConverter.convert(null));

    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(new MutableByte((byte) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Short.valueOf((short) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Double.valueOf(1.0D)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert("1"));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(" 1 "));

    try {
View Full Code Here

    assertNull(mutableByteConverter.convert(null));

    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(new MutableByte((byte) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Short.valueOf((short) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Double.valueOf(1.0D)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert("1"));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(" 1 "));

    try {
      mutableByteConverter.convert("a");
View Full Code Here

    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(new MutableByte((byte) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Short.valueOf((short) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Double.valueOf(1.0D)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert("1"));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(" 1 "));

    try {
      mutableByteConverter.convert("a");
      fail();
View Full Code Here

    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(new MutableByte((byte) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Short.valueOf((short) 1)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Double.valueOf(1.0D)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert("1"));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(" 1 "));

    try {
      mutableByteConverter.convert("a");
      fail();
    } catch (TypeConversionException ignore) {
View Full Code Here

    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(Double.valueOf(1.0D)));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert("1"));
    assertEquals(new MutableByte((byte) 1), mutableByteConverter.convert(" 1 "));

    try {
      mutableByteConverter.convert("a");
      fail();
    } catch (TypeConversionException ignore) {
    }
  }
}
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.