$Id$ This is a unit test for RTCORBA::ClientProtocolPolicy. Description: --------- This test consists of five mini-tests, each exercising ClientProtocolPolicy in a different configuration: 1. Invoke an operation on the object that had ClientProtocolPolicy set on the server side. Make sure the protocol dictated by the policy is used for communication. 2. Set ORB-level ClientProtocolPolicy override on the client ORB, and invoke an operation on an object that had ClientProtocolPolicy set on the server side. Should receive CORBA::INV_POLICY exception since the policy is set on both client and server sides. 3. Set ORB-level ClientProtocolPolicy override on the client ORB, and invoke an operation on an object that did *not* have ClientProtocolPolicy set on the server side. Make sure the protocol dictated by the policy override is used for communication. 4. Set ClientProtocolPolicy override on the Current level in the client ORB, and invoke an operation on an object that did *not* have ClientProtocolPolicy set on the server. The override value is a sequence of protocols none of which are available in the server ORB. Should receive CORBA::INV_POLICY exception since none of the protocols specified in the policy are available for communication. 5. Set ClientProtocolPolicy override on the Current level in the client ORB, and invoke an operation on an object that did *not* have ClientProtocolPolicy set on the server. The override value is a sequence of two protocols, in which the first protocol isn't available in the server ORB, and the second protocol is available in both client and server ORBs. Make sure the second protocol specified in the override is used for communication. Scenario: The server creates two objects: one with ClientProtocolPolicy set and the other one without the policy being set. The value of the ClientProtocolPolicy is a single protocol specified using server command-line option (see Options section below). The client obtains two object references and uses them to run five tests decribed above. Finally, the client invokes method on the server to terminate the processes. To run (on Unix): ------- $./server [-s -c -p ] $./client [-s -c -p ] -ORBdebuglevel 1 Options: -------- Server: -s Default: test1.ior Filename for output of IOR for the object that had ClientProtocolPolicy set on the server. -c Default: test2.ior Filename for output of IOR for the object that did not have ClientProtocolPolicy set on the server. -p Default: 0 (IIOP) Protocol used as a ClientProtocolPolicy value for one of the server's objects. Client: -s Default: file://test1.ior IOR for the object that had ClientProtocolPolicy set on the server. -c Default: file://test2.ior IOR for the object that did not have ClientProtocolPolicy set on the server. -p Default: 0 (IIOP) Protocol used as a ClientProtocolPolicy value on the client. -ORBdebuglevel 1 Recommended ORB option for the client in order to see which protocols are being used in each mini-test for client-server communication. Expected output: ---------------- Test 1: invocation should succeed using the protocol specified with <-p> option to the server. Tests 2 and 4: should produce INV_POLICY exception. Tests 3 and 5: invocation should succeed using the protocol specified with <-p> option to the client. Below is the expected output from run_test.pl on a Unix platform. See run_test.pl for command-line options used for client and server. NOTE: expected output differs on windows due to UIOP not being available. ********** RTCORBA Client Protocol Policy Unit Test Activated object one as Activated object two as TAO (25450|1) Loaded default protocol TAO (25450|1) Loaded default protocol TAO (25450|1) Loaded default protocol Test 1 TAO (25450|1) Connector::connect - looking for UIOP connection. TAO (25450|1) UIOP connection to server <> on 8 Test method invoked on the sever Test 2 INV_POLICY exception is caught as expected. Test 3 TAO (25450|1) Connector::connect - looking for SHMIOP connection. TAO (25450|1) SHMIOP connection to server <127.0.0.1:50734> on 9 Test method invoked on the sever Test 4 INV_POLICY exception is caught as expected. Test 5 TAO (25450|1) Connector::connect - looking for SHMIOP connection. Test method invoked on the sever Testing over TAO (25450|1) Connector::connect - looking for SHMIOP connection. Server ORB event loop finished