Example usage for org.apache.commons.lang3.time FastDateFormat getPattern

List of usage examples for org.apache.commons.lang3.time FastDateFormat getPattern

Introduction

In this page you can find the example usage for org.apache.commons.lang3.time FastDateFormat getPattern.

Prototype

@Override
public String getPattern() 

Source Link

Document

Gets the pattern used by this formatter.

Usage

From source file:com.savoirtech.logging.slf4j.json.LoggerFactoryTest.java

@Test
public void testSetDateFormatString() throws Exception {
    LoggerFactory.setDateFormatString("HH:MM");

    //// ww w.  j av  a  2  s .c o m
    // WARNING: ugly reflection to validate the result here.
    //
    Field formatterField = LoggerFactory.class.getDeclaredField("formatter");
    formatterField.setAccessible(true);

    FastDateFormat formatter = (FastDateFormat) formatterField.get(null);

    assertEquals("HH:MM", formatter.getPattern());
}