Examples of MyBeanPrimeShort


Examples of org.dozer.vo.enumtest.MyBeanPrimeShort

   * Test on a mapping from short types to enum.
   */
  @Test
  public void testShortMapsToEnum() {
    mapper = getMapper(new String[] { "enumMapping.xml" });
    MyBeanPrimeShort src = new MyBeanPrimeShort();
    src.setFirst((short) 0);
    src.setSecond((short) 1);
    MyBean dest = mapper.map(src, MyBean.class);
    assertEquals(SrcType.FOO, dest.getSrcType());
    assertEquals(SrcTypeWithOverride.BAR, dest.getSrcTypeWithOverride());
  }
View Full Code Here

Examples of org.dozer.vo.enumtest.MyBeanPrimeShort

  public void testEnumMapsToShort() {
    mapper = getMapper(new String[] { "enumMapping.xml" });
    MyBean src = new MyBean();
    src.setSrcType(SrcType.FOO);
    src.setSrcTypeWithOverride(SrcTypeWithOverride.BAR);
    MyBeanPrimeShort dest = mapper.map(src, MyBeanPrimeShort.class);
    assertEquals(0, dest.getFirst());
    assertEquals(Short.valueOf((short) 1), dest.getSecond());
  }
View Full Code Here

Examples of org.dozer.vo.enumtest.MyBeanPrimeShort

   */
  @SuppressWarnings("unused")
  @Test(expected = MappingException.class)
  public void testShortMapsToEnumOutOfOrdinalRange() {
    mapper = getMapper(new String[] { "enumMapping.xml" });
    MyBeanPrimeShort src = new MyBeanPrimeShort();
    src.setFirst((short) 0);
    src.setSecond((short) 3);
    MyBean dest = mapper.map(src, MyBean.class);
  }
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.