mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

ludovicp
28.55.2010 dfeebda59b457f42bb8f0cf10f6b69ff8622bdd3
Fix testcase to use local calendar object
1 files modified
16 ■■■■■ changed files
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/TimeBasedMatchingRuleTest.java 16 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/TimeBasedMatchingRuleTest.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2009-2010 Sun Microsystems, Inc.
 */
@@ -77,8 +77,6 @@
 private final static String TIME_ATTR = "test-time-attribute";
 GregorianCalendar cal = null;
  /**
   * Ensures that the Directory Server is running before executing the
   * testcases.
@@ -115,9 +113,6 @@
    "objectclasses: ( oc-oid NAME 'testOC' SUP top AUXILIARY MUST test-time-attribute)"
    );
    assertTrue(resultCode == 0);
        //Get the current time.
   cal = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
   cal.setLenient(false);
  }
@@ -293,6 +288,10 @@
      populateEntries();
      InternalClientConnection conn =
           InternalClientConnection.getRootConnection();
      //Get the current time.
      GregorianCalendar cal =
              new GregorianCalendar(TimeZone.getTimeZone("UTC"));
      cal.setLenient(false);
      int month = cal.get(Calendar.MONTH)+1; //month starts from 0 in the Calendar.
      String assertion = cal.get(Calendar.DATE)+"D"+month+"M";
@@ -454,6 +453,11 @@
  @DataProvider(name="partialDateTimeSyntaxes")
  private Object[][] createPartialDateTimeSyntaxes()
  {
   //Get the current time.
   GregorianCalendar cal =
           new GregorianCalendar(TimeZone.getTimeZone("UTC"));
   cal.setLenient(false);
    //Get the date today.
    int second = cal.get(Calendar.SECOND);
    int minute = cal.get(Calendar.MINUTE);