Package minpq
Class MinPQTests
- java.lang.Object
-
- minpq.MinPQTests
-
- Direct Known Subclasses:
HeapMinPQTests
,OptimizedHeapMinPQTests
,UnsortedArrayMinPQTests
@TestInstance(PER_CLASS) public abstract class MinPQTests extends Object
Abstract class providing test cases for allMinPQ
implementations.- See Also:
MinPQ
-
-
Constructor Summary
Constructors Constructor Description MinPQTests()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private static void
addAllComments(MinPQ<String> pq, Map<Double,String> toxic)
Add all comments and toxicities to the given priority queue.(package private) void
complicatedTest()
abstract MinPQ<String>
createMinPQ()
Returns an emptyMinPQ
.private static boolean
sameRemoveOrder(MinPQ<String> ref, MinPQ<String> test)
Remove all elements fromref
andtest
and returns true if the order of removals are the same.(package private) void
setup()
-
-
-
Field Detail
-
PATH
private static final String PATH
Path to the toxic content.- See Also:
- Constant Field Values
-
-
Method Detail
-
createMinPQ
public abstract MinPQ<String> createMinPQ()
Returns an emptyMinPQ
.- Returns:
- an empty
MinPQ
-
setup
@BeforeAll void setup() throws IOException
- Throws:
IOException
-
complicatedTest
@Test void complicatedTest()
-
addAllComments
private static void addAllComments(MinPQ<String> pq, Map<Double,String> toxic)
Add all comments and toxicities to the given priority queue.- Parameters:
pq
- destination priority queue.toxic
-Map
of toxicity values to comments (since comments can share the same toxicity value).
-
sameRemoveOrder
private static boolean sameRemoveOrder(MinPQ<String> ref, MinPQ<String> test)
Remove all elements fromref
andtest
and returns true if the order of removals are the same.- Parameters:
ref
- the reference priority queue.test
- the testing priority queue.- Returns:
- true if the order of removals are the same.
-
-