|
||||||||||
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.apache.qpid.junit.extensions.AsymptoticTestCase
org.apache.qpid.requestreply.PingPongTestPerf
public class PingPongTestPerf
PingPongTestPerf is a full round trip ping test, that has been written with the intention of being scaled up to run many times simultaneously to simluate many clients/producer/connections. A full round trip ping sends a message from a producer to a conumer, then the consumer replies to the message on a temporary queue.
A single run of the test using the default JUnit test runner will result in the sending and timing of the number of pings specified by the test size and time how long it takes for all of these to complete. This test may be scaled up using a suitable JUnit test runner. SeeTKTestRunner
for more
information on how to do this.
The setup/teardown cycle establishes a connection to a broker and sets up a queue to send ping messages to and a
temporary queue for replies. This setup is only established once for all the test repeats, but each test threads
gets its own connection/producer/consumer, this is only re-established if the connection is lost.
The test cycle is: Connects to a queue, creates a temporary queue, creates messages containing a property that
is the name of the temporary queue, fires off many messages on the original queue and waits for them all to come
back on the temporary queue.
Configurable test properties: message size, transacted or not, persistent or not. Broker connection details.
Responsibilities | Collaborations |
---|
Nested Class Summary | |
---|---|
protected static class |
PingPongTestPerf.PerThreadSetup
|
Field Summary | |
---|---|
(package private) ThreadLocal<PingPongTestPerf.PerThreadSetup> |
threadSetup
Thread local to hold the per-thread test setup fields. |
Constructor Summary | |
---|---|
PingPongTestPerf(String name)
|
Method Summary | |
---|---|
static junit.framework.Test |
suite()
Compile all the tests into a test suite. |
void |
testPingPongOk(int numPings)
|
void |
threadSetUp()
Performs test fixture creation on a per thread basis. |
void |
threadTearDown()
Performs test fixture clean |
Methods inherited from class org.apache.qpid.junit.extensions.AsymptoticTestCase |
---|
getN, getTestEndMemory, getTestStartMemory, getTestTime, reset, runTest, setN |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, 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, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface junit.framework.Test |
---|
countTestCases, run |
Field Detail |
---|
ThreadLocal<PingPongTestPerf.PerThreadSetup> threadSetup
Constructor Detail |
---|
public PingPongTestPerf(String name)
Method Detail |
---|
public static junit.framework.Test suite()
public void testPingPongOk(int numPings) throws Exception
Exception
public void threadSetUp()
public void threadTearDown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |