xmlBlaster 2.2.0 API

org.xmlBlaster.test.memoryleak
Class TestThreadLeak

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.xmlBlaster.test.memoryleak.TestThreadLeak
All Implemented Interfaces:
junit.framework.Test, I_Callback

public class TestThreadLeak
extends junit.framework.TestCase
implements I_Callback

This does a twofold test by creating a number of connection, an almost infinite number of times. It tests two stuff: 1. if the client side is leaking threads. 2. if Jacorb contains a locking bug.

Version:
$Revision: 1.4 $
Author:
Peter Antman

Nested Class Summary
(package private)  class TestThreadLeak.ConnectorWorker
          Connect to XmlBlaster and disconnect after timeout milis.
 
Field Summary
private  java.util.ArrayList connections
           
private  long cttl
          Time a connection should live, before beeing taken down
private  java.lang.String fileName
           
private  Global glob
           
private static java.util.logging.Logger log
           
private  int maxThreadDiff
           
private static java.lang.String ME
           
private  int noConnections
           
private  boolean noError
           
private  java.lang.String osName
           
private  java.lang.String pid
           
 
Constructor Summary
TestThreadLeak(Global glob, java.lang.String testName)
           
 
Method Summary
(package private)  void dumpThreadStack()
           
(package private)  void handleLock(TestThreadLeak.ConnectorWorker wr)
           
static void main(java.lang.String[] args)
          Invoke:
protected  void setUp()
          Sets up the fixture.
static junit.framework.Test suite()
          Method is used by TestRunner to load these tests
 void testThreadLeakage()
           
 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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ME

private static java.lang.String ME

glob

private final Global glob

log

private static java.util.logging.Logger log

fileName

private java.lang.String fileName

noConnections

private int noConnections

noError

private boolean noError

connections

private java.util.ArrayList connections

maxThreadDiff

private int maxThreadDiff

pid

private java.lang.String pid

osName

private java.lang.String osName

cttl

private long cttl
Time a connection should live, before beeing taken down

Constructor Detail

TestThreadLeak

public TestThreadLeak(Global glob,
                      java.lang.String testName)
               throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Sets up the fixture.

Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

dumpThreadStack

void dumpThreadStack()
               throws java.lang.Exception
Throws:
java.lang.Exception

handleLock

void handleLock(TestThreadLeak.ConnectorWorker wr)
          throws java.lang.Exception
Throws:
java.lang.Exception

testThreadLeakage

public void testThreadLeakage()
                       throws java.lang.Exception
Throws:
java.lang.Exception

update

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

Specified by:
update in interface I_Callback
Parameters:
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 name
content - The arrived message content. This is your payload.
See Also:
I_Callback.update(String, UpdateKey, byte[], UpdateQos)

suite

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

Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Invoke:
   java org.xmlBlaster.test.mime.TestXPathSubscribeFilter
   java -Djava.compiler= junit.textui.TestRunner -noloading
org.xmlBlaster.test.mime.TestXPathSubscribeFilter
 

Throws:
java.lang.Exception

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.