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

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


    }
   
    @Test
    public void testLongToShortConverter() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.getConverterFactory().registerConverter(new LongToShortConverter(false));
        MapperFacade mapper = factory.getMapperFacade();
       
        Long value = (long) Short.MAX_VALUE;
        Short result = mapper.map(value, Short.class);
        Assert.assertEquals(value.longValue(), result.longValue());
View Full Code Here


    // ~ overflow exceptions
   
    @Test(expected = MappingException.class)
    public void testLongToShortConverter_overflow() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.getConverterFactory().registerConverter(new LongToShortConverter(false));
        MapperFacade mapper = factory.getMapperFacade();
       
        Long value = (long) Short.MAX_VALUE + 1;
        Short result = mapper.map(value, Short.class);
        Assert.assertEquals(value.longValue(), result.longValue());
View Full Code Here

TOP

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

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.