int secs = DateUtil.getSecondFromTime(h, min, s);
DateTime dt = new DateTime();
dt.setElapsedSeconds((long) days * 86400 + secs);
model.getCDatetimeOption().modify(dt);
Date date = new Date();
date.setElapsedDays(days);
model.getCDateOption().modify(date);
}
inspector.clear();
inspector.inspect(dataHolder);
for (Cause cause : inspector.getCauses()) {
// System.out.println(cause.getMessage());
if (cause.getType().equals(Type.NOT_IN_TESTING_TIME)) {
System.out.println(cause.getMessage());
}
assertEquals("エラー原因のチェック", Type.CONDITION_NOW_ON_INVALID_COLUMN, cause.getType());
}
assertEquals("エラー原因のリストの要素数", 36, inspector.getCauses().size()); // 4件成功するのでNG件数が40-4=36(件)となる。
assertFalse("検査失敗", inspector.isSuccess());
// NGとなるケース(実値に未来時刻を指定して、inspect()を実行)
for (AllTypesWNoerr model : getActualList()) {
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis());
int y = cal.get(Calendar.YEAR);
int m = cal.get(Calendar.MONTH);
int d = cal.get(Calendar.DAY_OF_MONTH);
int h = cal.get(Calendar.HOUR_OF_DAY);
int min = cal.get(Calendar.MINUTE);
int s = cal.get(Calendar.SECOND);
int days = DateUtil.getDayFromDate(y + 1, m + 1, d); // 1年後を指定
int secs = DateUtil.getSecondFromTime(h, min, s);
DateTime dt = new DateTime();
dt.setElapsedSeconds((long) days * 86400 + secs);
model.getCDatetimeOption().modify(dt);
Date date = new Date();
date.setElapsedDays(days);
model.getCDateOption().modify(date);
}
inspector.clear();
inspector.inspect(dataHolder);
for (Cause cause : inspector.getCauses()) {