org.eigenbase.runtime
Class QueueIteratorTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.eigenbase.runtime.QueueIteratorTest
- All Implemented Interfaces:
- Test
public class QueueIteratorTest
- extends TestCase
Test case for QueueIteratorTest.TestingTimeoutQueueIterator
and its subclasses ThreadIterator
and QueueIteratorTest.TestingTimeoutQueueIterator
.
Field Summary |
private static String[] |
queueValues
Contents of queue in both tests. |
private long |
startTime
Timestamp at which the test started. |
private static int |
tickMillis
Multiplier which determines how long each logical clock tick lasts, and
therefore how fast the test is run. |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
tickMillis
private static final int tickMillis
- Multiplier which determines how long each logical clock tick lasts, and
therefore how fast the test is run. If you are getting sporadic problems,
raise the value. 100 seems to be too low; 200 seems to be OK on my 1.8GHz
laptop.
- See Also:
- Constant Field Values
queueValues
private static final String[] queueValues
- Contents of queue in both tests.
startTime
private long startTime
- Timestamp at which the test started. All timeouts are relative to this.
QueueIteratorTest
public QueueIteratorTest(String s)
throws Exception
- Throws:
Exception
testTimeoutIterator
public void testTimeoutIterator()
testThreadIterator
public void testThreadIterator()
read
private void read(QueueIterator iter)
assertHasNext
private void assertHasNext(QueueIterator iter,
boolean expected,
long timeoutMillis)
assertHasNextTimesOut
private void assertHasNextTimesOut(QueueIterator iter,
long timeoutMillis)
assertNext
private void assertNext(QueueIterator iter,
Object expected,
long timeoutMillis)
assertNextTimesOut
private void assertNextTimesOut(QueueIterator iter,
long timeoutMillis)
toMillis
private long toMillis(double tick)