org.kuali.kpme.tklm.utils
Class TkTestUtils

java.lang.Object
  extended by org.kuali.kpme.tklm.utils.TkTestUtils

public class TkTestUtils
extends Object


Constructor Summary
TkTestUtils()
           
 
Method Summary
static TimeBlock createDummyTimeBlock(org.joda.time.DateTime clockIn, org.joda.time.DateTime clockOut, BigDecimal hours, String earnCode)
           
static TimeBlock createDummyTimeBlock(org.joda.time.DateTime clockIn, org.joda.time.DateTime clockOut, BigDecimal hours, String earnCode, Long jobNumber, Long workArea)
           
static TimeBlock createTimeBlock(TimesheetDocument timesheetDocument, int dayInPeriod, int numHours)
           
static TimeBlock createTimeBlock(TimesheetDocument timesheetDocument, int dayInPeriod, int numHours, String earnCode)
           
static List<TimeBlock> createUniformActualTimeBlocks(TimesheetDocument timesheetDocument, Assignment assignment, String earnCode, org.joda.time.DateTime start, int days, BigDecimal hours, BigDecimal amount, String principalId)
          Helper method to generate time blocks suitable for db persistence in unit tests.
static List<TimeBlock> createUniformTimeBlocks(org.joda.time.DateTime start, int days, BigDecimal hours, String earnCode, Long jobNumber, Long workArea)
          Helper method to create regular time blocks for use in testing.
static List<TimeBlock> createUniformTimeBlocks(org.joda.time.DateTime start, int days, BigDecimal hours, String earnCode, Long jobNumber, Long workArea, Long task)
           
static Map<org.joda.time.DateTime,BigDecimal> getDateToHoursMap(TimeBlock timeBlock, TimeHourDetail timeHourDetail)
           
static List<Job> getJobs(org.joda.time.LocalDate calDate, String principalId)
           
static TimesheetDocument populateBlankTimesheetDocument(org.joda.time.DateTime calDate, String principalId)
           
static TimesheetDocument populateTimesheetDocument(org.joda.time.DateTime calDate, String principalId)
           
static void verifyAggregateHourSums(Map<String,BigDecimal> ecToHoursMap, TkTimeBlockAggregate aggregate, int flsaWeek)
           
static void verifyAggregateHourSums(String msg, Map<String,BigDecimal> ecToHoursMap, TkTimeBlockAggregate aggregate, int flsaWeek)
          Helper method to verify that the aggregate contains the correct sums as indicated in the ecToHoursMapping, on a SINGLE given flsaWeek.
static void verifyAggregateHourSumsFlatList(String msg, Map<String,BigDecimal> ecToHoursMap, TkTimeBlockAggregate aggregate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TkTestUtils

public TkTestUtils()
Method Detail

populateBlankTimesheetDocument

public static TimesheetDocument populateBlankTimesheetDocument(org.joda.time.DateTime calDate,
                                                               String principalId)

populateTimesheetDocument

public static TimesheetDocument populateTimesheetDocument(org.joda.time.DateTime calDate,
                                                          String principalId)

createUniformTimeBlocks

public static List<TimeBlock> createUniformTimeBlocks(org.joda.time.DateTime start,
                                                      int days,
                                                      BigDecimal hours,
                                                      String earnCode,
                                                      Long jobNumber,
                                                      Long workArea)
Helper method to create regular time blocks for use in testing.

Parameters:
start -
days -
hours -
earnCode -
jobNumber -
workArea -
Returns:

createUniformTimeBlocks

public static List<TimeBlock> createUniformTimeBlocks(org.joda.time.DateTime start,
                                                      int days,
                                                      BigDecimal hours,
                                                      String earnCode,
                                                      Long jobNumber,
                                                      Long workArea,
                                                      Long task)

createDummyTimeBlock

public static TimeBlock createDummyTimeBlock(org.joda.time.DateTime clockIn,
                                             org.joda.time.DateTime clockOut,
                                             BigDecimal hours,
                                             String earnCode)

createDummyTimeBlock

public static TimeBlock createDummyTimeBlock(org.joda.time.DateTime clockIn,
                                             org.joda.time.DateTime clockOut,
                                             BigDecimal hours,
                                             String earnCode,
                                             Long jobNumber,
                                             Long workArea)

createTimeBlock

public static TimeBlock createTimeBlock(TimesheetDocument timesheetDocument,
                                        int dayInPeriod,
                                        int numHours)

createTimeBlock

public static TimeBlock createTimeBlock(TimesheetDocument timesheetDocument,
                                        int dayInPeriod,
                                        int numHours,
                                        String earnCode)

getJobs

public static List<Job> getJobs(org.joda.time.LocalDate calDate,
                                String principalId)

verifyAggregateHourSumsFlatList

public static void verifyAggregateHourSumsFlatList(String msg,
                                                   Map<String,BigDecimal> ecToHoursMap,
                                                   TkTimeBlockAggregate aggregate)

verifyAggregateHourSums

public static void verifyAggregateHourSums(String msg,
                                           Map<String,BigDecimal> ecToHoursMap,
                                           TkTimeBlockAggregate aggregate,
                                           int flsaWeek)
Helper method to verify that the aggregate contains the correct sums as indicated in the ecToHoursMapping, on a SINGLE given flsaWeek. Warning! Contains Assertions, use only with Test Cases.

Parameters:
ecToHoursMap - ex: { 'REG' => 40, 'OVT' => 10 }
aggregate - An aggregate object containing the time blocks
flsaWeek - 0 indexed start week (pulling from aggregate)

verifyAggregateHourSums

public static void verifyAggregateHourSums(Map<String,BigDecimal> ecToHoursMap,
                                           TkTimeBlockAggregate aggregate,
                                           int flsaWeek)

createUniformActualTimeBlocks

public static List<TimeBlock> createUniformActualTimeBlocks(TimesheetDocument timesheetDocument,
                                                            Assignment assignment,
                                                            String earnCode,
                                                            org.joda.time.DateTime start,
                                                            int days,
                                                            BigDecimal hours,
                                                            BigDecimal amount,
                                                            String principalId)
Helper method to generate time blocks suitable for db persistence in unit tests.


getDateToHoursMap

public static Map<org.joda.time.DateTime,BigDecimal> getDateToHoursMap(TimeBlock timeBlock,
                                                                       TimeHourDetail timeHourDetail)


Copyright © 2004-2014 The Kuali Foundation. All Rights Reserved.