Package jodd.typeconverter.impl

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


  @Test
  public void testConversion() {
    MutableLongConverter mutableLongConverter = (MutableLongConverter) TypeConverterManager.lookup(MutableLong.class);

    assertNull(mutableLongConverter.convert(null));

    assertEquals(new MutableLong(173), mutableLongConverter.convert(new MutableLong(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Integer.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Long.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Short.valueOf((short) 173)));
View Full Code Here


  public void testConversion() {
    MutableLongConverter mutableLongConverter = (MutableLongConverter) TypeConverterManager.lookup(MutableLong.class);

    assertNull(mutableLongConverter.convert(null));

    assertEquals(new MutableLong(173), mutableLongConverter.convert(new MutableLong(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Integer.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Long.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Short.valueOf((short) 173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Double.valueOf(173.0D)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Float.valueOf(173.0F)));
View Full Code Here

    MutableLongConverter mutableLongConverter = (MutableLongConverter) TypeConverterManager.lookup(MutableLong.class);

    assertNull(mutableLongConverter.convert(null));

    assertEquals(new MutableLong(173), mutableLongConverter.convert(new MutableLong(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Integer.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Long.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Short.valueOf((short) 173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Double.valueOf(173.0D)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Float.valueOf(173.0F)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert("173"));
View Full Code Here

    assertNull(mutableLongConverter.convert(null));

    assertEquals(new MutableLong(173), mutableLongConverter.convert(new MutableLong(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Integer.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Long.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Short.valueOf((short) 173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Double.valueOf(173.0D)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Float.valueOf(173.0F)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert("173"));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(" 173 "));
View Full Code Here

    assertNull(mutableLongConverter.convert(null));

    assertEquals(new MutableLong(173), mutableLongConverter.convert(new MutableLong(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Integer.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Long.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Short.valueOf((short) 173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Double.valueOf(173.0D)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Float.valueOf(173.0F)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert("173"));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(" 173 "));
View Full Code Here

    assertEquals(new MutableLong(173), mutableLongConverter.convert(new MutableLong(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Integer.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Long.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Short.valueOf((short) 173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Double.valueOf(173.0D)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Float.valueOf(173.0F)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert("173"));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(" 173 "));

    try {
View Full Code Here

    assertEquals(new MutableLong(173), mutableLongConverter.convert(new MutableLong(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Integer.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Long.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Short.valueOf((short) 173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Double.valueOf(173.0D)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Float.valueOf(173.0F)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert("173"));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(" 173 "));

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

    assertEquals(new MutableLong(173), mutableLongConverter.convert(Integer.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Long.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Short.valueOf((short) 173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Double.valueOf(173.0D)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Float.valueOf(173.0F)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert("173"));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(" 173 "));

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

    assertEquals(new MutableLong(173), mutableLongConverter.convert(Long.valueOf(173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Short.valueOf((short) 173)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Double.valueOf(173.0D)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(Float.valueOf(173.0F)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert("173"));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(" 173 "));

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

    assertEquals(new MutableLong(173), mutableLongConverter.convert(Float.valueOf(173.0F)));
    assertEquals(new MutableLong(173), mutableLongConverter.convert("173"));
    assertEquals(new MutableLong(173), mutableLongConverter.convert(" 173 "));

    try {
      mutableLongConverter.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.