Skip to content

Commit

Permalink
incubator-kie-issues-1612
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhitocode committed Dec 2, 2024
1 parent 6136ad2 commit 7ef7f11
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static Builder builder() {
/**
*
* @param testingCalendar is used only for testing purpose. It is <code>null</code> in production and
* during normal execution
* during normal execution
*/
private BusinessCalendarImpl(Calendar testingCalendar) {
this(CalendarBeanFactory.createCalendarBean(), testingCalendar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,20 @@ void calculateBusinessTimeAsDateInsideDailyWorkingHourWithDelay() {
@Test
void calculateBusinessTimeAsDateInsideDailyWorkingHourWithoutDelay() {
int daysToSkip = 0; // since executionHourDelay falls before endHOurGap
commonCalculateBusinessTimeAsDateAssertBetweenHours(-4, 4, 0, 0,daysToSkip, null, null);
}
commonCalculateBusinessTimeAsDateAssertBetweenHours(-4, 4, 0, 0, daysToSkip, null, null);
}

@Disabled("TO FIX")
@Disabled("TO FIX https://github.com/apache/incubator-kie-issues/issues/1651")
@Test
void calculateBusinessTimeAsDateInsideNightlyWorkingHour() {
int daysToSkip = 0; // since executionHourDelay falls before endHOurGap
commonCalculateBusinessTimeAsDateAssertBetweenHours(4, -4, 0,3, daysToSkip, null, null);
}
commonCalculateBusinessTimeAsDateAssertBetweenHours(4, -4, 0, 3, daysToSkip, null, null);
}

@Test
void calculateBusinessTimeAsDateBeforeWorkingHourWithDelay() {
int daysToSkip = 0; // since executionHourDelay falls before endHOurGap
commonCalculateBusinessTimeAsDateAssertBetweenHours(2, 4, -1,1, daysToSkip, null, null);
commonCalculateBusinessTimeAsDateAssertBetweenHours(2, 4, -1, 1, daysToSkip, null, null);
}

@Test
Expand All @@ -103,7 +103,7 @@ void calculateBusinessTimeAsDateBeforeWorkingHourWithoutDelay() {
@Test
void calculateBusinessTimeAsDateAfterWorkingHour() {
int daysToSkip = 1; // because the executionHourDelay is bigger to endHOurGap, so it goes to next day;
commonCalculateBusinessTimeAsDateAssertAtStartHour(-1, 2, 3,3, daysToSkip, null, null);
commonCalculateBusinessTimeAsDateAssertAtStartHour(-1, 2, 3, 3, daysToSkip, null, null);
}

@Test
Expand All @@ -115,8 +115,8 @@ void calculateBusinessTimeAsDateWhenTodayAndTomorrowAreHolidays() {
String holidays = sdf.format(today) + "," + sdf.format(tomorrow);
int daysToSkip = 2; // because both today and tomorrow are holiday
// endHOurGap and executionHourDelay are ininfluent in this context
commonCalculateBusinessTimeAsDateAssertBetweenHours(-4, 4, 0,3, daysToSkip, holidayDateFormat, holidays);
commonCalculateBusinessTimeAsDateAssertBetweenHours(-4, 4, 5,3, daysToSkip, holidayDateFormat, holidays);
commonCalculateBusinessTimeAsDateAssertBetweenHours(-4, 4, 0, 3, daysToSkip, holidayDateFormat, holidays);
commonCalculateBusinessTimeAsDateAssertBetweenHours(-4, 4, 5, 3, daysToSkip, holidayDateFormat, holidays);
}

@Test
Expand All @@ -129,7 +129,7 @@ void calculateBusinessTimeAsDateWhenNextDayIsHoliday() {
// 1 because next day is holiday
int daysToSkip = 2;

commonCalculateBusinessTimeAsDateAssertBetweenHours(-4, 4, 0,4, daysToSkip, holidayDateFormat, holidays);
commonCalculateBusinessTimeAsDateAssertBetweenHours(-4, 4, 0, 4, daysToSkip, holidayDateFormat, holidays);
daysToSkip = 0; // since executionHourDelay falls before endHOurGap
commonCalculateBusinessTimeAsDateAssertBetweenHours(-4, 4, 0, 3, daysToSkip, holidayDateFormat, holidays);
}
Expand Down Expand Up @@ -178,7 +178,6 @@ void rollCalendarToNightlyWorkingHour() {

}

@Disabled("TO FIX https://github.com/apache/incubator-kie-issues/issues/1651")
@Test
void rollCalendarAfterHolidays() {
Instant now = Instant.now();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.jbpm.process.core.timer;

import java.util.Calendar;
import java.util.List;
import java.util.TimeZone;

import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import static org.jbpm.process.core.timer.CalendarBean.DEFAULT_WEEKENDS;
import static org.jbpm.process.core.timer.CalendarBean.DEFAULT_WEEKEND_DAYS;


class CalendarBeanTest {

// Static validation methods
Expand Down
2 changes: 1 addition & 1 deletion jbpm/jbpm-flow/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</appender>

<logger name="org.jbpm" level="info"/>
<logger name="org.jbpm.process.core.timer" level="debug"/>
<logger name="org.jbpm.process.core.timer" level="info"/>
<logger name="com.arjuna" level="error"/>
<logger name="org.hibernate" level="warn"/>

Expand Down

0 comments on commit 7ef7f11

Please sign in to comment.