Package org.apache.ws.jaxme.xs.util

Examples of org.apache.ws.jaxme.xs.util.XsDateTimeFormat.parseObject()


      "2004-01-14T03:12:07+00:00",
    };
        XsDateTimeFormat format = new XsDateTimeFormat();
        Calendar expect = getCalendar(TimeZone.getTimeZone("GMT"));
        for (int i = 0;  i < dateTimes.length;  i++) {
            Calendar got = (Calendar) format.parseObject(dateTimes[0]);
            assertEquals(expect.getTimeInMillis(), got.getTimeInMillis());
        }

        String dateTime = "2004-01-14T03:12:07.000-03:00";
        expect = getCalendar(TimeZone.getTimeZone("GMT-03:00"));
View Full Code Here


            assertEquals(expect.getTimeInMillis(), got.getTimeInMillis());
        }

        String dateTime = "2004-01-14T03:12:07.000-03:00";
        expect = getCalendar(TimeZone.getTimeZone("GMT-03:00"));
        Calendar got = (Calendar) format.parseObject(dateTime);
        assertEquals(expect.getTimeInMillis(), got.getTimeInMillis());
    }

    public void testFormatDate() {
        Calendar cal = getCalendar(TimeZone.getTimeZone("GMT"));
View Full Code Here

    /** Test for JAXME-42 in Jira.
     */
    public void testJira42() throws Exception {
      XsDateTimeFormat f = new XsDateTimeFormat();
        Calendar cal = (Calendar) f.parseObject("2004-10-15T13:00:00Z");
        assertEquals(2004, cal.get(Calendar.YEAR));
        assertEquals(9, cal.get(Calendar.MONTH));
        assertEquals(15, cal.get(Calendar.DAY_OF_MONTH));
        assertEquals(13, cal.get(Calendar.HOUR_OF_DAY));
        assertEquals(0, cal.get(Calendar.MINUTE));
View Full Code Here

    }

    public Calendar parseDateTime(String arg0) {
        XsDateTimeFormat format = new XsDateTimeFormat();
        ParsePosition pos = new ParsePosition(0);
        Calendar cal = (Calendar) format.parseObject(arg0, pos);
        if (cal == null) {
            throw new IllegalArgumentException("Failed to parse dateTime " + arg0 +
                                   " at:" + arg0.substring(pos.getErrorIndex()));
        }
        return cal;
View Full Code Here

    /** Test for JAXME-42 in Jira.
     */
    public void testJira42() throws Exception {
      XsDateTimeFormat f = new XsDateTimeFormat();
        Calendar cal = (Calendar) f.parseObject("2004-10-15T13:00:00Z");
        assertEquals(2004, cal.get(Calendar.YEAR));
        assertEquals(9, cal.get(Calendar.MONTH));
        assertEquals(15, cal.get(Calendar.DAY_OF_MONTH));
        assertEquals(13, cal.get(Calendar.HOUR_OF_DAY));
        assertEquals(0, cal.get(Calendar.MINUTE));
View Full Code Here

      "2004-01-14T03:12:07+00:00",
    };
        XsDateTimeFormat format = new XsDateTimeFormat();
        Calendar expect = getCalendar(TimeZone.getTimeZone("GMT"));
        for (int i = 0;  i < dateTimes.length;  i++) {
            Calendar got = (Calendar) format.parseObject(dateTimes[0]);
            assertEquals(expect, got);
        }

        String dateTime = "2004-01-14T03:12:07.000-03:00";
        expect = getCalendar(TimeZone.getTimeZone("GMT-03:00"));
View Full Code Here

            assertEquals(expect, got);
        }

        String dateTime = "2004-01-14T03:12:07.000-03:00";
        expect = getCalendar(TimeZone.getTimeZone("GMT-03:00"));
        Calendar got = (Calendar) format.parseObject(dateTime);
        assertEquals(expect, got);
    }

    /** Test for
     * {@link org.apache.ws.jaxme.xs.util.XsDateFormat#format(Object, StringBuffer, java.text.FieldPosition)}.
View Full Code Here

    /** Test for JAXME-42 in Jira.
     */
    public void testJira42() throws Exception {
      XsDateTimeFormat f = new XsDateTimeFormat();
        Calendar cal = (Calendar) f.parseObject("2004-10-15T13:00:00Z");
        assertEquals(2004, cal.get(Calendar.YEAR));
        assertEquals(9, cal.get(Calendar.MONTH));
        assertEquals(15, cal.get(Calendar.DAY_OF_MONTH));
        assertEquals(13, cal.get(Calendar.HOUR_OF_DAY));
        assertEquals(0, cal.get(Calendar.MINUTE));
View Full Code Here

      "2004-01-14T03:12:07+00:00",
    };
        XsDateTimeFormat format = new XsDateTimeFormat();
        Calendar expect = getCalendar(TimeZone.getTimeZone("GMT"));
        for (int i = 0;  i < dateTimes.length;  i++) {
            Calendar got = (Calendar) format.parseObject(dateTimes[0]);
            assertEquals(expect, got);
        }

        String dateTime = "2004-01-14T03:12:07.000-03:00";
        expect = getCalendar(TimeZone.getTimeZone("GMT-03:00"));
View Full Code Here

            assertEquals(expect, got);
        }

        String dateTime = "2004-01-14T03:12:07.000-03:00";
        expect = getCalendar(TimeZone.getTimeZone("GMT-03:00"));
        Calendar got = (Calendar) format.parseObject(dateTime);
        assertEquals(expect, got);
    }

    /** Test for
     * {@link org.apache.ws.jaxme.xs.util.XsDateFormat#format(Object, StringBuffer, java.text.FieldPosition)}.
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.