xmlBlaster 2.2.0 API

org.xmlBlaster.test.qos
Class TestCorbaThreads

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.xmlBlaster.test.qos.TestCorbaThreads
All Implemented Interfaces:
junit.framework.Test, I_Callback, I_CallbackRaw, I_CallbackExtended

public class TestCorbaThreads
extends junit.framework.TestCase
implements I_CallbackExtended

This client tests the number of threads opened and cleaned up by JacORB corba library.

Invoke examples:

    java junit.textui.TestRunner -noloading org.xmlBlaster.test.qos.TestCorbaThreads

    java junit.swingui.TestRunner -noloading org.xmlBlaster.test.qos.TestCorbaThreads
 


Field Summary
private  java.lang.String[] args
           
private  I_CallbackServer cbServer
           
private  CorbaConnection corbaConnection
           
private  Global glob
           
private static java.util.logging.Logger log
           
private  java.lang.String loginName
           
private  EmbeddedXmlBlaster serverThread
           
 
Constructor Summary
TestCorbaThreads(Global glob, java.lang.String testName)
          Constructs the TestCorbaThreads object.
 
Method Summary
private  void login()
          Login.
private  void logout()
          cleaning up ....
 void lostConnection(XmlBlasterException xmlBlasterException)
          For example called by socket layer on EOF
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.qos.TestCorbaThreads
protected  void setUp()
           
static junit.framework.Test suite()
          Method is used by TestRunner to load these tests
protected  void tearDown()
           
 void testJacORB()
          Test ORB and POA creation and orb.shutdown()
 void testThread()
          TEST: Send a message to one destination

The returned subscribeOid is checked

 java.lang.String[] update(java.lang.String cbSessionId, MsgUnitRaw[] msgUnitArr)
          This is the callback method invoked from xmlBlaster server informing the client in an asynchronous mode about a new message.
 java.lang.String update(java.lang.String cbSessionId, java.lang.String updateKeyLiteral, byte[] content, java.lang.String updateQosLiteral)
          This is the callback method invoked when using certain callback protocols (for example xml-rpc) which informs the client in an asynchronous mode about a new message.
 java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos)
          These update() methods are enforced by I_CallbackExtended.
 void updateOneway(java.lang.String cbSessionId, MsgUnitRaw[] msgUnitArr)
          The oneway variant without a return value or exception
 void updateOneway(java.lang.String cbSessionId, java.lang.String updateKeyLiteral, byte[] content, java.lang.String updateQosLiteral)
          The oneway variant without a return value or exception
 
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 Global glob

log

private static java.util.logging.Logger log

serverThread

private EmbeddedXmlBlaster serverThread

loginName

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

corbaConnection

private CorbaConnection corbaConnection

cbServer

private I_CallbackServer cbServer

args

private java.lang.String[] args
Constructor Detail

TestCorbaThreads

public TestCorbaThreads(Global glob,
                        java.lang.String testName)
Constructs the TestCorbaThreads object.

Parameters:
testName - The name used in the test suite
Method Detail

testJacORB

public void testJacORB()
Test ORB and POA creation and orb.shutdown()


setUp

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

login

private void login()
Login.

Creates a CORBA connection and does a login.
- One connection for the sender client
- One connection for the receiver client - One connection for the receiver2 client


tearDown

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

logout

private void logout()
cleaning up .... logout


testThread

public void testThread()
TEST: Send a message to one destination

The returned subscribeOid is checked


update

public java.lang.String update(java.lang.String cbSessionId,
                               UpdateKey updateKey,
                               byte[] content,
                               UpdateQos updateQos)
These update() methods are enforced by I_CallbackExtended.

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_XmlBlasterAccess

update

public java.lang.String update(java.lang.String cbSessionId,
                               java.lang.String updateKeyLiteral,
                               byte[] content,
                               java.lang.String updateQosLiteral)
Description copied from interface: I_CallbackExtended
This is the callback method invoked when using certain callback protocols (for example xml-rpc) which informs the client in an asynchronous mode about a new message.

You can implement this interface in your client. Note that when doing so, you need to implement all update() methods defined (remember the one defined in I_Callback/I_CallbackRaw).

The implementation of the update method with the signature specified in this interface must parse the string literals passed in the argument list and call the other update method (the one with the signature defined in I_Callback).

Specified by:
update in interface I_CallbackExtended
Parameters:
cbSessionId - The session ID specified by the client which registered the callback
updateKeyLiteral - The arrived key (as an xml-string)
content - The arrived message content
updateQosLiteral - Quality of Service of the MsgUnitRaw (as an xml-string)
See Also:
I_Callback, AbstractCallbackExtended

update

public java.lang.String[] update(java.lang.String cbSessionId,
                                 MsgUnitRaw[] msgUnitArr)
Description copied from interface: I_CallbackRaw
This is the callback method invoked from xmlBlaster server informing the client in an asynchronous mode about a new message.

Specified by:
update in interface I_CallbackRaw
msgUnitArr - Array of MsgUnitRaw, containing xmlKey,content,qos
Returns:
For every message a return QoS

updateOneway

public void updateOneway(java.lang.String cbSessionId,
                         java.lang.String updateKeyLiteral,
                         byte[] content,
                         java.lang.String updateQosLiteral)
Description copied from interface: I_CallbackExtended
The oneway variant without a return value or exception

Specified by:
updateOneway in interface I_CallbackExtended

updateOneway

public void updateOneway(java.lang.String cbSessionId,
                         MsgUnitRaw[] msgUnitArr)
Description copied from interface: I_CallbackRaw
The oneway variant without a return value or exception

Specified by:
updateOneway in interface I_CallbackRaw

lostConnection

public void lostConnection(XmlBlasterException xmlBlasterException)
Description copied from interface: I_CallbackExtended
For example called by socket layer on EOF

Specified by:
lostConnection in interface I_CallbackExtended

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.qos.TestCorbaThreads

Invoke: java org.xmlBlaster.test.qos.TestCorbaThreads


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.