You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
722 B
33 lines
722 B
package testat_g11;
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
public abstract class ASimplePriorityQueueTest extends ASimplePriorityQueueBaseTest {
|
|
|
|
protected static IPDetermination<Ticket> prioDetermination = new IPDetermination<Ticket>() {
|
|
@Override
|
|
public int calculate(Ticket t) {
|
|
// TODO Auto-generated method stub
|
|
return IPDetermination.super.calculate(t);
|
|
}
|
|
|
|
};
|
|
|
|
// Ageing
|
|
@Test
|
|
public void testPoll5() {
|
|
queue.add(t1);
|
|
queue.add(t2);
|
|
queue.add(t3);
|
|
queue.poll();
|
|
queue.poll();
|
|
queue.add(t8);
|
|
Ticket actual = queue.poll();
|
|
assertEquals(t2, actual);
|
|
actual = queue.poll();
|
|
assertEquals(t8, actual);
|
|
}
|
|
|
|
}
|
|
|