blob: a3e9c7abf59c6ed6f7ce3d80a86024bad3ae3d15 (
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
|
// **********************************************************************
//
// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
package test.Ice.seqMapping;
import test.Ice.seqMapping.Test.*;
import test.Ice.seqMapping.Serialize.*;
class Twoways
{
private static void
test(boolean b)
{
if(!b)
{
throw new RuntimeException();
}
}
static void
twoways(MyClassPrx p)
{
{
Small i = null;
Ice.Holder<Small> o = new Ice.Holder<Small>();
Small r;
r = p.opSerialSmallJava(i, o);
test(o.value == null);
test(r == null);
}
{
Small i = new Small();
i.i = 99;
Ice.Holder<Small> o = new Ice.Holder<Small>();
Small r;
try
{
r = p.opSerialSmallJava(i, o);
test(o.value.i == 99);
test(r.i == 99);
}
catch(Ice.OperationNotExistException ex)
{
// OK, talking to non-Java server.
}
}
{
Large i = new Large();
i.d1 = 1.0;
i.d2 = 2.0;
i.d3 = 3.0;
i.d4 = 4.0;
i.d5 = 5.0;
i.d6 = 6.0;
i.d7 = 7.0;
i.d8 = 8.0;
i.d9 = 9.0;
i.d10 = 10.0;
Ice.Holder<Large> o = new Ice.Holder<Large>();
Large r;
try
{
r = p.opSerialLargeJava(i, o);
test(o.value.d1 == 1.0);
test(o.value.d2 == 2.0);
test(o.value.d3 == 3.0);
test(o.value.d4 == 4.0);
test(o.value.d5 == 5.0);
test(o.value.d6 == 6.0);
test(o.value.d7 == 7.0);
test(o.value.d8 == 8.0);
test(o.value.d9 == 9.0);
test(o.value.d10 == 10.0);
test(r.d1 == 1.0);
test(r.d2 == 2.0);
test(r.d3 == 3.0);
test(r.d4 == 4.0);
test(r.d5 == 5.0);
test(r.d6 == 6.0);
test(r.d7 == 7.0);
test(r.d8 == 8.0);
test(r.d9 == 9.0);
test(r.d10 == 10.0);
}
catch(Ice.OperationNotExistException ex)
{
// OK, talking to non-Java server.
}
}
{
Struct i = new Struct();
i.o = null;
i.o2 = i;
i.s = null;
i.s2 = "Hello";
Ice.Holder<Struct> o = new Ice.Holder<Struct>();
Struct r;
try
{
r = p.opSerialStructJava(i, o);
test(o.value.o == null);
test(o.value.o2 != null);
test(((Struct)(o.value.o2)).o == null);
test(((Struct)(o.value.o2)).o2 == o.value.o2);
test(o.value.s == null);
test(o.value.s2.equals("Hello"));
test(r.o == null);
test(r.o2 != null);
test(((Struct)(r.o2)).o == null);
test(((Struct)(r.o2)).o2 == r.o2);
test(r.s == null);
test(r.s2.equals("Hello"));
}
catch(Ice.OperationNotExistException ex)
{
// OK, talking to non-Java server.
}
}
}
}
|