Changeset 529 for trunk/grails-app


Ignore:
Timestamp:
May 10, 2010, 8:30:25 AM (15 years ago)
Author:
gav
Message:

Tweak CreateDataService to prevent issues during testing.
Repair getBudgetTasks() search.
Complete testGetBudgetTasks() test.

Location:
trunk/grails-app/services
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/CreateDataService.groovy

    r523 r529  
    845845                targetStartDate: dateUtilService.tomorrow,
    846846                targetCompletionDate: dateUtilService.tomorrow,
    847                 parentTask: Task.get(1)]
     847                parentTask: Task.list()[0]]
    848848
    849849        taskResult = taskService.save(p)
     
    858858                targetStartDate: dateUtilService.yesterday,
    859859                targetCompletionDate: dateUtilService.yesterday,
    860                 parentTask: Task.get(1)]
     860                parentTask: Task.list()[0]]
    861861
    862862        taskResult = taskService.save(p)
     
    871871                targetStartDate: dateUtilService.today,
    872872                targetCompletionDate: dateUtilService.oneWeekFromNow,
    873                 parentTask: Task.get(1)]
     873                parentTask: Task.list()[0]]
    874874
    875875        taskResult = taskService.save(p)
     
    927927
    928928        //Entry #1
    929         p = [task: Task.get(1),
     929        p = [task: Task.list()[0],
    930930                entryType: EntryType.get(1),
    931931                comment: "This level sensor is causing us trouble.",
     
    935935
    936936        //Entry #2
    937         p = [task: Task.get(1),
     937        p = [task: Task.list()[0],
    938938                entryType: EntryType.get(3),
    939939                comment: "Cleaned sensor, see how it goes.",
     
    943943
    944944        //Entry #3
    945         p = [task: Task.get(1),
     945        p = [task: Task.list()[0],
    946946                entryType: EntryType.get(3),
    947947                comment: "Checked up on it later and sensor is dropping out intermittently, created sub task to replace sensor.",
     
    958958        //AssignedGroup #1
    959959        p = [personGroup: PersonGroup.get(1),
    960                 task: Task.get(1),
     960                task: Task.list()[0],
    961961                estimatedHour: 2,
    962962                estimatedMinute: 30]
     
    965965        //AssignedGroup #2
    966966        p = [personGroup: PersonGroup.get(2),
    967                 task: Task.get(1),
     967                task: Task.list()[0],
    968968                estimatedHour: 1,
    969969                estimatedMinute: 0]
     
    978978        //AssignedPerson #1
    979979        p = [person: Person.get(4),
    980                 task: Task.get(1),
     980                task: Task.list()[0],
    981981                estimatedHour: 1,
    982982                estimatedMinute: 20]
     
    985985        //AssignedPerson #2
    986986        p = [person: Person.get(5),
    987                 task: Task.get(1),
     987                task: Task.list()[0],
    988988                estimatedHour: 3,
    989989                estimatedMinute: 30]
     
    997997
    998998        //TaskRecurringSchedule #1
    999         taskRecurringScheduleInstance = new TaskRecurringSchedule(task: Task.get(1),
     999        taskRecurringScheduleInstance = new TaskRecurringSchedule(task: Task.list()[0],
    10001000                                                                                                    recurEvery: 1,
    10011001                                                                                                    recurPeriod: Period.get(2),
     
    10081008
    10091009        //TaskRecurringSchedule #2
    1010         taskRecurringScheduleInstance = new TaskRecurringSchedule(task: Task.get(6),
     1010        taskRecurringScheduleInstance = new TaskRecurringSchedule(task: Task.list()[0],
    10111011                                                                                                    recurEvery: 1,
    10121012                                                                                                    recurPeriod: Period.get(1),
     
    12701270        taskProcedureInstance = new TaskProcedure(name: "Daily check")
    12711271        saveAndTest(taskProcedureInstance)
    1272         taskProcedureInstance.addToTasks(Task.get(1))
     1272        taskProcedureInstance.addToTasks(Task.list()[0])
    12731273    }
    12741274
  • trunk/grails-app/services/TaskSearchService.groovy

    r524 r529  
    251251    * @param endDate The end date to get tasks for, defaults to the start of tomorrow and is exclusive (less than).
    252252    */
    253     def getBudgetTasks(params, budgetStatus=null, startDate=null, endDate=null) {
     253    def getBudgetTasks(params, taskBudgetStatus=null, startDate=null, endDate=null) {
    254254        def paginateParams = [:]
    255255        paginateParams.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax)
     
    261261
    262262        def namedParams = [:]
    263         namedParams.budgetStatus = budgetStatus ?: TaskBudgetStatus.read(2) // Planned.
     263        namedParams.taskBudgetStatus = taskBudgetStatus ?: TaskBudgetStatus.read(2) // Planned.
    264264        namedParams.startDate = startDate ?: dateUtilService.today
    265         namedParams.endDate = endDate ?: dateUtilService.oneWeekAgo
     265        namedParams.endDate = endDate ?: dateUtilService.tomorrow
    266266
    267267        def baseQuery = "from Task as task \
    268268                                        where (task.trash = false \
    269                                                     and task.budgetStatus = :budgetStatus \
     269                                                    and task.taskBudgetStatus = :taskBudgetStatus \
    270270                                                    and task.targetStartDate < :endDate \
    271271                                                    and task.targetCompletionDate >= :startDate \
Note: See TracChangeset for help on using the changeset viewer.