Example usage for org.apache.commons.lang.time FastDateFormat getInstance

List of usage examples for org.apache.commons.lang.time FastDateFormat getInstance

Introduction

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

Prototype

public static FastDateFormat getInstance() 

Source Link

Document

Gets a formatter instance using the default pattern in the default locale.

Usage

From source file:com.discursive.jccook.slide.ListExample.java

public static void main(String[] args) throws HttpException, IOException {
    String url = "http://www.discursive.com/jccook/dav/";
    Credentials credentials = new UsernamePasswordCredentials("davuser", "davpass");

    // List resources in top directory
    WebdavResource resource = new WebdavResource(url, credentials);
    WebdavResource[] resources = resource.listWebdavResources();
    System.out.println("type  name           size    type                   modified");
    System.out.println("--------------------------------------------------------------------");
    for (int i = 0; i < resources.length; i++) {
        WebdavResource item = resources[i];
        String type;/*from  w  w  w . j  ava2 s  . c o m*/
        if (item.isCollection()) {
            type = "dir";
        } else {
            type = "file";
        }
        System.out.print(StringUtils.rightPad(type, 6));
        System.out.print(StringUtils.rightPad(item.getName(), 15));
        System.out.print(StringUtils.rightPad(item.getGetContentLength() + "", 8));
        System.out.print(StringUtils.rightPad(item.getGetContentType(), 23));
        Date lastMod = new Date(item.getGetLastModified());
        System.out.print(StringUtils.rightPad(FastDateFormat.getInstance().format(lastMod), 25));
        System.out.print("\n");
    }
}

From source file:com.intuit.tank.PreferencesBeanTest.java

/**
 * Run the String formatDate(Date) method test.
 *
 * @throws Exception//w  w w  .  j  av a  2  s .c  om
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testFormatDate_1() throws Exception {
    PreferencesBean fixture = new PreferencesBean();
    fixture.setDateTimeFotmat(FastDateFormat.getInstance());
    fixture.setScreenWidth(1);
    fixture.setScreenHeight(1);
    fixture.setTimestampFormat(FastDateFormat.getInstance());
    Date date = new Date();

    String result = fixture.formatDate(date);

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
    //       at com.intuit.tank.PreferencesBean.<init>(PreferencesBean.java:179)
    assertNotNull(result);
}

From source file:com.intuit.tank.PreferencesBeanTest.java

/**
 * Run the String getCollectionFilterString(Collection<? extends Object>) method test.
 *
 * @throws Exception//  www  .  ja  va 2 s. com
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testGetCollectionFilterString_1() throws Exception {
    PreferencesBean fixture = new PreferencesBean();
    fixture.setDateTimeFotmat(FastDateFormat.getInstance());
    fixture.setScreenWidth(1);
    fixture.setScreenHeight(1);
    fixture.setTimestampFormat(FastDateFormat.getInstance());
    Collection<? extends Object> c = new LinkedList();

    String result = fixture.getCollectionFilterString(c);

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
    //       at com.intuit.tank.PreferencesBean.<init>(PreferencesBean.java:179)
    assertNotNull(result);
}

From source file:com.intuit.tank.PreferencesBeanTest.java

/**
 * Run the String getCollectionFilterString(Collection<? extends Object>) method test.
 *
 * @throws Exception//w ww .  j ava 2 s. co m
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testGetCollectionFilterString_2() throws Exception {
    PreferencesBean fixture = new PreferencesBean();
    fixture.setDateTimeFotmat(FastDateFormat.getInstance());
    fixture.setScreenWidth(1);
    fixture.setScreenHeight(1);
    fixture.setTimestampFormat(FastDateFormat.getInstance());
    Collection<? extends Object> c = new LinkedList();

    String result = fixture.getCollectionFilterString(c);

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
    //       at com.intuit.tank.PreferencesBean.<init>(PreferencesBean.java:179)
    assertNotNull(result);
}

From source file:com.intuit.tank.PreferencesBeanTest.java

/**
 * Run the String getCollectionFilterString(Collection<? extends Object>) method test.
 *
 * @throws Exception//from  w  w w.  ja v  a  2  s.c o m
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testGetCollectionFilterString_3() throws Exception {
    PreferencesBean fixture = new PreferencesBean();
    fixture.setDateTimeFotmat(FastDateFormat.getInstance());
    fixture.setScreenWidth(1);
    fixture.setScreenHeight(1);
    fixture.setTimestampFormat(FastDateFormat.getInstance());
    Collection<? extends Object> c = new LinkedList();

    String result = fixture.getCollectionFilterString(c);

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
    //       at com.intuit.tank.PreferencesBean.<init>(PreferencesBean.java:179)
    assertNotNull(result);
}

From source file:com.intuit.tank.PreferencesBeanTest.java

/**
 * Run the String getCollectionFilterString(Collection<? extends Object>) method test.
 *
 * @throws Exception//from w ww  .  jav a  2 s.c o  m
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testGetCollectionFilterString_4() throws Exception {
    PreferencesBean fixture = new PreferencesBean();
    fixture.setDateTimeFotmat(FastDateFormat.getInstance());
    fixture.setScreenWidth(1);
    fixture.setScreenHeight(1);
    fixture.setTimestampFormat(FastDateFormat.getInstance());
    Collection<? extends Object> c = null;

    String result = fixture.getCollectionFilterString(c);

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
    //       at com.intuit.tank.PreferencesBean.<init>(PreferencesBean.java:179)
    assertNotNull(result);
}

From source file:com.intuit.tank.PreferencesBeanTest.java

/**
 * Run the FastDateFormat getDateTimeFotmat() method test.
 *
 * @throws Exception/* w  w  w .  ja v  a2 s .  co  m*/
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testGetDateTimeFotmat_1() throws Exception {
    PreferencesBean fixture = new PreferencesBean();
    fixture.setDateTimeFotmat(FastDateFormat.getInstance());
    fixture.setScreenWidth(1);
    fixture.setScreenHeight(1);
    fixture.setTimestampFormat(FastDateFormat.getInstance());

    FastDateFormat result = fixture.getDateTimeFormat();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
    //       at com.intuit.tank.PreferencesBean.<init>(PreferencesBean.java:179)
    assertNotNull(result);
}

From source file:com.intuit.tank.PreferencesBeanTest.java

/**
 * Run the Preferences getPreferences() method test.
 *
 * @throws Exception/*www.  j  a va  2s  . c  o m*/
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testGetPreferences_1() throws Exception {
    PreferencesBean fixture = new PreferencesBean();
    fixture.setDateTimeFotmat(FastDateFormat.getInstance());
    fixture.setScreenWidth(1);
    fixture.setScreenHeight(1);
    fixture.setTimestampFormat(FastDateFormat.getInstance());

    Preferences result = fixture.getPreferences();
}

From source file:com.intuit.tank.PreferencesBeanTest.java

/**
 * Run the int getScreenHeight() method test.
 *
 * @throws Exception/*  w ww.ja  v  a2  s .c om*/
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testGetScreenHeight_1() throws Exception {
    PreferencesBean fixture = new PreferencesBean();
    fixture.setDateTimeFotmat(FastDateFormat.getInstance());
    fixture.setScreenWidth(1);
    fixture.setScreenHeight(1);
    fixture.setTimestampFormat(FastDateFormat.getInstance());

    int result = fixture.getScreenHeight();
}

From source file:com.intuit.tank.PreferencesBeanTest.java

/**
 * Run the int getScreenWidth() method test.
 *
 * @throws Exception/*from  w  w w .  j  a  va  2s .c  o  m*/
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testGetScreenWidth_1() throws Exception {
    PreferencesBean fixture = new PreferencesBean();
    fixture.setDateTimeFotmat(FastDateFormat.getInstance());
    fixture.setScreenWidth(1);
    fixture.setScreenHeight(1);
    fixture.setTimestampFormat(FastDateFormat.getInstance());

    int result = fixture.getScreenWidth();
}