/**
   * Test format date_ enum of q.
   *
   * @throws Exception the exception
   */
  @Test
  public void testFormatDate_EnumOfQ() throws Exception {

    Date dateNull = null;
    String stringNull = null;
    FormatsEnum formatsEnumNull = null;
    String wrongFormat = "wxvr---";

    Calendar calendar = Calendar.getInstance();
    calendar.set(1910, 10, 20, 8, 0, 0);
    String stringPattern = FormatsEnum.DEFAULT_DATETIME_FORMAT.getValue();
    FormatsEnum formatsEnum = FormatsEnum.DEFAULT_DATETIME_FORMAT;

    assertNull(dateTimeFormatter.format(dateNull, formatsEnum));
    assertNull(dateTimeFormatter.format(calendar.getTime(), formatsEnumNull));
    assertNull(dateTimeFormatter.format(calendar, formatsEnumNull));

    assertNull(dateTimeFormatter.format(dateNull, stringPattern));
    assertNull(dateTimeFormatter.format(calendar.getTime(), stringNull));
    assertNull(dateTimeFormatter.format(calendar, stringNull));

    try {
      dateTimeFormatter.format(calendar.getTime(), wrongFormat);
    } catch (IllegalArgumentException e) {
    }

    String formatedDate = dateTimeFormatter.format(calendar.getTime(), formatsEnum);
    assertNotNull(formatedDate);
    String formatedDate2 = dateTimeFormatter.format(calendar, formatsEnum);
    assertTrue(formatedDate.equals("20/11/1910 08:00:00"));
    assertTrue(formatedDate2.equals("20/11/1910 08:00:00"));
  }
 /** Test open format_ e x_ illegal argument. */
 @Test(expected = IllegalArgumentException.class)
 public void testOpenFormat_EX_IllegalArgument() {
   Calendar calendar = Calendar.getInstance();
   String stringPattern = FormatsEnum.DEFAULT_DATETIME_FORMAT.getValue();
   try {
     dateTimeFormatter.openFormat(calendar, stringPattern);
     fail("se provoca excepcion de formato");
   } catch (Exception e) {
     assertEquals(true, "Formato inválido: dd/MM/yyyy HH:mm:ss".equalsIgnoreCase(e.getMessage()));
   }
 }
  /** Test format_ e x_ illegal argument. */
  @Test(expected = IllegalStateException.class)
  public void testFormat_EX_IllegalArgument() {
    Calendar calendar = Calendar.getInstance();
    String stringPattern = FormatsEnum.DEFAULT_DATETIME_FORMAT.getValue();
    try {
      dateTimeFormatter.format(calendar, stringPattern);
      fail("se provoca excepcion de formato");
    } catch (Exception e) {

    }
  }