|
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.msgstore.I_MapTest
public class I_MapTest
Test I_Map e.g. MapPlugin which allows to store randomly messages.
Invoke: java -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.classtest.msgstore.I_MapTest
I_Map
,
MapPlugin
,
org.xmlBlaster.util.queue.jdbc.JdbcQueuePlugin
Field Summary | |
---|---|
private int |
currImpl
|
private I_Map |
currMap
|
protected ServerScope |
glob
|
private boolean |
IS_DURABLE
|
private boolean |
IS_TRANSIENT
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
ME
|
(package private) static java.lang.String[] |
PLUGIN_TYPES
|
Constructor Summary | |
---|---|
I_MapTest(java.lang.String name,
int currImpl)
|
Method Summary | |
---|---|
private void |
checkSizeAndEntries(java.lang.String txt,
java.util.ArrayList queueEntries,
I_Map map)
|
private void |
checkSizeAndEntries(java.lang.String txt,
I_MapEntry[] queueEntries,
I_Map i_map)
Helper method to do a generic size check (size and number of entries) |
private void |
config(I_Map i_map)
Tests initialize(), getProperties(), setProperties() and capacity() |
private MsgUnit |
createMsgUnit(boolean persistent)
|
private MsgUnit |
createMsgUnit(boolean persistent,
long contentLen_)
|
private void |
getAllMsgs(I_Map i_map)
Tests get() and get(int num) and remove() NOTE: Currently the MapPlugin returns getAll() sorted (it uses a TreeMap) But we haven't yet forced this in the I_Map#getAll() Javadoc! This test assumes sorting order and needs to be changed if we once decide to specify the exact behaviour in I_Map#getAll() javadoc |
private void |
getAllSwappedMsgs(I_Map i_map)
Tests getAll() and the entries are swapped as the RAM size is only 2 NOTE: see NOTE of getAllMsgs(I_Map) |
private void |
getMsg(I_Map i_map)
Tests get() and get(int num) and remove() For a discussion of the sorting order see Javadoc of this class |
static void |
main(java.lang.String[] args)
java -Dtrace=true org.xmlBlaster.test.classtest.msgstore.I_MapTest > test.log |
private void |
putEntriesTwice(I_Map i_map)
|
private void |
putMsg(I_Map i_map)
Tests put(MsgMapEntry[]) and put(MsgMapEntry) and clear() |
protected void |
setUp()
|
static junit.framework.Test |
suite()
Method is used by TestRunner to load these tests |
void |
tearDown()
|
void |
testByteOverflow()
Tests overflow of maxNumOfBytes() of a CACHE. |
void |
testConfig()
Tests QueuePropertyBase() and getStorageId() |
void |
testGetAllMsgs()
|
void |
testGetAllSwappedMsgs()
|
void |
testGetMsg()
|
void |
testPutEntriesTwice()
|
void |
testPutMsg()
|
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 ServerScope glob
private static java.util.logging.Logger log
private final boolean IS_DURABLE
private final boolean IS_TRANSIENT
private I_Map currMap
private int currImpl
static java.lang.String[] PLUGIN_TYPES
Constructor Detail |
---|
public I_MapTest(java.lang.String name, int currImpl)
Method Detail |
---|
protected void setUp()
setUp
in class junit.framework.TestCase
private MsgUnit createMsgUnit(boolean persistent)
private MsgUnit createMsgUnit(boolean persistent, long contentLen_)
public void testConfig()
queueTypeList
- A space separated list of names for the
implementations to be tested. Valid names are:
RamMapPlugin JdbcMapPluginprivate void config(I_Map i_map)
queue
- !!!Is not initialized in this case!!!!public void testPutMsg()
private void putMsg(I_Map i_map)
public void testByteOverflow()
public void testGetMsg()
private void getMsg(I_Map i_map)
public void testGetAllMsgs()
private void getAllMsgs(I_Map i_map)
public void testGetAllSwappedMsgs()
private void getAllSwappedMsgs(I_Map i_map)
public void testPutEntriesTwice()
private void putEntriesTwice(I_Map i_map)
public void tearDown()
tearDown
in class junit.framework.TestCase
private void checkSizeAndEntries(java.lang.String txt, java.util.ArrayList queueEntries, I_Map map)
checkSizeAndEntries(String, I_MapEntry[], I_Map)
private void checkSizeAndEntries(java.lang.String txt, I_MapEntry[] queueEntries, I_Map i_map)
public static junit.framework.Test suite()
public static void main(java.lang.String[] args)
java -Dtrace=true org.xmlBlaster.test.classtest.msgstore.I_MapTest > test.log
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |