Skip to content

Commit 39373b0

Browse files
authored
Merge pull request #90 from rgdoliveira/sync_main
Sync main branch with Apache main branch
2 parents e79da0d + f92c74f commit 39373b0

File tree

5 files changed

+74
-13
lines changed

5 files changed

+74
-13
lines changed

.ci/jenkins/tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<logback.configration>logback-test.xml</logback.configration>
5656
<logdir>${project.build.directory}/log</logdir>
5757
<test.loglevel>ERROR</test.loglevel>
58-
<log.logback.version>1.2.13</log.logback.version>
58+
<log.logback.version>1.3.15</log.logback.version>
5959
<log.slf4j.version>1.7.25</log.slf4j.version>
6060
<build-helper-maven-plugin.version>1.9.1</build-helper-maven-plugin.version>
6161

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Apache KIE
2-
Copyright 2023-2024 The Apache Software Foundation
2+
Copyright 2023-2025 The Apache Software Foundation
33

44
This product includes software developed at
55
The Apache Software Foundation (http://www.apache.org/).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
ALTER TABLE jbpm_user_tasks_comments ALTER COLUMN comment SET DATA TYPE VARCHAR(1000);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
ALTER TABLE jbpm_user_tasks_comments ALTER COLUMN comment TYPE VARCHAR(1000);

jbpm/jbpm-flow/src/test/java/org/jbpm/process/core/timer/BusinessCalendarImplTest.java

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,20 +222,41 @@ void rollCalendarToNightlyWorkingHour() {
222222
}
223223

224224
@Test
225-
void rollCalendarAfterHolidays() {
226-
Instant now = Instant.now();
227-
int holidayLeft = 4;
228-
Instant startHolidayInstant = now.minus(2, DAYS);
229-
Instant endHolidayInstant = now.plus(holidayLeft, DAYS);
230-
Date startHoliday = Date.from(startHolidayInstant);
231-
Date endHoliday = Date.from(endHolidayInstant);
232-
List<BusinessCalendarImpl.TimePeriod> holidays = Collections.singletonList(new BusinessCalendarImpl.TimePeriod(startHoliday, endHoliday));
225+
void rollCalendarAfterHolidaysWithoutYearRollover() {
226+
Calendar calendar = Calendar.getInstance();
227+
calendar.set(Calendar.DAY_OF_YEAR, 360);
228+
calendar.set(Calendar.YEAR, 2025);
229+
Instant currentInstant = calendar.toInstant();
230+
231+
Instant startHolidayInstant = currentInstant.minus(2, DAYS);
232+
Instant endHolidayInstant = currentInstant.plus(4, DAYS);
233+
List<BusinessCalendarImpl.TimePeriod> holidays = Collections.singletonList(
234+
new BusinessCalendarImpl.TimePeriod(Date.from(startHolidayInstant), Date.from(endHolidayInstant)));
233235
List<Integer> weekendDays = Collections.emptyList();
236+
237+
BusinessCalendarImpl.rollCalendarAfterHolidays(calendar, holidays, weekendDays, false);
238+
239+
int expectedDayOfYear = 360 + 4 + 1; //last day of the year, as it is not leap year
240+
assertThat(calendar.get(Calendar.DAY_OF_YEAR)).isEqualTo(expectedDayOfYear);
241+
}
242+
243+
@Test
244+
void rollCalendarAfterHolidaysWithYearRollover() {
234245
Calendar calendar = Calendar.getInstance();
235-
int currentDayOfYear = calendar.get(Calendar.DAY_OF_YEAR);
246+
calendar.set(Calendar.DAY_OF_YEAR, 361);
247+
calendar.set(Calendar.YEAR, 2025);
248+
Instant currentInstant = calendar.toInstant();
249+
250+
Instant startHolidayInstant = currentInstant.minus(2, DAYS);
251+
Instant endHolidayInstant = currentInstant.plus(4, DAYS);
252+
List<BusinessCalendarImpl.TimePeriod> holidays = Collections.singletonList(
253+
new BusinessCalendarImpl.TimePeriod(Date.from(startHolidayInstant), Date.from(endHolidayInstant)));
254+
List<Integer> weekendDays = Collections.emptyList();
255+
236256
BusinessCalendarImpl.rollCalendarAfterHolidays(calendar, holidays, weekendDays, false);
237-
int expected = currentDayOfYear + holidayLeft + 1;
238-
assertThat(calendar.get(Calendar.DAY_OF_YEAR)).isEqualTo(expected);
257+
258+
int expectedDayOfYear = 1; //since 2025 is not leap year
259+
assertThat(calendar.get(Calendar.DAY_OF_YEAR)).isEqualTo(expectedDayOfYear);
239260
}
240261

241262
@Test

0 commit comments

Comments
 (0)