use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class ValueDateUtilTest method shouldCalculateDateWorkingDiff_APR.
@Test
public void shouldCalculateDateWorkingDiff_APR() throws KettleValueException {
ValueMetaInterface metaA = new ValueMetaDate();
ValueMetaInterface metaB = new ValueMetaDate();
Calendar startDate = Calendar.getInstance();
Calendar endDate = Calendar.getInstance();
// 2009-04-01 00:00:00
startDate.setTimeInMillis(1238544000000L);
// 2009-04-30 00:00:00
endDate.setTimeInMillis(1241049600000L);
Object workingDayOfAPR = ValueDataUtil.DateWorkingDiff(metaA, endDate.getTime(), metaB, startDate.getTime());
assertEquals("Working days count in APR ", 22L, workingDayOfAPR);
}
use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class ValueDateUtilTest method shouldCalculateDateWorkingDiff_DEC.
@Test
public void shouldCalculateDateWorkingDiff_DEC() throws KettleValueException {
ValueMetaInterface metaA = new ValueMetaDate();
ValueMetaInterface metaB = new ValueMetaDate();
Calendar startDate = Calendar.getInstance();
Calendar endDate = Calendar.getInstance();
// 2009-12-01 00:00:00
startDate.setTimeInMillis(1259625600000L);
// 2009-12-31 00:00:00
endDate.setTimeInMillis(1262217600000L);
Object workingDayOfDEC = ValueDataUtil.DateWorkingDiff(metaA, endDate.getTime(), metaB, startDate.getTime());
assertEquals("Working days count in DEC ", 23L, workingDayOfDEC);
}
use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class ValueDateUtilTest method shouldCalculateDateWorkingDiff_MAY.
@Test
public void shouldCalculateDateWorkingDiff_MAY() throws KettleValueException {
ValueMetaInterface metaA = new ValueMetaDate();
ValueMetaInterface metaB = new ValueMetaDate();
Calendar startDate = Calendar.getInstance();
Calendar endDate = Calendar.getInstance();
// 2009-05-01 00:00:00
startDate.setTimeInMillis(1241136000000L);
// 2009-05-31 00:00:00
endDate.setTimeInMillis(1243728000000L);
Object workingDayOfMAY = ValueDataUtil.DateWorkingDiff(metaA, endDate.getTime(), metaB, startDate.getTime());
assertEquals("Working days count in MAY ", 21L, workingDayOfMAY);
}
use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class ValueDateUtilTest method shouldCalculateDateWorkingDiff_JUN.
@Test
public void shouldCalculateDateWorkingDiff_JUN() throws KettleValueException {
ValueMetaInterface metaA = new ValueMetaDate();
ValueMetaInterface metaB = new ValueMetaDate();
Calendar startDate = Calendar.getInstance();
Calendar endDate = Calendar.getInstance();
// 2009-06-01 00:00:00
startDate.setTimeInMillis(1243814400000L);
// 2009-06-30 00:00:00
endDate.setTimeInMillis(1246320000000L);
Object workingDayOfJUN = ValueDataUtil.DateWorkingDiff(metaA, endDate.getTime(), metaB, startDate.getTime());
assertEquals("Working days count in JUN ", 22L, workingDayOfJUN);
}
use of org.pentaho.di.core.row.value.ValueMetaDate in project pentaho-kettle by pentaho.
the class ValueDateUtilTest method shouldCalculateDateWorkingDiff_JAN.
@Test
public void shouldCalculateDateWorkingDiff_JAN() throws KettleValueException {
ValueMetaInterface metaA = new ValueMetaDate();
ValueMetaInterface metaB = new ValueMetaDate();
Calendar startDate = Calendar.getInstance();
Calendar endDate = Calendar.getInstance();
// 2009-01-01 00:00:00
startDate.setTimeInMillis(1230768000000L);
// 2009-01-31 00:00:00
endDate.setTimeInMillis(1233360000000L);
Object workingDayOfJAN = ValueDataUtil.DateWorkingDiff(metaA, endDate.getTime(), metaB, startDate.getTime());
assertEquals("Working days count in JAN ", 22L, workingDayOfJAN);
}
Aggregations