org.openorb.orb.test.dynamic
Class DIITest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.openorb.orb.test.ORBTestCase
              extended by org.openorb.orb.test.dynamic.DIITest
All Implemented Interfaces:
junit.framework.Test

public class DIITest
extends ORBTestCase

A Dynamic Interface Invocation (DII) test case.

Author:
Chris Wood

Constructor Summary
DIITest(java.lang.String name)
          Constructor.
 
Method Summary
static void main(java.lang.String[] args)
          The entry point of this test case.
 void setUp()
          Set up the test case.
 void testAttributeInvocation()
          Test an attribute invocation using the DII.
 void testContextInvocation()
          Test a invocation using the DII with a context and context operations.
 void testDeferredCrossThreadInvocation()
          Test a deferred invocation using the DII.
 void testDeferredInvocation()
          Test a deferred invocation using the DII.
 void testExceptionInvocation()
          Test a simple invocation using the DII with an exception.
 void testMultipleDeferredInvocations()
          Test sending multiple defered requests, waiting for responses to arrive, and recieving each response.
 void testMultipleOnewayInvocation()
          Test sending multiple oneway requests.
 void testOnewayInvocation()
          Test a oneway invocation.
 void testParamInvocation()
          Test a simple invocation using the DII with a return parameter.
 void testPollingInvocation()
          Test a deferred invocation using the DII.
 void testReturnInvocation()
          Test a simple invocation using the DII with a return parameter.
 void testSimpleInvocation()
          Test a simple invocation using the DII.
 
Methods inherited from class org.openorb.orb.test.ORBTestCase
enteringTest, exitingTest, forceMarshal, getORB, restartORB, setUp, tearDown, writeVerboseHex
 
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

DIITest

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

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

setUp

public void setUp()
Set up the test case.

Overrides:
setUp in class ORBTestCase

testSimpleInvocation

public void testSimpleInvocation()
Test a simple invocation using the DII. The request is created with no parameter and no result or exception are expected.


testReturnInvocation

public void testReturnInvocation()
Test a simple invocation using the DII with a return parameter. The request is created with no param and a string result is expected. Trying to invoke the operation using the oneway mechanism throws an exception as expected.


testParamInvocation

public void testParamInvocation()
Test a simple invocation using the DII with a return parameter. The request is created with 2 float parameters. A float result is expected. Typing of the result is checked.


testExceptionInvocation

public void testExceptionInvocation()
                             throws org.omg.CORBA.TypeCodePackage.BadKind
Test a simple invocation using the DII with an exception. The request is created with 2 float parameters. A float result is expected. One invocation is made resulting in throwing an an exception and another one without the exception. This method tests both cases.

Throws:
org.omg.CORBA.TypeCodePackage.BadKind - if any of the test cases fails

testContextInvocation

public void testContextInvocation()
Test a invocation using the DII with a context and context operations. The request is created with a test context that was described in the IDL. Several operations are performed on the context, such as setting its value, creating a child context and finally invoking the contructed request.


testAttributeInvocation

public void testAttributeInvocation()
Test an attribute invocation using the DII. As an attribute was declared in the IDL, the request is created and invoked for the _get_XXX and _set_XXX generated operations. Tests are performed to check good behaviour of these operations.


testOnewayInvocation

public void testOnewayInvocation()
Test a oneway invocation.


testMultipleOnewayInvocation

public void testMultipleOnewayInvocation()
Test sending multiple oneway requests.


testDeferredInvocation

public void testDeferredInvocation()
                            throws org.omg.CORBA.UserException
Test a deferred invocation using the DII. A deferred request may be delayed by the ORB and the result is available later. This test invokes a request as delayed, and then gets the response using the get_response function.

Throws:
org.omg.CORBA.UserException - if any of the test cases fails

testPollingInvocation

public void testPollingInvocation()
                           throws org.omg.CORBA.UserException
Test a deferred invocation using the DII. A deferred request may be delayed by the ORB and the result is available later. This test invokes a request as delayed, polls until a response arrives and then gets the response using the get_response function.

Throws:
org.omg.CORBA.UserException - if any of the test cases fails

testDeferredCrossThreadInvocation

public void testDeferredCrossThreadInvocation()
                                       throws org.omg.CORBA.UserException
Test a deferred invocation using the DII. A deferred request may be delayed by the ORB and the result is available later. This test invokes a request as delayed, and then gets the response using the get_response function in a different thread.

Throws:
org.omg.CORBA.UserException - if any of the test cases fails

testMultipleDeferredInvocations

public void testMultipleDeferredInvocations()
                                     throws org.omg.CORBA.UserException
Test sending multiple defered requests, waiting for responses to arrive, and recieving each response.

Throws:
org.omg.CORBA.UserException - if any of the test cases fails

main

public static void main(java.lang.String[] args)
The entry point of this test case.

Parameters:
args - The command line arguments.