Examples of format()


Examples of org.apache.tapestry5.ioc.Messages.format()

    @Test
    public void builtin_message()
    {
        Messages messages = source.getValidationMessages(Locale.ENGLISH);

        assertEquals(messages.format("required", "My Field"), "You must provide a value for My Field.");
    }

    /** TAP5-424 */
    @Test
    public void application_catalog_override()
View Full Code Here

Examples of org.apache.uima.ducc.common.utils.SynchronizedSimpleDateFormat.format()

  public String getElapsed() {
    String elapsed = "";
    long elapsedTime = Long.valueOf(getDiff());
    SynchronizedSimpleDateFormat dateFormat = new SynchronizedSimpleDateFormat("HH:mm:ss");
    dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
    elapsed = dateFormat.format(new Date(elapsedTime));
    return elapsed;
  }
 
 
  public String getElapsed(IDuccWorkJob job) {
View Full Code Here

Examples of org.apache.velocity.tools.generic.DateTool.format()

        String disp = "2007-01-02";
        String disp2 = "2007/01/02";
        /* check configured format */
        assertEquals("yyyy-MM-dd",dateTool.getFormat());
        /* test formatting */
        assertEquals(disp,dateTool.format(date));
        assertEquals(disp2,dateTool.format("yyyy/MM/dd",date));
        /* test parsing */
        assertEquals(2007,dateTool.getYear(disp));
        assertEquals(0,dateTool.getMonth(disp));
        assertEquals(2,dateTool.getDay(disp));
View Full Code Here

Examples of org.apache.ws.commons.util.XsDateFormat.format()

     */
    public void testFormatDate() {
        Calendar cal = getCalendar(TimeZone.getTimeZone("GMT"));
        assertEquals(0, cal.get(Calendar.MILLISECOND));
        XsDateFormat format = new XsDateFormat();
        String got = format.format(cal);
        String expect = "2004-01-14Z";
        assertEquals(expect, got);

        cal = getCalendar(TimeZone.getTimeZone("GMT-03:00"));
        assertEquals(0, cal.get(Calendar.MILLISECOND));
View Full Code Here

Examples of org.apache.ws.commons.util.XsDateTimeFormat.format()

     */
    public void testFormatDateTime() {
        Calendar cal = getCalendar(TimeZone.getTimeZone("GMT"));
        assertEquals(0, cal.get(Calendar.MILLISECOND));
        XsDateTimeFormat format = new XsDateTimeFormat();
        String got = format.format(cal);
        String expect = "2004-01-14T03:12:07Z";
        assertEquals(expect, got);

        cal = getCalendar(TimeZone.getTimeZone("GMT-03:00"));
        assertEquals(0, cal.get(Calendar.MILLISECOND));
View Full Code Here

Examples of org.apache.ws.commons.util.XsTimeFormat.format()

     */
    public void testFormatTime() {
        Calendar cal = getCalendar(TimeZone.getTimeZone("GMT"));
        assertEquals(0, cal.get(Calendar.MILLISECOND));
        XsTimeFormat format = new XsTimeFormat();
        String got = format.format(cal);
        String expect = "03:12:07Z";
        assertEquals(expect, got);

        cal = getCalendar(TimeZone.getTimeZone("GMT-03:00"));
        assertEquals(0, cal.get(Calendar.MILLISECOND));
View Full Code Here

Examples of org.apache.ws.jaxme.xs.util.XsDateFormat.format()

    public void testFormatDate() {
        Calendar cal = getCalendar(TimeZone.getTimeZone("GMT"));
        assertEquals(0, cal.get(Calendar.MILLISECOND));
        XsDateFormat format = new XsDateFormat();
        String got = format.format(cal);
        String expect = "2004-01-14Z";
        assertEquals(expect, got);

        cal = getCalendar(TimeZone.getTimeZone("GMT-03:00"));
        assertEquals(0, cal.get(Calendar.MILLISECOND));
View Full Code Here

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

    public void testFormatDateTime() {
        Calendar cal = getCalendar(TimeZone.getTimeZone("GMT"));
        assertEquals(0, cal.get(Calendar.MILLISECOND));
        XsDateTimeFormat format = new XsDateTimeFormat();
        String got = format.format(cal);
        String expect = "2004-01-14T03:12:07Z";
        assertEquals(expect, got);

        cal = getCalendar(TimeZone.getTimeZone("GMT-03:00"));
        assertEquals(0, cal.get(Calendar.MILLISECOND));
View Full Code Here

Examples of org.apache.ws.jaxme.xs.util.XsTimeFormat.format()

    public void testFormatTime() {
        Calendar cal = getCalendar(TimeZone.getTimeZone("GMT"));
        assertEquals(0, cal.get(Calendar.MILLISECOND));
        XsTimeFormat format = new XsTimeFormat();
        String got = format.format(cal);
        String expect = "03:12:07Z";
        assertEquals(expect, got);

        cal = getCalendar(TimeZone.getTimeZone("GMT-03:00"));
        assertEquals(0, cal.get(Calendar.MILLISECOND));
View Full Code Here

Examples of org.apache.ws.security.util.XmlSchemaDateFormat.format()

            }
            expirationTime.setTime(creationTime.getTime() + (lifeTimeOfToken * 1000L));
        }

        XmlSchemaDateFormat fmt = new XmlSchemaDateFormat();
        created.setValue(fmt.format(creationTime));
        LOG.fine("Token lifetime creation: " + created.getValue());
        expires.setValue(fmt.format(expirationTime));
        LOG.fine("Token lifetime expiration: " + expires.getValue());
       
        LifetimeType lifetimeType = QNameConstants.WS_TRUST_FACTORY.createLifetimeType();
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.