xmlBlaster 2.1.0 API

org.xmlBlaster.test.classtest.msgstore
Class I_MapTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.xmlBlaster.test.classtest.msgstore.I_MapTest
All Implemented Interfaces:
junit.framework.Test

public class I_MapTest
extends junit.framework.TestCase

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

See Also:
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

ME

private java.lang.String ME

glob

protected ServerScope glob

log

private static java.util.logging.Logger log

IS_DURABLE

private final boolean IS_DURABLE
See Also:
Constant Field Values

IS_TRANSIENT

private final boolean IS_TRANSIENT
See Also:
Constant Field Values

currMap

private I_Map currMap

currImpl

private int currImpl

PLUGIN_TYPES

static java.lang.String[] PLUGIN_TYPES
Constructor Detail

I_MapTest

public I_MapTest(java.lang.String name,
                 int currImpl)
Method Detail

setUp

protected void setUp()
Overrides:
setUp in class junit.framework.TestCase

createMsgUnit

private MsgUnit createMsgUnit(boolean persistent)

createMsgUnit

private MsgUnit createMsgUnit(boolean persistent,
                              long contentLen_)

testConfig

public void testConfig()
Tests QueuePropertyBase() and getStorageId()

Parameters:
queueTypeList - A space separated list of names for the implementations to be tested. Valid names are: RamMapPlugin JdbcMapPlugin

config

private void config(I_Map i_map)
Tests initialize(), getProperties(), setProperties() and capacity()

Parameters:
queue - !!!Is not initialized in this case!!!!

testPutMsg

public void testPutMsg()

putMsg

private void putMsg(I_Map i_map)
Tests put(MsgMapEntry[]) and put(MsgMapEntry) and clear()


testByteOverflow

public void testByteOverflow()
Tests overflow of maxNumOfBytes() of a CACHE.


testGetMsg

public void testGetMsg()

getMsg

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


testGetAllMsgs

public void testGetAllMsgs()

getAllMsgs

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


testGetAllSwappedMsgs

public void testGetAllSwappedMsgs()

getAllSwappedMsgs

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)


testPutEntriesTwice

public void testPutEntriesTwice()

putEntriesTwice

private void putEntriesTwice(I_Map i_map)

tearDown

public void tearDown()
Overrides:
tearDown in class junit.framework.TestCase

checkSizeAndEntries

private void checkSizeAndEntries(java.lang.String txt,
                                 java.util.ArrayList queueEntries,
                                 I_Map map)
See Also:
checkSizeAndEntries(String, I_MapEntry[], I_Map)

checkSizeAndEntries

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)


suite

public static junit.framework.Test suite()
Method is used by TestRunner to load these tests


main

public static void main(java.lang.String[] args)
  java -Dtrace=true org.xmlBlaster.test.classtest.msgstore.I_MapTest  > test.log
 


xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.