|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.xmlBlaster.test.stress.MassiveSubTest
public class MassiveSubTest
Test differents scenarios for a massive ammount of subscibers.
Test 5000 subscribers (or numSubscribers) on one connection.
Test 5000 subscribers (or numSubscribers) with maxSubPerCon per connection
Test 5000 subscribers (or numSubscribers) on one connection each.
Do it for IOP, RMI
If withEmbedded is set to false will run without an embedded server.
java -Xms18M -Xmx256M org.xmlBlaster.test.stress.MassiveSubTest java -Xms18M -Xmx256M junit.swingui.TestRunner -noloading org.xmlBlaster.test.stress.MassiveSubTest
Nested Class Summary | |
---|---|
(package private) class |
MassiveSubTest.Client
|
Field Summary | |
---|---|
private java.lang.String |
contentMime
|
private java.lang.String |
contentMimeExtended
|
private Global |
glob
|
private GlobalUtil |
globalUtil
|
private static java.util.logging.Logger |
log
|
private MassiveSubTest.Client[] |
manyClients
|
private I_XmlBlasterAccess[] |
manyConnections
|
private int |
maxSubPerCon
|
private java.lang.String |
ME
|
private boolean |
messageArrived
|
private int |
noToPub
|
private int |
numReceived
|
private int |
numSubscribers
|
private int |
numToRec
|
private I_XmlBlasterAccess |
oneConnection
|
private java.lang.String |
oneName
|
private java.lang.String |
publishOid1
|
private int |
serverPort
|
private EmbeddedXmlBlaster |
serverThread
|
private StopWatch |
stopWatch
|
private MsgInterceptor |
updateInterceptor
|
private boolean |
useOneConnection
|
private boolean |
withEmbedded
|
Constructor Summary | |
---|---|
MassiveSubTest(Global glob,
java.lang.String testName,
java.lang.String loginName,
boolean useOneConnection)
|
|
MassiveSubTest(java.lang.String testName)
|
Method Summary | |
---|---|
(package private) long |
getUsedServerMemory()
Query xmlBlaster for its current memory consumption. |
void |
init(Global glob,
java.lang.String testName,
java.lang.String loginName,
boolean useOneConnection)
|
static void |
main(java.lang.String[] args)
|
void |
publish()
TEST: Publish numToPub messages.. |
private static void |
setProtoMax(Global glob,
java.lang.String proto,
java.lang.String max)
|
protected void |
setUp()
Sets up the fixture. |
void |
subcribeMany()
helper |
static junit.framework.Test |
suite()
Method is used by TestRunner to load these tests. |
protected void |
tearDown()
Tears down the fixture. |
void |
testManyClients()
TEST: Construct a message and publish it, all clients should receive an update. |
java.lang.String |
update(java.lang.String cbSessionId,
UpdateKey updateKey,
byte[] content,
UpdateQos updateQos)
This is the callback method invoked from xmlBlaster delivering us a new asynchronous message. |
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 int numSubscribers
private int maxSubPerCon
private boolean useOneConnection
private boolean withEmbedded
private int noToPub
private int numToRec
private java.lang.String ME
private Global glob
private static java.util.logging.Logger log
private int serverPort
private EmbeddedXmlBlaster serverThread
private boolean messageArrived
private MsgInterceptor updateInterceptor
private final java.lang.String publishOid1
private I_XmlBlasterAccess oneConnection
private java.lang.String oneName
private int numReceived
private final java.lang.String contentMime
private final java.lang.String contentMimeExtended
private GlobalUtil globalUtil
private MassiveSubTest.Client[] manyClients
private I_XmlBlasterAccess[] manyConnections
private StopWatch stopWatch
Constructor Detail |
---|
public MassiveSubTest(java.lang.String testName)
public MassiveSubTest(Global glob, java.lang.String testName, java.lang.String loginName, boolean useOneConnection)
Method Detail |
---|
public void init(Global glob, java.lang.String testName, java.lang.String loginName, boolean useOneConnection)
protected void setUp()
setUp
in class junit.framework.TestCase
protected void tearDown()
tearDown
in class junit.framework.TestCase
public void subcribeMany()
long getUsedServerMemory()
public void publish()
public java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos)
update
in interface I_Callback
cbSessionId
- The session ID specified by the client which registered the callback.
You can specify a cbSessionId during connection (with ConnectQos)
and this is bounced back here so you can authenticate the message.updateKey
- The arrived key containing the topic namecontent
- The arrived message content. This is your payload.I_Callback.update(String, UpdateKey, byte[], UpdateQos)
public void testManyClients()
public static junit.framework.Test suite()
Warning! The default uses the embedded server, to give each round a equal chance. But it is MUCH slower than using a server in another VM.
private static void setProtoMax(Global glob, java.lang.String proto, java.lang.String max)
public static void main(java.lang.String[] args)
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |