More explicit error messages in some PriorityQueue tests.
This commit is contained in:
+4
-4
@@ -237,14 +237,14 @@ public abstract class PriorityQueueTest {
|
||||
max = new MutableInteger(Collections.max(data).get() + 1);
|
||||
try {
|
||||
queue.remove(min);
|
||||
fail("Expected exception " + ElementNotFoundException.class.getName());
|
||||
fail("Removing a non-existing element from queue succeeds. I was expecting " + ElementNotFoundException.class.getName());
|
||||
}
|
||||
catch (ElementNotFoundException e) {
|
||||
assertEquals(min, e.getElement());
|
||||
}
|
||||
try {
|
||||
queue.remove(max);
|
||||
fail("Expected exception " + ElementNotFoundException.class.getName());
|
||||
fail("Removing a non-existing element from queue succeeds. I was expecting " + ElementNotFoundException.class.getName());
|
||||
}
|
||||
catch (ElementNotFoundException e) {
|
||||
assertEquals(max, e.getElement());
|
||||
@@ -258,7 +258,7 @@ public abstract class PriorityQueueTest {
|
||||
MutableInteger min = queue.deleteMin();
|
||||
try {
|
||||
queue.remove(min);
|
||||
fail("Expected exception " + ElementNotFoundException.class.getName());
|
||||
fail("Removing an element that has just been deleted unexpectedly succeeds. I was expecting the exception " + ElementNotFoundException.class.getName());
|
||||
}
|
||||
catch (ElementNotFoundException e) {
|
||||
assertEquals(min, e.getElement());
|
||||
@@ -274,7 +274,7 @@ public abstract class PriorityQueueTest {
|
||||
copyQueue.remove(data);
|
||||
try {
|
||||
copyQueue.remove(data);
|
||||
fail("Expected exception " + ElementNotFoundException.class.getName());
|
||||
fail("Removing twice the same element unexpectedly succeeds. I was expecting the exception " + ElementNotFoundException.class.getName());
|
||||
}
|
||||
catch (ElementNotFoundException e) {
|
||||
assertEquals(data, e.getElement());
|
||||
|
||||
Reference in New Issue
Block a user