Package org.dozer.vo

Examples of org.dozer.vo.CustomConverterWrapper


  @Test
  public void testHintedOnlyConverter() throws Exception {
    String hintStr = "where's my hint?";

    CustomConverterWrapper source = newInstance(CustomConverterWrapper.class);
    HintedOnly hint = newInstance(HintedOnly.class);
    hint.setStr(hintStr);
    source.addHint(hint);

    CustomConverterWrapperPrime dest = mapper.map(source, CustomConverterWrapperPrime.class);
    String destHintStr = (String) dest.getNeedsHint().iterator().next();
    assertNotNull(destHintStr);
    assertEquals(hintStr, destHintStr);

    CustomConverterWrapper sourcePrime = mapper.map(dest, CustomConverterWrapper.class);
    String sourcePrimeHintStr = ((HintedOnly) sourcePrime.getNeedsHint().iterator().next()).getStr();
    assertNotNull(sourcePrimeHintStr);
    assertEquals(hintStr, sourcePrimeHintStr);
  }
View Full Code Here


  @Test
  public void testHintedOnlyConverter() throws Exception {
    String hintStr = "where's my hint?";

    CustomConverterWrapper source = newInstance(CustomConverterWrapper.class);
    HintedOnly hint = newInstance(HintedOnly.class);
    hint.setStr(hintStr);
    source.addHint(hint);

    CustomConverterWrapperPrime dest = mapper.map(source, CustomConverterWrapperPrime.class);
    String destHintStr = (String) dest.getNeedsHint().iterator().next();
    assertNotNull(destHintStr);
    assertEquals(hintStr, destHintStr);

    CustomConverterWrapper sourcePrime = mapper.map(dest, CustomConverterWrapper.class);
    String sourcePrimeHintStr = ((HintedOnly) sourcePrime.getNeedsHint().iterator().next()).getStr();
    assertNotNull(sourcePrimeHintStr);
    assertEquals(hintStr, sourcePrimeHintStr);
  }
View Full Code Here

TOP

Related Classes of org.dozer.vo.CustomConverterWrapper

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.