xmlBlaster 2.2.0 API

org.xmlBlaster.test.stress
Class RamTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.xmlBlaster.test.stress.RamTest
All Implemented Interfaces:
junit.framework.Test

public class RamTest
extends junit.framework.TestCase

This client publishes 1000 different messages to measure RAM consumption/message.
The RAM consumption in kByte/Message is logged to the console.
Note that this is the net RAM consumption, without any content and a very small XmlKey. You may see this as the internal memory overhead in xmlBlaster for each published message.
This client may be invoked multiple time on the same xmlBlaster server, as it cleans up everything after his tests are done.

Invoke examples:

    java junit.textui.TestRunner org.xmlBlaster.test.stress.RamTest
    java junit.swingui.TestRunner org.xmlBlaster.test.stress.RamTest
 


Field Summary
private  java.lang.String contentMime
           
private  java.lang.String contentMimeExtended
           
private  Global glob
           
private static java.util.logging.Logger log
           
private  int numPublish
           
private  I_XmlBlasterAccess senderConnection
           
private  java.lang.String senderContent
           
private  java.lang.String senderName
           
private  StopWatch stopWatch
           
 
Constructor Summary
RamTest()
          Constructor for Junit
RamTest(Global glob, java.lang.String testName, java.lang.String loginName, int numPublish)
          Constructs the RamTest object.
 
Method Summary
 void doPublish()
          TEST: Construct a message and publish it.
static void main(java.lang.String[] args)
          Deprecated. Use the TestRunner from the testsuite to run it:

   java -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.stress.RamTest
protected  void setUp()
          Sets up the fixture.
static junit.framework.Test suite()
          Method is used by TestRunner to load these tests
protected  void tearDown()
          Tears down the fixture.
 void testManyPublish()
          TEST: Construct 1000 messages and publish it.
 
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

glob

private final Global glob

log

private static java.util.logging.Logger log

stopWatch

private StopWatch stopWatch

senderConnection

private I_XmlBlasterAccess senderConnection

senderName

private java.lang.String senderName

senderContent

private java.lang.String senderContent

numPublish

private final int numPublish

contentMime

private final java.lang.String contentMime
See Also:
Constant Field Values

contentMimeExtended

private final java.lang.String contentMimeExtended
See Also:
Constant Field Values
Constructor Detail

RamTest

public RamTest()
Constructor for Junit


RamTest

public RamTest(Global glob,
               java.lang.String testName,
               java.lang.String loginName,
               int numPublish)
Constructs the RamTest object.

Parameters:
testName - The name used in the test suite
loginName - The name to login to the xmlBlaster
numPublish - The number of messages to send
Method Detail

setUp

protected void setUp()
Sets up the fixture.

Connect to xmlBlaster and login

Overrides:
setUp in class junit.framework.TestCase

tearDown

protected void tearDown()
Tears down the fixture.

cleaning up .... erase() the previous message OID and logout

Overrides:
tearDown in class junit.framework.TestCase

doPublish

public void doPublish()
TEST: Construct a message and publish it.

The returned publishOid is checked


testManyPublish

public void testManyPublish()
TEST: Construct 1000 messages and publish it.


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)
Deprecated. Use the TestRunner from the testsuite to run it:

   java -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.stress.RamTest

Invoke: java org.xmlBlaster.test.stress.RamTest
You can use the command line option -numPublish 1000 to change the number of messages sent.


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.