Examples of DoubleToLongConverter


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

    }
   
    @Test
    public void testDoubleToLongConverter() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.getConverterFactory().registerConverter(new DoubleToLongConverter(false));
        MapperFacade mapper = factory.getMapperFacade();
       
        Double value = (double) Long.MAX_VALUE;
        Long result = mapper.map(value, Long.class);
        Assert.assertEquals(value.doubleValue(), result.doubleValue());
View Full Code Here

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

    }
   
    @Test(expected = MappingException.class)
    public void testDoubleToLongConverter_overflow() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.getConverterFactory().registerConverter(new DoubleToLongConverter(false));
        MapperFacade mapper = factory.getMapperFacade();
       
        Double value = (double) Long.MAX_VALUE + 10000.0;
        Long result = mapper.map(value, Long.class);
        Assert.assertEquals(value.doubleValue(), result.doubleValue());
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.