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

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


    }
   
    @Test
    public void testBigIntegerToLongConverter() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.getConverterFactory().registerConverter(new BigIntegerToLongConverter(false));
        MapperFacade mapper = factory.getMapperFacade();
       
        BigInteger bi = new BigInteger("" + Long.MAX_VALUE);
        Long lg = mapper.map(bi, Long.class);
        Assert.assertEquals(bi.longValue(), lg.longValue());
View Full Code Here


    }
   
    @Test(expected = MappingException.class)
    public void testBigIntegerToLongConverter_Overflow() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.getConverterFactory().registerConverter(new BigIntegerToLongConverter(false));
        MapperFacade mapper = factory.getMapperFacade();
       
        BigInteger bi = new BigInteger("1" + Long.MAX_VALUE);
        Long lg = mapper.map(bi, Long.class);
        Assert.assertEquals(bi.longValue(), lg.longValue());
View Full Code Here

TOP

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

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.