Examples of LongToShortConverter


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

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

    // ~ 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
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.