Package org.dozer.vo

Examples of org.dozer.vo.DateObjectDest


    DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
    XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar();
    xmlGregorianCalendar.setTimezone(2 * 60);
    source.setRecalledDate(xmlGregorianCalendar);

    DateObjectDest dest = mapper.map(source, DateObjectDest.class);

    assertEquals(source.getRecalledDate().getYear(), dest.getRecDate().getYear());
    assertEquals(source.getRecalledDate().getMonth(), dest.getRecDate().getMonth());
    assertEquals(source.getRecalledDate().getDay(), dest.getRecDate().getDay());
    assertEquals(source.getRecalledDate().getHour(), dest.getRecDate().getHour());
    assertEquals(source.getRecalledDate().getMinute(), dest.getRecDate().getMinute());
    assertEquals(source.getRecalledDate().getSecond(), dest.getRecDate().getSecond());
    assertEquals(source.getRecalledDate().getTimezone(), dest.getRecDate().getTimezone());

    //Test when instance exist
    dest = new DateObjectDest();
    dest.setRecDate(DatatypeFactory.newInstance().newXMLGregorianCalendar());

    mapper.map(source, dest);

    assertEquals(source.getRecalledDate(), dest.getRecDate());
  }
View Full Code Here


    DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
    XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar();
    xmlGregorianCalendar.setTimezone(2 * 60);
    source.setRecalledDate(xmlGregorianCalendar);

    DateObjectDest dest = mapper.map(source, DateObjectDest.class);

    assertEquals(source.getRecalledDate().getYear(), dest.getRecDate().getYear());
    assertEquals(source.getRecalledDate().getMonth(), dest.getRecDate().getMonth());
    assertEquals(source.getRecalledDate().getDay(), dest.getRecDate().getDay());
    assertEquals(source.getRecalledDate().getHour(), dest.getRecDate().getHour());
    assertEquals(source.getRecalledDate().getMinute(), dest.getRecDate().getMinute());
    assertEquals(source.getRecalledDate().getSecond(), dest.getRecDate().getSecond());
    assertEquals(source.getRecalledDate().getTimezone(), dest.getRecDate().getTimezone());

    //Test when instance exist
    dest = new DateObjectDest();
    dest.setRecDate(DatatypeFactory.newInstance().newXMLGregorianCalendar());

    mapper.map(source, dest);

    assertEquals(source.getRecalledDate(), dest.getRecDate());
  }
View Full Code Here

TOP

Related Classes of org.dozer.vo.DateObjectDest

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.