Remove getDurationAt deprecated method
FEA: ItEr60S19TimeUnitDataType
This commit is contained in:
parent
87ff9eb29a
commit
7feef61085
8 changed files with 2 additions and 55 deletions
|
|
@ -287,15 +287,6 @@ public class BaseCalendar extends IntegrationEntity implements IWorkHours {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of workable hours for a specific date depending on the
|
||||
* calendar restrictions.
|
||||
*/
|
||||
@Deprecated
|
||||
public Integer getCapacityAt(LocalDate date) {
|
||||
return getCapacityDurationAt(date).roundToHours();
|
||||
}
|
||||
|
||||
public EffortDuration getCapacityDurationAt(LocalDate date) {
|
||||
return getWorkableTimeAt(date);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,11 +69,6 @@ public abstract class CombinedWorkHours implements IWorkHours {
|
|||
return new Max(workHours);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getCapacityAt(LocalDate date) {
|
||||
return getCapacityDurationAt(date).roundToHours();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EffortDuration getCapacityDurationAt(LocalDate date) {
|
||||
EffortDuration current = null;
|
||||
|
|
|
|||
|
|
@ -35,18 +35,6 @@ public interface IWorkHours {
|
|||
*/
|
||||
public Integer toHours(LocalDate day, ResourcesPerDay amount);
|
||||
|
||||
/**
|
||||
* Calculates the capacity at a given date. It means all the hours that
|
||||
* could be worked without having overtime
|
||||
*
|
||||
* @param date
|
||||
* the date at which the capacity is calculated
|
||||
* @return the capacity at which the resource can work
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public Integer getCapacityAt(LocalDate date);
|
||||
|
||||
/**
|
||||
* Calculates the capacity duration at a given date. It means all the time
|
||||
* that could be worked without having overtime
|
||||
|
|
|
|||
|
|
@ -41,12 +41,6 @@ public class SameWorkHoursEveryDay implements IWorkHours {
|
|||
this.hours = hours;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public Integer getCapacityAt(LocalDate date) {
|
||||
return hours;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EffortDuration getCapacityDurationAt(LocalDate date) {
|
||||
return EffortDuration.hours(hours);
|
||||
|
|
|
|||
|
|
@ -759,10 +759,6 @@ public abstract class ResourceAllocation<T extends DayAssignment> extends
|
|||
|
||||
private IWorkHours getTaskWorkHours() {
|
||||
return new IWorkHours() {
|
||||
@Override
|
||||
public Integer getCapacityAt(LocalDate day) {
|
||||
return getSubyacent().getCapacityAt(day);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EffortDuration getCapacityDurationAt(LocalDate date) {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ public class CombinedWorkHoursTest {
|
|||
|
||||
private IWorkHours hours(int hours) {
|
||||
IWorkHours result = createNiceMock(IWorkHours.class);
|
||||
expect(result.getCapacityAt(isA(LocalDate.class))).andReturn(hours);
|
||||
expect(result.getCapacityDurationAt(isA(LocalDate.class))).andReturn(
|
||||
EffortDuration.hours(hours));
|
||||
replay(result);
|
||||
|
|
|
|||
|
|
@ -230,8 +230,6 @@ public class GenericResourceAllocationTest {
|
|||
private <T extends BaseCalendar> T createCalendar(Class<T> klass,
|
||||
final int hoursPerDay) {
|
||||
BaseCalendar baseCalendar = createNiceMock(klass);
|
||||
expect(baseCalendar.getCapacityAt(isA(LocalDate.class))).andReturn(
|
||||
hoursPerDay).anyTimes();
|
||||
expect(baseCalendar.getCapacityDurationAt(isA(LocalDate.class)))
|
||||
.andReturn(hours(hoursPerDay)).anyTimes();
|
||||
expect(baseCalendar.isActive(isA(LocalDate.class))).andReturn(true)
|
||||
|
|
@ -423,7 +421,7 @@ public class GenericResourceAllocationTest {
|
|||
public void allocatingSeveralResourcesPerDayHavingJustOneResourceProducesOvertime() {
|
||||
LocalDate start = new LocalDate(2006, 10, 5);
|
||||
final Integer standardHoursPerDay = SameWorkHoursEveryDay
|
||||
.getDefaultWorkingDay().getCapacityAt(start);
|
||||
.getDefaultWorkingDay().getCapacityDurationAt(start).getHours();
|
||||
final int TASK_DURATION_DAYS = 4;
|
||||
givenBaseCalendarWithoutExceptions(standardHoursPerDay);
|
||||
givenTaskWithStartAndEnd(toInterval(start, Period
|
||||
|
|
@ -464,7 +462,7 @@ public class GenericResourceAllocationTest {
|
|||
LocalDate start = new LocalDate(2006, 10, 5);
|
||||
final int TASK_DURATION_DAYS = 1;
|
||||
final Integer defaultWorkableHours = SameWorkHoursEveryDay
|
||||
.getDefaultWorkingDay().getCapacityAt(start);
|
||||
.getDefaultWorkingDay().getCapacityDurationAt(start).getHours();
|
||||
givenBaseCalendarWithoutExceptions(defaultWorkableHours);
|
||||
givenTaskWithStartAndEnd(toInterval(start, Period
|
||||
.days(TASK_DURATION_DAYS)));
|
||||
|
|
@ -571,8 +569,6 @@ public class GenericResourceAllocationTest {
|
|||
|
||||
private ResourceCalendar createCalendar(int capacity, int unit) {
|
||||
ResourceCalendar calendar = createNiceMock(ResourceCalendar.class);
|
||||
expect(calendar.getCapacityAt(isA(LocalDate.class))).andReturn(
|
||||
capacity * unit).anyTimes();
|
||||
expect(calendar.toHours(isA(LocalDate.class),
|
||||
isA(ResourcesPerDay.class))).andReturn(unit).anyTimes();
|
||||
expect(calendar.isActive(isA(LocalDate.class))).andReturn(true)
|
||||
|
|
|
|||
|
|
@ -77,8 +77,6 @@ public class SpecificResourceAllocationTest {
|
|||
|
||||
private void givenResourceCalendarAlwaysReturning(final int hours) {
|
||||
this.calendar = createNiceMock(ResourceCalendar.class);
|
||||
expect(this.calendar.getCapacityAt(isA(LocalDate.class))).andReturn(
|
||||
hours).anyTimes();
|
||||
expect(this.calendar.getCapacityDurationAt(isA(LocalDate.class)))
|
||||
.andReturn(EffortDuration.hours(hours)).anyTimes();
|
||||
expect(this.calendar.toHours(isA(LocalDate.class),
|
||||
|
|
@ -118,16 +116,6 @@ public class SpecificResourceAllocationTest {
|
|||
return EffortDuration.hours(defaultAnswer);
|
||||
}
|
||||
}).anyTimes();
|
||||
expect(this.calendar.getCapacityAt(isA(LocalDate.class))).andAnswer(new IAnswer<Integer>() {
|
||||
|
||||
@Override
|
||||
public Integer answer() throws Throwable {
|
||||
LocalDate date = (LocalDate) EasyMock
|
||||
.getCurrentArguments()[0];
|
||||
return calendar.getCapacityDurationAt(date)
|
||||
.roundToHours();
|
||||
}
|
||||
}).anyTimes();
|
||||
expect(
|
||||
this.calendar.toHours(isA(LocalDate.class),
|
||||
isA(ResourcesPerDay.class))).andAnswer(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue