Package jodd.typeconverter.impl

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


  @Test
  public void testConversion() {
    MutableDoubleConverter mutableDoubleConverter = (MutableDoubleConverter) TypeConverterManager.lookup(MutableDouble.class);

    assertNull(mutableDoubleConverter.convert(null));

    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new MutableDouble(1.73)));
    assertEquals(new MutableDouble(1), mutableDoubleConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(Double.valueOf(1.73D)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert("1.73"));
View Full Code Here


  public void testConversion() {
    MutableDoubleConverter mutableDoubleConverter = (MutableDoubleConverter) TypeConverterManager.lookup(MutableDouble.class);

    assertNull(mutableDoubleConverter.convert(null));

    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new MutableDouble(1.73)));
    assertEquals(new MutableDouble(1), mutableDoubleConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(Double.valueOf(1.73D)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert("1.73"));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(" 1.73 "));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new BigDecimal("1.73")));
View Full Code Here

    MutableDoubleConverter mutableDoubleConverter = (MutableDoubleConverter) TypeConverterManager.lookup(MutableDouble.class);

    assertNull(mutableDoubleConverter.convert(null));

    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new MutableDouble(1.73)));
    assertEquals(new MutableDouble(1), mutableDoubleConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(Double.valueOf(1.73D)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert("1.73"));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(" 1.73 "));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new BigDecimal("1.73")));
View Full Code Here

    assertNull(mutableDoubleConverter.convert(null));

    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new MutableDouble(1.73)));
    assertEquals(new MutableDouble(1), mutableDoubleConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(Double.valueOf(1.73D)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert("1.73"));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(" 1.73 "));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new BigDecimal("1.73")));

    try {
View Full Code Here

    assertNull(mutableDoubleConverter.convert(null));

    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new MutableDouble(1.73)));
    assertEquals(new MutableDouble(1), mutableDoubleConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(Double.valueOf(1.73D)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert("1.73"));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(" 1.73 "));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new BigDecimal("1.73")));

    try {
      mutableDoubleConverter.convert("aaaa");
View Full Code Here

    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new MutableDouble(1.73)));
    assertEquals(new MutableDouble(1), mutableDoubleConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(Double.valueOf(1.73D)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert("1.73"));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(" 1.73 "));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new BigDecimal("1.73")));

    try {
      mutableDoubleConverter.convert("aaaa");
      fail();
View Full Code Here

    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new MutableDouble(1.73)));
    assertEquals(new MutableDouble(1), mutableDoubleConverter.convert(Integer.valueOf(1)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(Double.valueOf(1.73D)));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert("1.73"));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(" 1.73 "));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new BigDecimal("1.73")));

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

    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert("1.73"));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(" 1.73 "));
    assertEquals(new MutableDouble(1.73), mutableDoubleConverter.convert(new BigDecimal("1.73")));

    try {
      mutableDoubleConverter.convert("aaaa");
      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.