本文整理汇总了Java中org.activiti.engine.impl.calendar.DurationHelper类的典型用法代码示例。如果您正苦于以下问题:Java DurationHelper类的具体用法?Java DurationHelper怎么用?Java DurationHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DurationHelper类属于org.activiti.engine.impl.calendar包,在下文中一共展示了DurationHelper类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldNotExceedNumber
import org.activiti.engine.impl.calendar.DurationHelper; //导入依赖的package包/类
@Test
public void shouldNotExceedNumber() throws Exception {
ClockUtil.setCurrentTime(new Date(0));
DurationHelper dh = new DurationHelper("R2/PT10S");
ClockUtil.setCurrentTime(new Date(15000));
assertEquals(20000, dh.getDateAfter().getTime());
ClockUtil.setCurrentTime(new Date(30000));
assertNull(dh.getDateAfter());
}
示例2: shouldNotExceedNumberPeriods
import org.activiti.engine.impl.calendar.DurationHelper; //导入依赖的package包/类
@Test
public void shouldNotExceedNumberPeriods() throws Exception {
ClockUtil.setCurrentTime(parse("19700101-00:00:00"));
DurationHelper dh = new DurationHelper("R2/1970-01-01T00:00:00/1970-01-01T00:00:10");
ClockUtil.setCurrentTime(parse("19700101-00:00:15"));
assertEquals(parse("19700101-00:00:20"), dh.getDateAfter());
ClockUtil.setCurrentTime(parse("19700101-00:00:30"));
assertNull(dh.getDateAfter());
}
示例3: shouldNotExceedNumberNegative
import org.activiti.engine.impl.calendar.DurationHelper; //导入依赖的package包/类
@Test
public void shouldNotExceedNumberNegative() throws Exception {
ClockUtil.setCurrentTime(parse("19700101-00:00:00"));
DurationHelper dh = new DurationHelper("R2/PT10S/1970-01-01T00:00:50");
ClockUtil.setCurrentTime(parse("19700101-00:00:20"));
assertEquals(parse("19700101-00:00:30"), dh.getDateAfter());
ClockUtil.setCurrentTime(parse("19700101-00:00:35"));
assertEquals(parse("19700101-00:00:40"), dh.getDateAfter());
}