Examples of XmlGregorianCalendarProperty


Examples of org.mapstruct.ap.test.builtin.bean.XmlGregorianCalendarProperty

    public void shouldApplyBuiltInOnDateToXmlGregCal() throws ParseException, DatatypeConfigurationException {

        DateProperty source = new DateProperty();
        source.setProp( createDate( "31-08-1982 10:20:56" ) );

        XmlGregorianCalendarProperty target = DateToXmlGregCalMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp().toString() ).isEqualTo( "1982-08-31T10:20:56.000+02:00" );
    }
View Full Code Here

Examples of org.mapstruct.ap.test.builtin.bean.XmlGregorianCalendarProperty

    @Test
    @WithClasses({ DateProperty.class, XmlGregorianCalendarProperty.class, XmlGregCalToDateMapper.class })
    public void shouldApplyBuiltInOnXmlGregCalToDate() throws ParseException, DatatypeConfigurationException {

        XmlGregorianCalendarProperty source = new XmlGregorianCalendarProperty();
        source.setProp( createXmlCal( 1999, 3, 2, 60 ) );

        DateProperty target = XmlGregCalToDateMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp().toString() ).isEqualTo( "Tue Mar 02 00:00:00 CET 1999" );
View Full Code Here

Examples of org.mapstruct.ap.test.builtin.bean.XmlGregorianCalendarProperty

    public void shouldApplyBuiltInStringToXmlGregCal() throws ParseException, DatatypeConfigurationException {

        StringProperty source = new StringProperty();
        source.setProp( "05.07.1999" );

        XmlGregorianCalendarProperty target = StringToXmlGregCalMapper.INSTANCE.mapAndFormat( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp().toString() ).isEqualTo( "1999-07-05T00:00:00.000+02:00" );

        source.setProp( createLocaleDate( "31-08-1982 10:20:56" ) );

        target = StringToXmlGregCalMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp().toString() ).isEqualTo( "1982-08-31T10:20:00.000+02:00" );

    }
View Full Code Here

Examples of org.mapstruct.ap.test.builtin.bean.XmlGregorianCalendarProperty

    @Test
    @WithClasses({ StringProperty.class, XmlGregorianCalendarProperty.class, XmlGregCalToStringMapper.class })
    public void shouldApplyBuiltInXmlGregCalToString() throws ParseException, DatatypeConfigurationException {

        XmlGregorianCalendarProperty source = new XmlGregorianCalendarProperty();
        source.setProp( createXmlCal( 1999, 3, 2, 60 ) );

        StringProperty target = XmlGregCalToStringMapper.INSTANCE.mapAndFormat( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp() ).isEqualTo( "02.03.1999" );

        source.setProp( createXmlCal( 1999, 3, 2, 60 ) );

        target = XmlGregCalToStringMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp() ).isEqualTo( "1999-03-02+01:00" );
View Full Code Here

Examples of org.mapstruct.ap.test.builtin.bean.XmlGregorianCalendarProperty

    public void shouldApplyBuiltInOnCalendarToXmlGregCal() throws ParseException, DatatypeConfigurationException {

        CalendarProperty source = new CalendarProperty();
        source.setProp( createCalendar( "02.03.1999" ) );

        XmlGregorianCalendarProperty target = CalendarToXmlGregCalMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp().toString() ).isEqualTo( "1999-03-02T00:00:00.000+01:00" );
    }
View Full Code Here

Examples of org.mapstruct.ap.test.builtin.bean.XmlGregorianCalendarProperty

    @Test
    @WithClasses({ CalendarProperty.class, XmlGregorianCalendarProperty.class, XmlGregCalToCalendarMapper.class })
    public void shouldApplyBuiltInOnXmlGregCalToCalendar() throws ParseException, DatatypeConfigurationException {

        XmlGregorianCalendarProperty source = new XmlGregorianCalendarProperty();
        source.setProp( createXmlCal( 1999, 3, 2, 60 ) );

        CalendarProperty target = XmlGregCalToCalendarMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp().getTimeInMillis() ).isEqualTo( 920329200000L );
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.