Examples of BigIntegerToIntegerConverter


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

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

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

    }
   
    @Test(expected = MappingException.class)
    public void testBigIntegerToIntegerConverter_Overflow() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.getConverterFactory().registerConverter(new BigIntegerToIntegerConverter(false));
        MapperFacade mapper = factory.getMapperFacade();
       
        BigInteger bi = new BigInteger("1" + Long.MAX_VALUE);
        Integer i = mapper.map(bi, Integer.class);
        Assert.assertEquals(bi.longValue(), i.longValue());
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.