xmlBlaster 2.1.0 API

org.xmlBlaster.test.classtest.queue
Class QueueExtendedTest

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

public class QueueExtendedTest
extends junit.framework.TestCase

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.QueueExtendedTest

Configuration example:

 JdbcDriver.drivers=org.postgresql.Driver
 JdbcDriver.postgresql.mapping=string=text,longint=bigint,int=integer,boolean=boolean
 queue.callback.url=jdbc:postgresql://localhost/test
 queue.callback.user=postgres
 queue.callback.password=
 

Test database with PostgreSQL:

 initdb /tmp/postgres
 cp /var/lib/pgsql/data/pg_hba.conf /tmp/postgres    (edit host access)
 createdb test
 postmaster -i -D /tmp/postgres
 

See Also:
MsgQueueEntry.compare(I_QueueEntry), I_Queue, RamQueuePlugin, JdbcQueueCommonTablePlugin

Field Summary
 int count
           
protected  ServerScope glob
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  int numOfMsg
           
private  int numOfQueues
           
static java.lang.String[] PLUGIN_TYPES
           
 java.util.ArrayList queueList
           
private  I_Queue[] queues
           
private  int sizeOfMsg
           
private  StopWatch stopWatch
           
 
Constructor Summary
QueueExtendedTest(ServerScope glob, java.lang.String name, int currImpl)
          Constructor for junit public QueueExtendedTest(String name) { this(new Global(), name); }
 
Method Summary
static void main(java.lang.String[] args)
           java org.xmlBlaster.test.classtest.queue.QueueExtendedTest
 void performanceMultiPut(int numOfQueues, int numOfMsg, int sizeOfMsg)
           
 void performancePut(int numOfQueues, int numOfMsg, int sizeOfMsg)
           
protected  void setUp()
           
static junit.framework.Test suite()
          Method is used by TestRunner to load these tests
 void tearDown()
           
 void testPerfomanceMultiPut()
           
 void testPerfomancePut()
           
 
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

stopWatch

private StopWatch stopWatch

numOfQueues

private int numOfQueues

numOfMsg

private int numOfMsg

sizeOfMsg

private int sizeOfMsg

queues

private I_Queue[] queues

queueList

public java.util.ArrayList queueList

PLUGIN_TYPES

public static java.lang.String[] PLUGIN_TYPES

count

public int count
Constructor Detail

QueueExtendedTest

public QueueExtendedTest(ServerScope glob,
                         java.lang.String name,
                         int currImpl)
Constructor for junit public QueueExtendedTest(String name) { this(new Global(), name); }

Method Detail

setUp

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

tearDown

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

testPerfomancePut

public void testPerfomancePut()

performancePut

public void performancePut(int numOfQueues,
                           int numOfMsg,
                           int sizeOfMsg)
                    throws XmlBlasterException
Throws:
XmlBlasterException

testPerfomanceMultiPut

public void testPerfomanceMultiPut()

performanceMultiPut

public void performanceMultiPut(int numOfQueues,
                                int numOfMsg,
                                int sizeOfMsg)
                         throws XmlBlasterException
Throws:
XmlBlasterException

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 org.xmlBlaster.test.classtest.queue.QueueExtendedTest
 


xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.