org.openorb.orb.test
Class ORBTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.openorb.orb.test.ORBTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
BiDirTest, BOATest, CodecTest, ComplexTest, DIITest, DSITest, DynamicScenarioTest, FragmentedMessageTest, FWDTest, PITest, POATest, PrimitiveTest, ValuetypeTest, ValuetypeTruncatableTest

public abstract class ORBTestCase
extends junit.framework.TestCase

Skeleton orb test case to use when testing an orb component. The pre_init and post init functions deal with creating and destroying orb instances for the client and server ends.

Author:
Chris Wood

Constructor Summary
ORBTestCase(java.lang.String name)
          Constructor.
 
Method Summary
 long enteringTest(java.lang.String test)
          Show the message upon entering the test.
 long exitingTest(java.lang.String test)
          Show the message upon test exit.
 org.omg.CORBA.Object forceMarshal(org.omg.CORBA.Object obj)
          Sets local invoke policy on target.
 org.omg.CORBA.ORB getORB()
          Get the server side orb.
protected  org.omg.CORBA.ORB restartORB()
          Restarts the server side orb.
protected  void setUp()
          This method is called prior to calling run and basically starts up a server and client orb, and spawns a thread for the server orb to run with.
protected  void setUp(java.util.Properties props)
          Override setUp and call this method with alternative properties to startup an orb with alternative parameters.
protected  void tearDown()
          This method is called after calling run.
static void writeVerboseHex(java.io.OutputStream stream, byte[] buf)
          Write buffer as hex to given stream.
 
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, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ORBTestCase

public ORBTestCase(java.lang.String name)
Constructor.

Parameters:
name - The name of the test case.
Method Detail

setUp

protected void setUp()
This method is called prior to calling run and basically starts up a server and client orb, and spawns a thread for the server orb to run with.

Overrides:
setUp in class junit.framework.TestCase

setUp

protected void setUp(java.util.Properties props)
Override setUp and call this method with alternative properties to startup an orb with alternative parameters.

Parameters:
props - The properties for this test case.

tearDown

protected void tearDown()
This method is called after calling run. It shuts down the server and client orbs.

Overrides:
tearDown in class junit.framework.TestCase

restartORB

protected org.omg.CORBA.ORB restartORB()
Restarts the server side orb.

Returns:
The new ORB instance.

getORB

public org.omg.CORBA.ORB getORB()
Get the server side orb.

Returns:
The server's ORB instance.

forceMarshal

public org.omg.CORBA.Object forceMarshal(org.omg.CORBA.Object obj)
                                  throws org.omg.CORBA.PolicyError
Sets local invoke policy on target.

Parameters:
obj - The object for which to set the forceMarshal policy.
Returns:
The object with the forceMarshal policy activated.
Throws:
org.omg.CORBA.PolicyError - When an error occurs.

writeVerboseHex

public static void writeVerboseHex(java.io.OutputStream stream,
                                   byte[] buf)
                            throws java.io.IOException
Write buffer as hex to given stream.

Parameters:
stream - The stream to write the buffer to.
buf - The buffer to write to the stream
Throws:
java.io.IOException - When an error occurs.

enteringTest

public long enteringTest(java.lang.String test)
Show the message upon entering the test.

Parameters:
test - The name of the test case.
Returns:
The start time.

exitingTest

public long exitingTest(java.lang.String test)
Show the message upon test exit.

Parameters:
test - The name of the test case.
Returns:
The execution time in msec.