Github user jdanekrh commented on the issue:
https://github.com/apache/qpid-proton-j/pull/19
Thanks. I took away the example change.
About the test. What happens is that PriorityQueue dequeues equal items in
arbitrary order. So the potential user-facing problem is that user creates two
tasks with the intention of first running first, which would not happen due to
the bug.
My only idea for deterministic test would be something like
```
public class TaskImplTest {
@Test
public void testCompareTo_greaterDeadlineObjectIsGreater() {
TaskImpl t42 = new TaskImpl(42);
TaskImpl t24 = new TaskImpl(24);
Assert.assertTrue(t24.compareTo(t42) <= 0);
}
@Test
public void testCompareTo_equalDeadlineLaterCreatedObjectIsGreater() {
TaskImpl t42a = new TaskImpl(42);
TaskImpl t42b = new TaskImpl(42);
Assert.assertTrue(t42a.compareTo(t42b) <= 0);
}
}
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]