bump product version to 4.1.6.2
[LibreOffice.git] / bridges / test / java_remote / MethodIdTest.java
blob537cb66965f14e31d2a59085956914017226a441
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package test.java_remote;
21 import com.sun.star.bridge.XInstanceProvider;
22 import com.sun.star.lib.uno.typeinfo.MethodTypeInfo;
23 import com.sun.star.lib.uno.typeinfo.TypeInfo;
24 import com.sun.star.uno.UnoRuntime;
25 import com.sun.star.uno.XComponentContext;
26 import com.sun.star.uno.XInterface;
27 import complexlib.ComplexTestCase;
28 import test.lib.TestBed;
30 /**
31 * Test case for bug #111153#.
33 * <P>Bug #111153# "jni_uno bridge sometimes fails to map objects
34 * correctly" describes that mapping a local object out with type XDerived and
35 * then mapping it back in with type XBase produces a proxy, instead of
36 * short-cutting to the local object.</P>
38 public final class MethodIdTest extends ComplexTestCase {
39 public String[] getTestMethodNames() {
40 return new String[] { "test" };
43 public void test() throws Exception {
44 assure(
45 "test",
46 new TestBed().execute(new Provider(), false, Client.class, 0));
49 public static final class Client extends TestBed.Client {
50 public static void main(String[] args) {
51 new Client().execute();
54 protected boolean run(XComponentContext context) throws Throwable {
55 XTest t = UnoRuntime.queryInterface(
56 XTest.class, getBridge(context).getInstance("Test"));
57 return t.f129() == 129;
61 private static final class Provider implements XInstanceProvider {
62 public Object getInstance(String instanceName) {
63 return new XTest() {
64 public int f0() { return 0; }
65 public int f1() { return 1; }
66 public int f2() { return 2; }
67 public int f3() { return 3; }
68 public int f4() { return 4; }
69 public int f5() { return 5; }
70 public int f6() { return 6; }
71 public int f7() { return 7; }
72 public int f8() { return 8; }
73 public int f9() { return 9; }
74 public int f10() { return 10; }
75 public int f11() { return 11; }
76 public int f12() { return 12; }
77 public int f13() { return 13; }
78 public int f14() { return 14; }
79 public int f15() { return 15; }
80 public int f16() { return 16; }
81 public int f17() { return 17; }
82 public int f18() { return 18; }
83 public int f19() { return 19; }
84 public int f20() { return 20; }
85 public int f21() { return 21; }
86 public int f22() { return 22; }
87 public int f23() { return 23; }
88 public int f24() { return 24; }
89 public int f25() { return 25; }
90 public int f26() { return 26; }
91 public int f27() { return 27; }
92 public int f28() { return 28; }
93 public int f29() { return 29; }
94 public int f30() { return 30; }
95 public int f31() { return 31; }
96 public int f32() { return 32; }
97 public int f33() { return 33; }
98 public int f34() { return 34; }
99 public int f35() { return 35; }
100 public int f36() { return 36; }
101 public int f37() { return 37; }
102 public int f38() { return 38; }
103 public int f39() { return 39; }
104 public int f40() { return 40; }
105 public int f41() { return 41; }
106 public int f42() { return 42; }
107 public int f43() { return 43; }
108 public int f44() { return 44; }
109 public int f45() { return 45; }
110 public int f46() { return 46; }
111 public int f47() { return 47; }
112 public int f48() { return 48; }
113 public int f49() { return 49; }
114 public int f50() { return 50; }
115 public int f51() { return 51; }
116 public int f52() { return 52; }
117 public int f53() { return 53; }
118 public int f54() { return 54; }
119 public int f55() { return 55; }
120 public int f56() { return 56; }
121 public int f57() { return 57; }
122 public int f58() { return 58; }
123 public int f59() { return 59; }
124 public int f60() { return 60; }
125 public int f61() { return 61; }
126 public int f62() { return 62; }
127 public int f63() { return 63; }
128 public int f64() { return 64; }
129 public int f65() { return 65; }
130 public int f66() { return 66; }
131 public int f67() { return 67; }
132 public int f68() { return 68; }
133 public int f69() { return 69; }
134 public int f70() { return 70; }
135 public int f71() { return 71; }
136 public int f72() { return 72; }
137 public int f73() { return 73; }
138 public int f74() { return 74; }
139 public int f75() { return 75; }
140 public int f76() { return 76; }
141 public int f77() { return 77; }
142 public int f78() { return 78; }
143 public int f79() { return 79; }
144 public int f80() { return 80; }
145 public int f81() { return 81; }
146 public int f82() { return 82; }
147 public int f83() { return 83; }
148 public int f84() { return 84; }
149 public int f85() { return 85; }
150 public int f86() { return 86; }
151 public int f87() { return 87; }
152 public int f88() { return 88; }
153 public int f89() { return 89; }
154 public int f90() { return 90; }
155 public int f91() { return 91; }
156 public int f92() { return 92; }
157 public int f93() { return 93; }
158 public int f94() { return 94; }
159 public int f95() { return 95; }
160 public int f96() { return 96; }
161 public int f97() { return 97; }
162 public int f98() { return 98; }
163 public int f99() { return 99; }
164 public int f100() { return 100; }
165 public int f101() { return 101; }
166 public int f102() { return 102; }
167 public int f103() { return 103; }
168 public int f104() { return 104; }
169 public int f105() { return 105; }
170 public int f106() { return 106; }
171 public int f107() { return 107; }
172 public int f108() { return 108; }
173 public int f109() { return 109; }
174 public int f110() { return 110; }
175 public int f111() { return 111; }
176 public int f112() { return 112; }
177 public int f113() { return 113; }
178 public int f114() { return 114; }
179 public int f115() { return 115; }
180 public int f116() { return 116; }
181 public int f117() { return 117; }
182 public int f118() { return 118; }
183 public int f119() { return 119; }
184 public int f120() { return 120; }
185 public int f121() { return 121; }
186 public int f122() { return 122; }
187 public int f123() { return 123; }
188 public int f124() { return 124; }
189 public int f125() { return 125; }
190 public int f126() { return 126; }
191 public int f127() { return 127; }
192 public int f128() { return 128; }
193 public int f129() { return 129; }
194 public int f130() { return 130; }
199 public interface XTest extends XInterface {
200 int f0();
201 int f1();
202 int f2();
203 int f3();
204 int f4();
205 int f5();
206 int f6();
207 int f7();
208 int f8();
209 int f9();
210 int f10();
211 int f11();
212 int f12();
213 int f13();
214 int f14();
215 int f15();
216 int f16();
217 int f17();
218 int f18();
219 int f19();
220 int f20();
221 int f21();
222 int f22();
223 int f23();
224 int f24();
225 int f25();
226 int f26();
227 int f27();
228 int f28();
229 int f29();
230 int f30();
231 int f31();
232 int f32();
233 int f33();
234 int f34();
235 int f35();
236 int f36();
237 int f37();
238 int f38();
239 int f39();
240 int f40();
241 int f41();
242 int f42();
243 int f43();
244 int f44();
245 int f45();
246 int f46();
247 int f47();
248 int f48();
249 int f49();
250 int f50();
251 int f51();
252 int f52();
253 int f53();
254 int f54();
255 int f55();
256 int f56();
257 int f57();
258 int f58();
259 int f59();
260 int f60();
261 int f61();
262 int f62();
263 int f63();
264 int f64();
265 int f65();
266 int f66();
267 int f67();
268 int f68();
269 int f69();
270 int f70();
271 int f71();
272 int f72();
273 int f73();
274 int f74();
275 int f75();
276 int f76();
277 int f77();
278 int f78();
279 int f79();
280 int f80();
281 int f81();
282 int f82();
283 int f83();
284 int f84();
285 int f85();
286 int f86();
287 int f87();
288 int f88();
289 int f89();
290 int f90();
291 int f91();
292 int f92();
293 int f93();
294 int f94();
295 int f95();
296 int f96();
297 int f97();
298 int f98();
299 int f99();
300 int f100();
301 int f101();
302 int f102();
303 int f103();
304 int f104();
305 int f105();
306 int f106();
307 int f107();
308 int f108();
309 int f109();
310 int f110();
311 int f111();
312 int f112();
313 int f113();
314 int f114();
315 int f115();
316 int f116();
317 int f117();
318 int f118();
319 int f119();
320 int f120();
321 int f121();
322 int f122();
323 int f123();
324 int f124();
325 int f125();
326 int f126();
327 int f127();
328 int f128();
329 int f129();
330 int f130();
332 TypeInfo[] UNOTYPEINFO = { new MethodTypeInfo("f0", 0, 0),
333 new MethodTypeInfo("f1", 1, 0),
334 new MethodTypeInfo("f2", 2, 0),
335 new MethodTypeInfo("f3", 3, 0),
336 new MethodTypeInfo("f4", 4, 0),
337 new MethodTypeInfo("f5", 5, 0),
338 new MethodTypeInfo("f6", 6, 0),
339 new MethodTypeInfo("f7", 7, 0),
340 new MethodTypeInfo("f8", 8, 0),
341 new MethodTypeInfo("f9", 9, 0),
342 new MethodTypeInfo("f10", 10, 0),
343 new MethodTypeInfo("f11", 11, 0),
344 new MethodTypeInfo("f12", 12, 0),
345 new MethodTypeInfo("f13", 13, 0),
346 new MethodTypeInfo("f14", 14, 0),
347 new MethodTypeInfo("f15", 15, 0),
348 new MethodTypeInfo("f16", 16, 0),
349 new MethodTypeInfo("f17", 17, 0),
350 new MethodTypeInfo("f18", 18, 0),
351 new MethodTypeInfo("f19", 19, 0),
352 new MethodTypeInfo("f20", 20, 0),
353 new MethodTypeInfo("f21", 21, 0),
354 new MethodTypeInfo("f22", 22, 0),
355 new MethodTypeInfo("f23", 23, 0),
356 new MethodTypeInfo("f24", 24, 0),
357 new MethodTypeInfo("f25", 25, 0),
358 new MethodTypeInfo("f26", 26, 0),
359 new MethodTypeInfo("f27", 27, 0),
360 new MethodTypeInfo("f28", 28, 0),
361 new MethodTypeInfo("f29", 29, 0),
362 new MethodTypeInfo("f30", 30, 0),
363 new MethodTypeInfo("f31", 31, 0),
364 new MethodTypeInfo("f32", 32, 0),
365 new MethodTypeInfo("f33", 33, 0),
366 new MethodTypeInfo("f34", 34, 0),
367 new MethodTypeInfo("f35", 35, 0),
368 new MethodTypeInfo("f36", 36, 0),
369 new MethodTypeInfo("f37", 37, 0),
370 new MethodTypeInfo("f38", 38, 0),
371 new MethodTypeInfo("f39", 39, 0),
372 new MethodTypeInfo("f40", 40, 0),
373 new MethodTypeInfo("f41", 41, 0),
374 new MethodTypeInfo("f42", 42, 0),
375 new MethodTypeInfo("f43", 43, 0),
376 new MethodTypeInfo("f44", 44, 0),
377 new MethodTypeInfo("f45", 45, 0),
378 new MethodTypeInfo("f46", 46, 0),
379 new MethodTypeInfo("f47", 47, 0),
380 new MethodTypeInfo("f48", 48, 0),
381 new MethodTypeInfo("f49", 49, 0),
382 new MethodTypeInfo("f50", 50, 0),
383 new MethodTypeInfo("f51", 51, 0),
384 new MethodTypeInfo("f52", 52, 0),
385 new MethodTypeInfo("f53", 53, 0),
386 new MethodTypeInfo("f54", 54, 0),
387 new MethodTypeInfo("f55", 55, 0),
388 new MethodTypeInfo("f56", 56, 0),
389 new MethodTypeInfo("f57", 57, 0),
390 new MethodTypeInfo("f58", 58, 0),
391 new MethodTypeInfo("f59", 59, 0),
392 new MethodTypeInfo("f60", 60, 0),
393 new MethodTypeInfo("f61", 61, 0),
394 new MethodTypeInfo("f62", 62, 0),
395 new MethodTypeInfo("f63", 63, 0),
396 new MethodTypeInfo("f64", 64, 0),
397 new MethodTypeInfo("f65", 65, 0),
398 new MethodTypeInfo("f66", 66, 0),
399 new MethodTypeInfo("f67", 67, 0),
400 new MethodTypeInfo("f68", 68, 0),
401 new MethodTypeInfo("f69", 69, 0),
402 new MethodTypeInfo("f70", 70, 0),
403 new MethodTypeInfo("f71", 71, 0),
404 new MethodTypeInfo("f72", 72, 0),
405 new MethodTypeInfo("f73", 73, 0),
406 new MethodTypeInfo("f74", 74, 0),
407 new MethodTypeInfo("f75", 75, 0),
408 new MethodTypeInfo("f76", 76, 0),
409 new MethodTypeInfo("f77", 77, 0),
410 new MethodTypeInfo("f78", 78, 0),
411 new MethodTypeInfo("f79", 79, 0),
412 new MethodTypeInfo("f80", 80, 0),
413 new MethodTypeInfo("f81", 81, 0),
414 new MethodTypeInfo("f82", 82, 0),
415 new MethodTypeInfo("f83", 83, 0),
416 new MethodTypeInfo("f84", 84, 0),
417 new MethodTypeInfo("f85", 85, 0),
418 new MethodTypeInfo("f86", 86, 0),
419 new MethodTypeInfo("f87", 87, 0),
420 new MethodTypeInfo("f88", 88, 0),
421 new MethodTypeInfo("f89", 89, 0),
422 new MethodTypeInfo("f90", 90, 0),
423 new MethodTypeInfo("f91", 91, 0),
424 new MethodTypeInfo("f92", 92, 0),
425 new MethodTypeInfo("f93", 93, 0),
426 new MethodTypeInfo("f94", 94, 0),
427 new MethodTypeInfo("f95", 95, 0),
428 new MethodTypeInfo("f96", 96, 0),
429 new MethodTypeInfo("f97", 97, 0),
430 new MethodTypeInfo("f98", 98, 0),
431 new MethodTypeInfo("f99", 99, 0),
432 new MethodTypeInfo("f100", 100, 0),
433 new MethodTypeInfo("f101", 101, 0),
434 new MethodTypeInfo("f102", 102, 0),
435 new MethodTypeInfo("f103", 103, 0),
436 new MethodTypeInfo("f104", 104, 0),
437 new MethodTypeInfo("f105", 105, 0),
438 new MethodTypeInfo("f106", 106, 0),
439 new MethodTypeInfo("f107", 107, 0),
440 new MethodTypeInfo("f108", 108, 0),
441 new MethodTypeInfo("f109", 109, 0),
442 new MethodTypeInfo("f110", 110, 0),
443 new MethodTypeInfo("f111", 111, 0),
444 new MethodTypeInfo("f112", 112, 0),
445 new MethodTypeInfo("f113", 113, 0),
446 new MethodTypeInfo("f114", 114, 0),
447 new MethodTypeInfo("f115", 115, 0),
448 new MethodTypeInfo("f116", 116, 0),
449 new MethodTypeInfo("f117", 117, 0),
450 new MethodTypeInfo("f118", 118, 0),
451 new MethodTypeInfo("f119", 119, 0),
452 new MethodTypeInfo("f120", 120, 0),
453 new MethodTypeInfo("f121", 121, 0),
454 new MethodTypeInfo("f122", 122, 0),
455 new MethodTypeInfo("f123", 123, 0),
456 new MethodTypeInfo("f124", 124, 0),
457 new MethodTypeInfo("f125", 125, 0),
458 new MethodTypeInfo("f126", 126, 0),
459 new MethodTypeInfo("f127", 127, 0),
460 new MethodTypeInfo("f128", 128, 0),
461 new MethodTypeInfo("f129", 129, 0),
462 new MethodTypeInfo("f130", 130, 0) };