@ -31,9 +31,9 @@ public class TaskPriorityQueueImplTest {
@Test
@Test
public void testSort ( ) {
public void testSort ( ) {
TaskPriority priorityOne = new TaskPriority ( 1 , 0 , 0 , 0 , "default" ) ;
TaskPriority priorityOne = new TaskPriority ( 1 , 0 , 0 , 0 , 1 , "default" ) ;
TaskPriority priorityTwo = new TaskPriority ( 2 , 0 , 0 , 0 , "default" ) ;
TaskPriority priorityTwo = new TaskPriority ( 2 , 0 , 0 , 0 , 1 , "default" ) ;
TaskPriority priorityThree = new TaskPriority ( 3 , 0 , 0 , 0 , "default" ) ;
TaskPriority priorityThree = new TaskPriority ( 3 , 0 , 0 , 0 , 1 , "default" ) ;
List < TaskPriority > taskPrioritys = Arrays . asList ( priorityOne , priorityThree , priorityTwo ) ;
List < TaskPriority > taskPrioritys = Arrays . asList ( priorityOne , priorityThree , priorityTwo ) ;
Collections . sort ( taskPrioritys ) ;
Collections . sort ( taskPrioritys ) ;
Assert . assertEquals (
Assert . assertEquals (
@ -41,9 +41,9 @@ public class TaskPriorityQueueImplTest {
taskPrioritys
taskPrioritys
) ;
) ;
priorityOne = new TaskPriority ( 0 , 1 , 0 , 0 , "default" ) ;
priorityOne = new TaskPriority ( 0 , 1 , 0 , 0 , 1 , "default" ) ;
priorityTwo = new TaskPriority ( 0 , 2 , 0 , 0 , "default" ) ;
priorityTwo = new TaskPriority ( 0 , 2 , 0 , 0 , 1 , "default" ) ;
priorityThree = new TaskPriority ( 0 , 3 , 0 , 0 , "default" ) ;
priorityThree = new TaskPriority ( 0 , 3 , 0 , 0 , 1 , "default" ) ;
taskPrioritys = Arrays . asList ( priorityOne , priorityThree , priorityTwo ) ;
taskPrioritys = Arrays . asList ( priorityOne , priorityThree , priorityTwo ) ;
Collections . sort ( taskPrioritys ) ;
Collections . sort ( taskPrioritys ) ;
Assert . assertEquals (
Assert . assertEquals (
@ -51,9 +51,9 @@ public class TaskPriorityQueueImplTest {
taskPrioritys
taskPrioritys
) ;
) ;
priorityOne = new TaskPriority ( 0 , 0 , 1 , 0 , "default" ) ;
priorityOne = new TaskPriority ( 0 , 0 , 1 , 0 , 1 , "default" ) ;
priorityTwo = new TaskPriority ( 0 , 0 , 2 , 0 , "default" ) ;
priorityTwo = new TaskPriority ( 0 , 0 , 2 , 0 , 1 , "default" ) ;
priorityThree = new TaskPriority ( 0 , 0 , 3 , 0 , "default" ) ;
priorityThree = new TaskPriority ( 0 , 0 , 3 , 0 , 1 , "default" ) ;
taskPrioritys = Arrays . asList ( priorityOne , priorityThree , priorityTwo ) ;
taskPrioritys = Arrays . asList ( priorityOne , priorityThree , priorityTwo ) ;
Collections . sort ( taskPrioritys ) ;
Collections . sort ( taskPrioritys ) ;
Assert . assertEquals (
Assert . assertEquals (
@ -61,9 +61,9 @@ public class TaskPriorityQueueImplTest {
taskPrioritys
taskPrioritys
) ;
) ;
priorityOne = new TaskPriority ( 0 , 0 , 0 , 1 , "default" ) ;
priorityOne = new TaskPriority ( 0 , 0 , 0 , 1 , 1 , "default" ) ;
priorityTwo = new TaskPriority ( 0 , 0 , 0 , 2 , "default" ) ;
priorityTwo = new TaskPriority ( 0 , 0 , 0 , 2 , 1 , "default" ) ;
priorityThree = new TaskPriority ( 0 , 0 , 0 , 3 , "default" ) ;
priorityThree = new TaskPriority ( 0 , 0 , 0 , 3 , 1 , "default" ) ;
taskPrioritys = Arrays . asList ( priorityOne , priorityThree , priorityTwo ) ;
taskPrioritys = Arrays . asList ( priorityOne , priorityThree , priorityTwo ) ;
Collections . sort ( taskPrioritys ) ;
Collections . sort ( taskPrioritys ) ;
Assert . assertEquals (
Assert . assertEquals (
@ -71,15 +71,45 @@ public class TaskPriorityQueueImplTest {
taskPrioritys
taskPrioritys
) ;
) ;
priorityOne = new TaskPriority ( 0 , 0 , 0 , 0 , "default_1" ) ;
priorityOne = new TaskPriority ( 0 , 0 , 0 , 0 , 1 , "default_1" ) ;
priorityTwo = new TaskPriority ( 0 , 0 , 0 , 0 , "default_2" ) ;
priorityTwo = new TaskPriority ( 0 , 0 , 0 , 0 , 1 , "default_2" ) ;
priorityThree = new TaskPriority ( 0 , 0 , 0 , 0 , "default_3" ) ;
priorityThree = new TaskPriority ( 0 , 0 , 0 , 0 , 1 , "default_3" ) ;
taskPrioritys = Arrays . asList ( priorityOne , priorityThree , priorityTwo ) ;
taskPrioritys = Arrays . asList ( priorityOne , priorityThree , priorityTwo ) ;
Collections . sort ( taskPrioritys ) ;
Collections . sort ( taskPrioritys ) ;
Assert . assertEquals (
Assert . assertEquals (
Arrays . asList ( priorityOne , priorityTwo , priorityThree ) ,
Arrays . asList ( priorityOne , priorityTwo , priorityThree ) ,
taskPrioritys
taskPrioritys
) ;
) ;
priorityOne = new TaskPriority ( 0 , 0 , 0 , 0 , 2 , "default_1" ) ;
priorityTwo = new TaskPriority ( 0 , 0 , 0 , 0 , 1 , "default_2" ) ;
priorityThree = new TaskPriority ( 0 , 0 , 0 , 0 , 3 , "default_3" ) ;
taskPrioritys = Arrays . asList ( priorityOne , priorityThree , priorityTwo ) ;
Collections . sort ( taskPrioritys ) ;
Assert . assertEquals (
Arrays . asList ( priorityThree , priorityOne , priorityTwo ) ,
taskPrioritys
) ;
priorityOne = new TaskPriority ( 0 , 0 , 0 , 0 , 1 , "default_1" ) ;
priorityTwo = new TaskPriority ( 0 , 0 , 0 , 0 , 1 , "default_2" ) ;
priorityThree = new TaskPriority ( 0 , 0 , 0 , 0 , 3 , "default_3" ) ;
taskPrioritys = Arrays . asList ( priorityOne , priorityThree , priorityTwo ) ;
Collections . sort ( taskPrioritys ) ;
Assert . assertEquals (
Arrays . asList ( priorityThree , priorityOne , priorityTwo ) ,
taskPrioritys
) ;
priorityTwo = new TaskPriority ( 0 , 0 , 0 , 0 , 1 , "default_1" ) ;
priorityOne = new TaskPriority ( 0 , 0 , 0 , 0 , 1 , "default_1" ) ;
priorityThree = new TaskPriority ( 0 , 0 , 0 , 0 , 3 , "default_1" ) ;
taskPrioritys = Arrays . asList ( priorityTwo , priorityOne , priorityThree ) ;
Collections . sort ( taskPrioritys ) ;
Assert . assertEquals (
Arrays . asList ( priorityThree , priorityTwo , priorityOne ) ,
taskPrioritys
) ;
}
}
@Test
@Test
@ -134,7 +164,7 @@ public class TaskPriorityQueueImplTest {
* @return
* @return
* /
* /
private TaskPriority createTaskPriority ( Integer priority , Integer processInstanceId ) {
private TaskPriority createTaskPriority ( Integer priority , Integer processInstanceId ) {
TaskPriority priorityOne = new TaskPriority ( priority , processInstanceId , 0 , 0 , "default" ) ;
TaskPriority priorityOne = new TaskPriority ( priority , processInstanceId , 0 , 0 , 1 , "default" ) ;
return priorityOne ;
return priorityOne ;
}
}
}
}