コード例 #1
0
  @Test
  public void testConvertDateToLong() throws Exception {
    LOGGER.info("convert date string to long value");

    long value = DateConverterHelper.convertToLong(ASSERT_DATE_STRING);
    Assert.assertEquals("Result is not as expected.", ASSERT_DATE_LONG, value);
  }
コード例 #2
0
  @Test
  public void testConvertDateToStringToLongAndBackToDate() throws Exception {
    LOGGER.info("convert date to string to long and back to date");

    String stringValue = DateConverterHelper.convertToString(ASSERT_DATE);
    long longValue = DateConverterHelper.convertToLong(stringValue);
    Date resultDate = DateConverterHelper.convertToDate(longValue);

    Assert.assertEquals("Result is not as expected.", ASSERT_DATE, resultDate);
  }