blob: 6f377eb2bd5c56c0ecd1f564ad5030b836ef5f16 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
$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 <shutdown> method on the server to
terminate the processes.
To run (on Unix):
-------
$./server [-s <ior_output_file1> -c <ior_output_file2> -p <profile_id>]
$./client [-s <ior1> -c <ior2> -p <profile_id>] -ORBdebuglevel 1
Options:
--------
Server:
-s <ior_output_file1> Default: test1.ior
Filename for output of IOR for the object that
had ClientProtocolPolicy set on the server.
-c <ior_output_file2> Default: test2.ior
Filename for output of IOR for the object that
did not have ClientProtocolPolicy set on the
server.
-p <profile_id> Default: 0 (IIOP)
Protocol used as a ClientProtocolPolicy value
for one of the server's objects.
Client:
-s <ior_output_file1> Default: file://test1.ior
IOR for the object that had
ClientProtocolPolicy set on the server.
-c <ior_output_file2> Default: file://test2.ior
IOR for the object that did not have
ClientProtocolPolicy set on the server.
-p <profile_id> 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 <IOR:000000000000000d49444c3a546573743a312e30000000000000000012000010200000000116163652e63732e777573746c2e6564750000c62d00000023439e940eb000e405a000000010000000100000000000000010000000100000000040000000000054414f000000000100000014000000000001000100000000000101090000000054414f0200000000004000000116163652e63732e777573746c2e6564750000c62d00000000000000116167573746c2e6564750000c62d00000000000000116163652e63732e777573746c2e656475000000000126163652e646f632e777573746c2e65647500c62d0000000000000002000000240000041000500000014000000000000000154414f00000100000001000054414f00000000d0000102661722f746d702f54414f414141514d614f53580000000000002314010f004e535439e940eb00100000001000000000000000100000001000000000400000000000000080000000054414f00014000000000001000100000000000101090000000054414f020000002400000000000000010722f746d702f54414f414141514d614f535800000000000002000000240000000000000001544000000000000000154414f00000100000001000054414f02000000cc00010200000000116167573746c2e6564750061c62e0000002314010f004e535439e940eb000e405a000000010000000000100000001000000000400000000000000080000000054414f00000000010000001400000000000000101090000000054414f02000000220000000000000001000000116163652e63732e564750000c62e00004f5300000002000000240000000000000001544100050000001400000004f000001000000010000>
Activated object two as <IOR:000000000000000d49444c3a546573743a312e3000000000000000000ea00010200000000116163652e63732e777573746c2e6564750000c62d0000001b439e940eb000e257a000000000000000100000001000000000300000000000000080000000050100000014000000000001000100000000000101090000000054414f0200000076000000000016163652e63732e777573746c2e6564750000c62d00000000000000116163652e63732e777570009c62d0000cb40000000116163652e63732e777573746c2e6564750000c62d00000000000046f632e777573746c2e65647500c62d0000000054414f000000009c00010200000000162f76654414f414141514d614f535800001b0000001b14010f0052535439e940eb000e257a00000000001030000000300000000000000080000000054414f00000000010000001400000000000100001090000000054414f02000000240000000000000001000000162f7661722f746d702f54414ff535800000054414f020000009600010200000000116163652e63732e777573746c2e65647501b14010f0052535439e940eb000e257a00000000000000010000000100000000030000000000054414f000000000100000014000000000001000100000000000101090000000054414f0200000000001000000116163652e63732e777573746c2e6564750063c62e0000>
TAO (25450|1) Loaded default protocol <IIOP_Factory>
TAO (25450|1) Loaded default protocol <UIOP_Factory>
TAO (25450|1) Loaded default protocol <SHMIOP_Factory>
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
|