Examples of plusHours()


Examples of org.joda.time.DateTime.plusHours()

  public void testWriteDate2() throws Exception {
    DateTime d = new DateTime(1991,11,12,0,0, DateTimeZone.forID("US/Eastern"));
    pigValueRangeTest("junitTypeTest1", "date", "datetime", null, d.toString(),
      d.toString(FORMAT_4_DATE), FORMAT_4_DATE);
    pigValueRangeTestOverflow("junitTypeTest2", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Null,
      d.plusHours(2).toString(), FORMAT_4_DATE);
    pigValueRangeTestOverflow("junitTypeTest2", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Null,
      d.plusMillis(20).toString(), FORMAT_4_DATE);
    pigValueRangeTestOverflow("junitTypeTest2", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Throw,
      d.plusMillis(12).toString(), FORMAT_4_DATE);
    pigValueRangeTestOverflow("junitTypeTest3", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Throw,
View Full Code Here

Examples of org.joda.time.DateTime.plusHours()

  @Test
  public void testWriteTimestamp() throws Exception {
    DateTime d = new DateTime(1991,10,11,14,23,30, 10);//uses default TZ
    pigValueRangeTest("junitTypeTest1", "timestamp", "datetime", null, d.toString(),
      d.toDateTime(DateTimeZone.getDefault()).toString());
    d = d.plusHours(2);
    pigValueRangeTest("junitTypeTest2", "timestamp", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Null,
      d.toString(), d.toDateTime(DateTimeZone.getDefault()).toString());
    d = d.toDateTime(DateTimeZone.UTC);
    pigValueRangeTest("junitTypeTest3", "timestamp", "datetime", null, d.toString(),
      d.toDateTime(DateTimeZone.getDefault()).toString());
View Full Code Here

Examples of org.joda.time.DateTime.plusHours()

    assumeTrue(!TestUtil.shouldSkip(storageFormat, DISABLED_STORAGE_FORMATS));
    DateTime d = new DateTime(1991,10,11,0,0);
    pigValueRangeTest("junitTypeTest1", "date", "datetime", null, d.toString(),
      d.toString(FORMAT_4_DATE), FORMAT_4_DATE);
    pigValueRangeTestOverflow("junitTypeTest2", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Null,
      d.plusHours(2).toString(), FORMAT_4_DATE);//time != 0
    pigValueRangeTestOverflow("junitTypeTest3", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Throw,
      d.plusMinutes(1).toString(), FORMAT_4_DATE);//time != 0
    d = new DateTime(1991,10,11,0,0,DateTimeZone.forOffsetHours(-11));
    pigValueRangeTest("junitTypeTest4", "date", "datetime", null, d.toString(),
      d.toString(FORMAT_4_DATE), FORMAT_4_DATE);
View Full Code Here

Examples of org.joda.time.DateTime.plusHours()

      d.plusMinutes(1).toString(), FORMAT_4_DATE);//time != 0
    d = new DateTime(1991,10,11,0,0,DateTimeZone.forOffsetHours(-11));
    pigValueRangeTest("junitTypeTest4", "date", "datetime", null, d.toString(),
      d.toString(FORMAT_4_DATE), FORMAT_4_DATE);
    pigValueRangeTestOverflow("junitTypeTest5", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Null,
      d.plusHours(2).toString(), FORMAT_4_DATE);//date out of range due to time != 0
    pigValueRangeTestOverflow("junitTypeTest6", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Throw,
      d.plusMinutes(1).toString(), FORMAT_4_DATE);//date out of range due to time!=0
  }

  @Test
View Full Code Here

Examples of org.joda.time.DateTime.plusHours()

    FrontendException fe = null;
    //expect to fail since the time component is not 0
    pigValueRangeTestOverflow("junitTypeTest4", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Throw,
      d.toString(), FORMAT_4_DATE);
    pigValueRangeTestOverflow("junitTypeTest5", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Null,
      d.plusHours(2).toString(), FORMAT_4_DATE);
    pigValueRangeTestOverflow("junitTypeTest6", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Throw,
      d.plusMinutes(1).toString(), FORMAT_4_DATE);
  }

  @Test
View Full Code Here

Examples of org.joda.time.DateTime.plusHours()

    assumeTrue(!TestUtil.shouldSkip(storageFormat, DISABLED_STORAGE_FORMATS));
    DateTime d = new DateTime(1991,11,12,0,0, DateTimeZone.forID("US/Eastern"));
    pigValueRangeTest("junitTypeTest1", "date", "datetime", null, d.toString(),
      d.toString(FORMAT_4_DATE), FORMAT_4_DATE);
    pigValueRangeTestOverflow("junitTypeTest2", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Null,
      d.plusHours(2).toString(), FORMAT_4_DATE);
    pigValueRangeTestOverflow("junitTypeTest2", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Null,
      d.plusMillis(20).toString(), FORMAT_4_DATE);
    pigValueRangeTestOverflow("junitTypeTest2", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Throw,
      d.plusMillis(12).toString(), FORMAT_4_DATE);
    pigValueRangeTestOverflow("junitTypeTest3", "date", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Throw,
View Full Code Here

Examples of org.joda.time.DateTime.plusHours()

  public void testWriteTimestamp() throws Exception {
    assumeTrue(!TestUtil.shouldSkip(storageFormat, DISABLED_STORAGE_FORMATS));
    DateTime d = new DateTime(1991,10,11,14,23,30, 10);//uses default TZ
    pigValueRangeTest("junitTypeTest1", "timestamp", "datetime", null, d.toString(),
      d.toDateTime(DateTimeZone.getDefault()).toString());
    d = d.plusHours(2);
    pigValueRangeTest("junitTypeTest2", "timestamp", "datetime", HCatBaseStorer.OOR_VALUE_OPT_VALUES.Null,
      d.toString(), d.toDateTime(DateTimeZone.getDefault()).toString());
    d = d.toDateTime(DateTimeZone.UTC);
    pigValueRangeTest("junitTypeTest3", "timestamp", "datetime", null, d.toString(),
      d.toDateTime(DateTimeZone.getDefault()).toString());
View Full Code Here

Examples of org.joda.time.DateTime.plusHours()

        when(compositeGroupService.findGroup("local.1")).thenReturn(entityGroupB);
       
        final DateTime instant = new DateTime(1326734644000l, DateTimeZone.UTC); //just a random time
       
        //Create required date and time dimensions
        populateDateTimeDimensions(instant.minusHours(2), instant.plusHours(2), null);
       
        //Create aggregations
        final Map<K, T> createdAggrs = this.executeInTransaction(new Callable<Map<K, T>>() {
            @Override
            public Map<K, T> call() throws Exception {
View Full Code Here

Examples of org.joda.time.DateTime.plusHours()

        DateTime dateTime = new DateTime(2001, 1, 22, 3, 4, 5, 321, DateTimeZone.UTC);
        long seconds = getSeconds(dateTime);

        assertFunction("date_add('second', 3, " + seconds + ")", getSeconds(dateTime.plusSeconds(3)));
        assertFunction("date_add('minute', 3, " + seconds + ")", getSeconds(dateTime.plusMinutes(3)));
        assertFunction("date_add('hour', 3, " + seconds + ")", getSeconds(dateTime.plusHours(3)));
        assertFunction("date_add('day', 3, " + seconds + ")", getSeconds(dateTime.plusDays(3)));
        assertFunction("date_add('week', 3, " + seconds + ")", getSeconds(dateTime.plusWeeks(3)));
        assertFunction("date_add('month', 3, " + seconds + ")", getSeconds(dateTime.plusMonths(3)));
        assertFunction("date_add('quarter', 3, " + seconds + ")", getSeconds(dateTime.plusMonths(3 * 3)));
        assertFunction("date_add('year', 3, " + seconds + ")", getSeconds(dateTime.plusYears(3)));
View Full Code Here

Examples of org.joda.time.DateTime.plusHours()

        DateTime now = new DateTime();
        Activity activity = new ActivityImpl();
        activity.setActor(fryActivityObject);
        activity.setObject(benderActivityObject);
        activity.setVerb(CIRCLE_RELATIONSHIP_KIND_GROUP);
        activity.setPublishedDate(now.plusHours(2).toDate());
        activityStreamService.addActivity(activity);
        activity = new ActivityImpl();
        activity.setActor(benderActivityObject);
        activity.setObject(zappActivityObject);
        activity.setVerb(CIRCLE_RELATIONSHIP_KIND_GROUP);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.