Package ma.glasnost.orika.converter.builtin.NumericConverters

Examples of ma.glasnost.orika.converter.builtin.NumericConverters.FloatToLongConverter


    }
   
    @Test
    public void testFloatToLongConverter() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.getConverterFactory().registerConverter(new FloatToLongConverter(false));
        MapperFacade mapper = factory.getMapperFacade();
       
        Float value = (float) Long.MAX_VALUE;
        Long result = mapper.map(value, Long.class);
        Assert.assertEquals(value.floatValue(), result.floatValue());
View Full Code Here


    }
   
    @Test(expected = MappingException.class)
    public void testFloatToLongConverter_overflow() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.getConverterFactory().registerConverter(new FloatToLongConverter(false));
        MapperFacade mapper = factory.getMapperFacade();
       
        Float value = ((float) Long.MAX_VALUE) * 1.1f;
        Long result = mapper.map(value, Long.class);
        Assert.assertEquals(value.floatValue(), result.floatValue());
View Full Code Here

TOP

Related Classes of ma.glasnost.orika.converter.builtin.NumericConverters.FloatToLongConverter

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.