|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.xmlBlaster.test.classtest.queue.I_QueueTest
public class I_QueueTest
Test RamQueuePlugin.
The sorting order is priority,timestamp:
-> 5,100 - 5,98 - 5,50 - 9,3000 - 9,2500 ->
As 9 is highest priority it is the first to be taken out.
As we need to maintain the timely sequence and
id is a timestamp in (more or less) nano seconds elapsed since 1970)
the id 2500 (it is older) has precedence to the id 3000
Invoke: java -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.classtest.queue.I_QueueTest
MsgQueueEntry.compare(I_QueueEntry)
,
I_Queue
,
RamQueuePlugin
,
org.xmlBlaster.util.queue.jdbc.JdbcQueuePlugin
Nested Class Summary | |
---|---|
class |
I_QueueTest.QueuePutter
|
(package private) class |
I_QueueTest.QueueSizeListener
|
Field Summary | |
---|---|
protected Global |
glob
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
ME
|
(package private) static java.lang.String[] |
PLUGIN_TYPES
|
private I_Queue |
queue
|
private I_QueueTest.QueueSizeListener |
queueSizeListener
|
Constructor Summary | |
---|---|
I_QueueTest(java.lang.String name,
int currImpl,
Global glob)
|
Method Summary | |
---|---|
private int |
assertCheckForTakeLowest(I_Queue queue,
int numEntries,
long numBytes,
I_QueueEntry refEntry,
boolean leaveOne,
I_QueueEntry[] origEntries,
int entriesLeft,
int currentEntries,
long size)
returns the number of entries left in the queue after this processing operation |
private void |
bigEntries(I_Queue queue)
Test bigEngtries(I_Queue) It tests the insertion and removal of entries which contain a large blob (2.1MB) |
private void |
checkSizeAndEntries(java.lang.String txt,
I_QueueEntry[] queueEntries,
I_Queue queue)
Helper method to do a generic size check (size and number of entries) |
private void |
checkSizeAndEntries(java.lang.String txt,
java.util.List<I_Entry> queueEntries,
I_Queue queue)
|
private void |
config(I_Queue queue)
Tests initialize(), getProperties(), setProperties() and capacity() |
static void |
main(java.lang.String[] args)
java org.xmlBlaster.test.classtest.queue.I_QueueTest |
private void |
overflow(I_Queue queue)
Test overflow(I_Queue) It tests if the overflow mechanism works OK |
private void |
peekMsg(I_Queue queue)
Tests peek() and peek(int num) and remove() For a discussion of the sorting order see Javadoc of this class |
private void |
peekWithLimitEntry(I_Queue queue)
Test testPeekWithLimitEntry(I_Queue) |
private void |
publishMsgBigEntry(I_Queue queue)
Test bigEngtries(I_Queue) It tests the insertion and removal of entries which contain a large blob (2.1MB) |
private void |
putEntriesTwice(I_Queue queue)
Test wrongOrder(I_Queue) |
private void |
putMsg(I_Queue queue)
Tests put(MsgQueueEntry[]) and put(MsgQueueEntry) and clear() |
private void |
removeRandom(I_Queue queue)
Test removeRandom(long[]) |
private void |
removeWithPriority(I_Queue queue)
Test removeWithPriority(long[]) |
protected void |
setUp()
|
private void |
size1(I_Queue queue)
Tests put(MsgQueueEntry[]) and put(MsgQueueEntry) and clear() |
private void |
sizesCheck(I_Queue queue)
Test sizesCheck(I_Queue) |
static junit.framework.Test |
suite()
Method is used by TestRunner to load these tests |
private void |
takeLowest(I_Queue queue)
Test takeLowest(I_Queue) |
void |
tearDown()
|
void |
testBigEntries()
|
void |
testConfig()
Tests QueuePropertyBase() and getStorageId() |
void |
testOverflow()
|
void |
testPeekMsg()
|
void |
testPeekMsgBlocking()
|
void |
testPeekWithLimitEntry()
|
void |
testPutEntriesTwice()
|
void |
testPutMsg()
|
void |
testRemoveRandom()
|
void |
testRemoveWithPriority()
|
void |
testSize1()
|
void |
testSizesCheck()
|
void |
testTakeLowest()
|
void |
testWrongOrder()
|
private void |
wrongOrder(I_Queue queue)
Test wrongOrder(I_Queue) |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String ME
protected Global glob
private static java.util.logging.Logger log
private I_Queue queue
private I_QueueTest.QueueSizeListener queueSizeListener
static java.lang.String[] PLUGIN_TYPES
Constructor Detail |
---|
public I_QueueTest(java.lang.String name, int currImpl, Global glob)
Method Detail |
---|
protected void setUp()
setUp
in class junit.framework.TestCase
public void testConfig()
queueTypeList
- A space separated list of names for the
implementations to be tested. Valid names are:
RamQueuePlugin JdbcQueuePluginprivate void config(I_Queue queue)
queue
- !!!Is not initialized in this case!!!!public void testSize1()
private void size1(I_Queue queue)
public void testPutMsg()
private void checkSizeAndEntries(java.lang.String txt, java.util.List<I_Entry> queueEntries, I_Queue queue)
checkSizeAndEntries(String, I_QueueEntry[], I_Queue)
private void checkSizeAndEntries(java.lang.String txt, I_QueueEntry[] queueEntries, I_Queue queue)
private void putMsg(I_Queue queue)
public void testPeekMsg()
public void testPeekMsgBlocking()
private void peekMsg(I_Queue queue)
public void testRemoveWithPriority()
private void removeWithPriority(I_Queue queue)
public void testRemoveRandom()
private void removeRandom(I_Queue queue)
public void testTakeLowest()
private final int assertCheckForTakeLowest(I_Queue queue, int numEntries, long numBytes, I_QueueEntry refEntry, boolean leaveOne, I_QueueEntry[] origEntries, int entriesLeft, int currentEntries, long size) throws XmlBlasterException
queue
- the queue to use for this testnumEntries
- the number of entries to pass to the takeLowest operationnumBytes
- the num of bytes to pass to the takeLowest operationleaveOne
- the flag to pass to the takeLowest operationorigEntries
- the array of the original entries put into the queueentriesLeft
- number of entries left in the queue before this operationcurrentEntries
- the number of entries which should have been processed by this operation
XmlBlasterException
private void takeLowest(I_Queue queue)
public void testWrongOrder()
private void wrongOrder(I_Queue queue)
public void testPutEntriesTwice()
private void putEntriesTwice(I_Queue queue)
public void testPeekWithLimitEntry()
private void peekWithLimitEntry(I_Queue queue)
public void testSizesCheck()
private void sizesCheck(I_Queue queue)
public void testBigEntries()
private void publishMsgBigEntry(I_Queue queue)
private void bigEntries(I_Queue queue)
public void testOverflow()
private void overflow(I_Queue queue)
public void tearDown()
tearDown
in class junit.framework.TestCase
public static junit.framework.Test suite()
public static void main(java.lang.String[] args)
java org.xmlBlaster.test.classtest.queue.I_QueueTest
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |