1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: TestAny.java,v $
10 * $Revision: 1.5.20.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 package test
.java_uno
.anytest
;
33 import com
.sun
.star
.uno
.Any
;
34 import com
.sun
.star
.uno
.Enum
;
35 import com
.sun
.star
.uno
.Type
;
36 import com
.sun
.star
.uno
.TypeClass
;
37 import com
.sun
.star
.uno
.XInterface
;
38 import java
.lang
.reflect
.Array
;
41 public static boolean test(XTransport transport
, boolean createTypes
) {
42 boolean success
= true;
44 // Sanity check for com.sun.star.uno.Type:
45 success
&= testType(void.class, TypeClass
.VOID
, "void");
46 success
&= testType(boolean.class, TypeClass
.BOOLEAN
, "boolean");
47 success
&= testType(byte.class, TypeClass
.BYTE
, "byte");
48 success
&= testType(short.class, TypeClass
.SHORT
, "short");
49 success
&= testType(int.class, TypeClass
.LONG
, "long");
50 success
&= testType(long.class, TypeClass
.HYPER
, "hyper");
51 success
&= testType(float.class, TypeClass
.FLOAT
, "float");
52 success
&= testType(double.class, TypeClass
.DOUBLE
, "double");
53 success
&= testType(char.class, TypeClass
.CHAR
, "char");
54 success
&= testType(String
.class, TypeClass
.STRING
, "string");
55 success
&= testType(Type
.class, TypeClass
.TYPE
, "type");
56 success
&= testType(Any
.class, TypeClass
.ANY
, "any");
57 success
&= testType(boolean[].class, TypeClass
.SEQUENCE
, "[]boolean");
58 success
&= testType(byte[].class, TypeClass
.SEQUENCE
, "[]byte");
59 success
&= testType(short[].class, TypeClass
.SEQUENCE
, "[]short");
60 success
&= testType(int[].class, TypeClass
.SEQUENCE
, "[]long");
61 success
&= testType(long[].class, TypeClass
.SEQUENCE
, "[]hyper");
62 success
&= testType(float[].class, TypeClass
.SEQUENCE
, "[]float");
63 success
&= testType(double[].class, TypeClass
.SEQUENCE
, "[]double");
64 success
&= testType(char[].class, TypeClass
.SEQUENCE
, "[]char");
65 success
&= testType(String
[].class, TypeClass
.SEQUENCE
, "[]string");
66 success
&= testType(Type
[].class, TypeClass
.SEQUENCE
, "[]type");
67 success
&= testType(Any
[].class, TypeClass
.SEQUENCE
, "[]any");
68 success
&= testType(Enum1
[].class, TypeClass
.SEQUENCE
,
69 "[]" + Enum1
.class.getName());
70 success
&= testType(BaseStruct
[].class, TypeClass
.SEQUENCE
,
71 "[]" + BaseStruct
.class.getName());
72 success
&= testType(DerivedStruct
[].class, TypeClass
.SEQUENCE
,
73 "[]" + DerivedStruct
.class.getName());
74 success
&= testType(XInterface
[].class, TypeClass
.SEQUENCE
,
75 "[]" + XInterface
.class.getName());
76 success
&= testType(BaseInterface
[].class, TypeClass
.SEQUENCE
,
77 "[]" + BaseInterface
.class.getName());
78 success
&= testType(DerivedInterface
[].class, TypeClass
.SEQUENCE
,
79 "[]" + DerivedInterface
.class.getName());
80 success
&= testType(boolean[][].class, TypeClass
.SEQUENCE
,
82 success
&= testType(byte[][].class, TypeClass
.SEQUENCE
, "[][]byte");
83 success
&= testType(short[][].class, TypeClass
.SEQUENCE
, "[][]short");
84 success
&= testType(int[][].class, TypeClass
.SEQUENCE
, "[][]long");
85 success
&= testType(long[][].class, TypeClass
.SEQUENCE
, "[][]hyper");
86 success
&= testType(float[][].class, TypeClass
.SEQUENCE
, "[][]float");
87 success
&= testType(double[][].class, TypeClass
.SEQUENCE
, "[][]double");
88 success
&= testType(char[][].class, TypeClass
.SEQUENCE
, "[][]char");
89 success
&= testType(String
[][].class, TypeClass
.SEQUENCE
, "[][]string");
90 success
&= testType(Type
[][].class, TypeClass
.SEQUENCE
, "[][]type");
91 success
&= testType(Any
[][].class, TypeClass
.SEQUENCE
, "[][]any");
92 success
&= testType(Enum1
[][].class, TypeClass
.SEQUENCE
,
93 "[][]" + Enum1
.class.getName());
94 success
&= testType(BaseStruct
[][].class, TypeClass
.SEQUENCE
,
95 "[][]" + BaseStruct
.class.getName());
96 success
&= testType(DerivedStruct
[][].class, TypeClass
.SEQUENCE
,
97 "[][]" + DerivedStruct
.class.getName());
98 success
&= testType(XInterface
[][].class, TypeClass
.SEQUENCE
,
99 "[][]" + XInterface
.class.getName());
100 success
&= testType(BaseInterface
[][].class, TypeClass
.SEQUENCE
,
101 "[][]" + BaseInterface
.class.getName());
102 success
&= testType(DerivedInterface
[][].class, TypeClass
.SEQUENCE
,
103 "[][]" + DerivedInterface
.class.getName());
104 success
&= testType(Enum1
.class, TypeClass
.ENUM
, Enum1
.class.getName());
105 success
&= testType(BaseStruct
.class, TypeClass
.STRUCT
,
106 BaseStruct
.class.getName());
107 success
&= testType(DerivedStruct
.class, TypeClass
.STRUCT
,
108 DerivedStruct
.class.getName());
109 success
&= testType(com
.sun
.star
.uno
.Exception
.class,
111 com
.sun
.star
.uno
.Exception
.class.getName());
112 success
&= testType(com
.sun
.star
.uno
.RuntimeException
.class,
114 com
.sun
.star
.uno
.RuntimeException
.class.getName());
115 success
&= testType(XInterface
.class, TypeClass
.INTERFACE
,
116 XInterface
.class.getName());
117 success
&= testType(BaseInterface
.class, TypeClass
.INTERFACE
,
118 BaseInterface
.class.getName());
119 success
&= testType(DerivedInterface
.class, TypeClass
.INTERFACE
,
120 DerivedInterface
.class.getName());
123 success
&= testMapAny(transport
, Any
.VOID
, new CompareBoxed());
126 success
&= testMapAny(transport
, Boolean
.FALSE
, new CompareBoxed());
127 success
&= testMapAny(transport
, Boolean
.TRUE
, new CompareBoxed());
128 success
&= testMapAny(transport
,
129 new Any(Type
.BOOLEAN
, Boolean
.FALSE
),
130 new CompareUnboxed());
131 success
&= testMapAny(transport
,
132 new Any(Type
.BOOLEAN
, Boolean
.TRUE
),
133 new CompareUnboxed());
136 success
&= testMapAny(transport
, new Byte((byte) -128),
138 success
&= testMapAny(transport
, new Byte((byte) 0),
140 success
&= testMapAny(transport
, new Byte((byte) 127),
142 success
&= testMapAny(transport
,
143 new Any(Type
.BYTE
, new Byte((byte) -128)),
144 new CompareUnboxed());
145 success
&= testMapAny(transport
,
146 new Any(Type
.BYTE
, new Byte((byte) 0)),
147 new CompareUnboxed());
148 success
&= testMapAny(transport
,
149 new Any(Type
.BYTE
, new Byte((byte) 127)),
150 new CompareUnboxed());
153 success
&= testMapAny(transport
, new Short((short) -32768),
155 success
&= testMapAny(transport
, new Short((short) 0),
157 success
&= testMapAny(transport
, new Short((short) 32767),
159 success
&= testMapAny(transport
,
161 new Short((short) -32768)),
162 new CompareUnboxed());
163 success
&= testMapAny(transport
,
164 new Any(Type
.SHORT
, new Short((short) 0)),
165 new CompareUnboxed());
166 success
&= testMapAny(transport
,
167 new Any(Type
.SHORT
, new Short((short) 32767)),
168 new CompareUnboxed());
171 success
&= testMapAny(transport
,
172 new Any(Type
.UNSIGNED_SHORT
,
173 new Short((short) 0)),
175 success
&= testMapAny(transport
,
176 new Any(Type
.UNSIGNED_SHORT
,
177 new Short((short) -32768)),
181 success
&= testMapAny(transport
, new Integer(-2147483648),
183 success
&= testMapAny(transport
, new Integer(0),
185 success
&= testMapAny(transport
, new Integer(2147483647),
187 success
&= testMapAny(transport
,
188 new Any(Type
.LONG
, new Integer(-2147483648)),
189 new CompareUnboxed());
190 success
&= testMapAny(transport
,
191 new Any(Type
.LONG
, new Integer(0)),
192 new CompareUnboxed());
193 success
&= testMapAny(transport
,
194 new Any(Type
.LONG
, new Integer(2147483647)),
195 new CompareUnboxed());
198 success
&= testMapAny(transport
,
199 new Any(Type
.UNSIGNED_LONG
, new Integer(0)),
201 success
&= testMapAny(transport
,
202 new Any(Type
.UNSIGNED_LONG
,
203 new Integer(-2147483648)),
207 success
&= testMapAny(transport
, new Long(-9223372036854775808L),
209 success
&= testMapAny(transport
, new Long(0L), new CompareBoxed());
210 success
&= testMapAny(transport
, new Long(9223372036854775807L),
212 success
&= testMapAny(transport
,
214 new Long(-9223372036854775808L)),
215 new CompareUnboxed());
216 success
&= testMapAny(transport
, new Any(Type
.HYPER
, new Long(0L)),
217 new CompareUnboxed());
218 success
&= testMapAny(transport
,
220 new Long(9223372036854775807L)),
221 new CompareUnboxed());
224 success
&= testMapAny(transport
,
225 new Any(Type
.UNSIGNED_HYPER
, new Long(0L)),
227 success
&= testMapAny(transport
,
228 new Any(Type
.UNSIGNED_HYPER
,
229 new Long(-9223372036854775808L)),
233 success
&= testMapAny(transport
, new Float(Float
.NEGATIVE_INFINITY
),
235 success
&= testMapAny(transport
, new Float(Float
.MIN_VALUE
),
237 success
&= testMapAny(transport
, new Float(-0.0f
),
239 success
&= testMapAny(transport
, new Float(0.0f
),
241 success
&= testMapAny(transport
, new Float(Float
.MAX_VALUE
),
243 success
&= testMapAny(transport
, new Float(Float
.POSITIVE_INFINITY
),
245 success
&= testMapAny(transport
, new Float(Float
.NaN
),
247 success
&= testMapAny(transport
,
249 new Float(Float
.NEGATIVE_INFINITY
)),
250 new CompareUnboxed());
251 success
&= testMapAny(transport
,
253 new Float(Float
.MIN_VALUE
)),
254 new CompareUnboxed());
255 success
&= testMapAny(transport
,
256 new Any(Type
.FLOAT
, new Float(-0.0f
)),
257 new CompareUnboxed());
258 success
&= testMapAny(transport
,
259 new Any(Type
.FLOAT
, new Float(0.0f
)),
260 new CompareUnboxed());
261 success
&= testMapAny(transport
,
263 new Float(Float
.MAX_VALUE
)),
264 new CompareUnboxed());
265 success
&= testMapAny(transport
,
267 new Float(Float
.POSITIVE_INFINITY
)),
268 new CompareUnboxed());
269 success
&= testMapAny(transport
,
270 new Any(Type
.FLOAT
, new Float(Float
.NaN
)),
271 new CompareUnboxed());
274 success
&= testMapAny(transport
,
275 new Double(Double
.NEGATIVE_INFINITY
),
277 success
&= testMapAny(transport
, new Double(Double
.MIN_VALUE
),
279 success
&= testMapAny(transport
, new Double(-0.0f
),
281 success
&= testMapAny(transport
, new Double(0.0f
),
283 success
&= testMapAny(transport
, new Double(Double
.MAX_VALUE
),
285 success
&= testMapAny(transport
,
286 new Double(Double
.POSITIVE_INFINITY
),
288 success
&= testMapAny(transport
, new Double(Double
.NaN
),
290 success
&= testMapAny(transport
,
292 new Double(Double
.NEGATIVE_INFINITY
)),
293 new CompareUnboxed());
294 success
&= testMapAny(transport
,
296 new Double(Double
.MIN_VALUE
)),
297 new CompareUnboxed());
298 success
&= testMapAny(transport
,
299 new Any(Type
.DOUBLE
, new Double(-0.0)),
300 new CompareUnboxed());
301 success
&= testMapAny(transport
,
302 new Any(Type
.DOUBLE
, new Double(0.0)),
303 new CompareUnboxed());
304 success
&= testMapAny(transport
,
306 new Double(Double
.MAX_VALUE
)),
307 new CompareUnboxed());
308 success
&= testMapAny(transport
,
310 new Double(Double
.POSITIVE_INFINITY
)),
311 new CompareUnboxed());
312 success
&= testMapAny(transport
,
313 new Any(Type
.DOUBLE
, new Double(Double
.NaN
)),
314 new CompareUnboxed());
317 success
&= testMapAny(transport
, new Character('\u0000'),
319 success
&= testMapAny(transport
, new Character('\uDBFF'),
321 success
&= testMapAny(transport
, new Character('\uFFFD'),
323 success
&= testMapAny(transport
,
324 new Any(Type
.CHAR
, new Character('\u0000')),
325 new CompareUnboxed());
326 success
&= testMapAny(transport
,
327 new Any(Type
.CHAR
, new Character('\uDBFF')),
328 new CompareUnboxed());
329 success
&= testMapAny(transport
,
330 new Any(Type
.CHAR
, new Character('\uFFFD')),
331 new CompareUnboxed());
334 success
&= testMapAny(transport
, "", new CompareBoxed());
335 success
&= testMapAny(transport
, "\uD800\uDC00",
337 success
&= testMapAny(transport
, "Test", new CompareBoxed());
338 success
&= testMapAny(transport
, new Any(Type
.STRING
, ""),
339 new CompareUnboxed());
340 success
&= testMapAny(transport
,
341 new Any(Type
.STRING
, "\uD800\uDC00"),
342 new CompareUnboxed());
343 success
&= testMapAny(transport
, new Any(Type
.STRING
, "Test"),
344 new CompareUnboxed());
347 success
&= testMapAny(transport
, Type
.VOID
, new CompareBoxed());
348 success
&= testMapAny(transport
, Type
.BOOLEAN
, new CompareBoxed());
349 success
&= testMapAny(transport
, Type
.BYTE
, new CompareBoxed());
350 success
&= testMapAny(transport
, Type
.SHORT
, new CompareBoxed());
351 success
&= testMapAny(transport
, Type
.UNSIGNED_SHORT
,
353 success
&= testMapAny(transport
, Type
.LONG
, new CompareBoxed());
354 success
&= testMapAny(transport
, Type
.UNSIGNED_LONG
,
356 success
&= testMapAny(transport
, Type
.HYPER
, new CompareBoxed());
357 success
&= testMapAny(transport
, Type
.UNSIGNED_HYPER
,
359 success
&= testMapAny(transport
, Type
.FLOAT
, new CompareBoxed());
360 success
&= testMapAny(transport
, Type
.DOUBLE
, new CompareBoxed());
361 success
&= testMapAny(transport
, Type
.CHAR
, new CompareBoxed());
362 success
&= testMapAny(transport
, Type
.STRING
, new CompareBoxed());
363 success
&= testMapAny(transport
, Type
.TYPE
, new CompareBoxed());
364 success
&= testMapAny(transport
, Type
.ANY
, new CompareBoxed());
365 success
&= testMapAny(transport
,
366 new Type("[]boolean", TypeClass
.SEQUENCE
),
368 success
&= testMapAny(transport
,
369 new Type("[]byte", TypeClass
.SEQUENCE
),
371 success
&= testMapAny(transport
,
372 new Type("[]short", TypeClass
.SEQUENCE
),
374 success
&= testMapAny(transport
,
375 new Type("[]unsigned short",
378 success
&= testMapAny(transport
,
379 new Type("[]long", TypeClass
.SEQUENCE
),
381 success
&= testMapAny(transport
,
382 new Type("[]unsigned long",
385 success
&= testMapAny(transport
,
386 new Type("[]hyper", TypeClass
.SEQUENCE
),
388 success
&= testMapAny(transport
,
389 new Type("[]unsigned hyper",
392 success
&= testMapAny(transport
,
393 new Type("[]float", TypeClass
.SEQUENCE
),
395 success
&= testMapAny(transport
,
396 new Type("[]double", TypeClass
.SEQUENCE
),
398 success
&= testMapAny(transport
,
399 new Type("[]char", TypeClass
.SEQUENCE
),
401 success
&= testMapAny(transport
,
402 new Type("[]string", TypeClass
.SEQUENCE
),
404 success
&= testMapAny(transport
,
405 new Type("[]type", TypeClass
.SEQUENCE
),
407 success
&= testMapAny(transport
,
408 new Type("[]any", TypeClass
.SEQUENCE
),
411 success
&= testMapAny(transport
,
412 new Type("[]" + Enum1
.class.getName(),
415 success
&= testMapAny(transport
,
416 new Type("[]" + BaseStruct
.class.getName(),
419 success
&= testMapAny(transport
,
420 new Type("[]" + DerivedStruct
.class.getName(),
424 success
&= testMapAny(transport
,
425 new Type("[]" + XInterface
.class.getName(),
428 success
&= testMapAny(transport
,
429 new Type("[]" + BaseInterface
.class.getName(),
432 success
&= testMapAny(transport
,
434 + DerivedInterface
.class.getName(),
437 success
&= testMapAny(transport
,
438 new Type("[][]boolean", TypeClass
.SEQUENCE
),
440 success
&= testMapAny(transport
,
441 new Type("[][]byte", TypeClass
.SEQUENCE
),
443 success
&= testMapAny(transport
,
444 new Type("[][]short", TypeClass
.SEQUENCE
),
446 success
&= testMapAny(transport
,
447 new Type("[][]unsigned short",
450 success
&= testMapAny(transport
,
451 new Type("[][]long", TypeClass
.SEQUENCE
),
453 success
&= testMapAny(transport
,
454 new Type("[][]unsigned long",
457 success
&= testMapAny(transport
,
458 new Type("[][]hyper", TypeClass
.SEQUENCE
),
460 success
&= testMapAny(transport
,
461 new Type("[][]unsigned hyper",
464 success
&= testMapAny(transport
,
465 new Type("[][]float", TypeClass
.SEQUENCE
),
467 success
&= testMapAny(transport
,
468 new Type("[][]double", TypeClass
.SEQUENCE
),
470 success
&= testMapAny(transport
,
471 new Type("[][]char", TypeClass
.SEQUENCE
),
473 success
&= testMapAny(transport
,
474 new Type("[][]string", TypeClass
.SEQUENCE
),
476 success
&= testMapAny(transport
,
477 new Type("[][]type", TypeClass
.SEQUENCE
),
479 success
&= testMapAny(transport
,
480 new Type("[][]any", TypeClass
.SEQUENCE
),
483 success
&= testMapAny(transport
,
484 new Type("[][]" + Enum1
.class.getName(),
487 success
&= testMapAny(transport
,
488 new Type("[][]" + BaseStruct
.class.getName(),
491 success
&= testMapAny(transport
,
493 + DerivedStruct
.class.getName(),
497 success
&= testMapAny(transport
,
498 new Type("[][]" + XInterface
.class.getName(),
501 success
&= testMapAny(transport
,
503 + BaseInterface
.class.getName(),
506 success
&= testMapAny(transport
,
508 + DerivedInterface
.class.getName(),
512 success
&= testMapAny(transport
, new Type(Enum1
.class.getName(),
515 success
&= testMapAny(transport
,
516 new Type(BaseStruct
.class.getName(),
519 success
&= testMapAny(transport
,
520 new Type(DerivedStruct
.class.getName(),
524 success
&= testMapAny(transport
,
526 com
.sun
.star
.uno
.Exception
.class.
528 TypeClass
.EXCEPTION
),
531 success
&= testMapAny(transport
,
532 new Type(BaseException
.class.getName(),
533 TypeClass
.EXCEPTION
),
535 success
&= testMapAny(transport
,
536 new Type(DerivedException
.class.getName(),
537 TypeClass
.EXCEPTION
),
540 success
&= testMapAny(transport
,
542 com
.sun
.star
.uno
.RuntimeException
.class.
544 TypeClass
.EXCEPTION
),
547 success
&= testMapAny(transport
,
549 BaseRuntimeException
.class.getName(),
550 TypeClass
.EXCEPTION
),
552 success
&= testMapAny(transport
,
554 DerivedRuntimeException
.class.
556 TypeClass
.EXCEPTION
),
559 success
&= testMapAny(transport
,
560 new Type(XInterface
.class.getName(),
561 TypeClass
.INTERFACE
),
563 success
&= testMapAny(transport
,
564 new Type(BaseInterface
.class.getName(),
565 TypeClass
.INTERFACE
),
567 success
&= testMapAny(transport
,
568 new Type(DerivedInterface
.class.getName(),
569 TypeClass
.INTERFACE
),
571 success
&= testMapAny(transport
, new Any(Type
.TYPE
, Type
.VOID
),
572 new CompareUnboxed());
573 success
&= testMapAny(transport
, new Any(Type
.TYPE
, Type
.BOOLEAN
),
574 new CompareUnboxed());
575 success
&= testMapAny(transport
, new Any(Type
.TYPE
, Type
.BYTE
),
576 new CompareUnboxed());
577 success
&= testMapAny(transport
, new Any(Type
.TYPE
, Type
.SHORT
),
578 new CompareUnboxed());
579 success
&= testMapAny(transport
,
580 new Any(Type
.TYPE
, Type
.UNSIGNED_SHORT
),
581 new CompareUnboxed());
582 success
&= testMapAny(transport
, new Any(Type
.TYPE
, Type
.LONG
),
583 new CompareUnboxed());
584 success
&= testMapAny(transport
,
585 new Any(Type
.TYPE
, Type
.UNSIGNED_LONG
),
586 new CompareUnboxed());
587 success
&= testMapAny(transport
, new Any(Type
.TYPE
, Type
.HYPER
),
588 new CompareUnboxed());
589 success
&= testMapAny(transport
,
590 new Any(Type
.TYPE
, Type
.UNSIGNED_HYPER
),
591 new CompareUnboxed());
592 success
&= testMapAny(transport
, new Any(Type
.TYPE
, Type
.FLOAT
),
593 new CompareUnboxed());
594 success
&= testMapAny(transport
, new Any(Type
.TYPE
, Type
.DOUBLE
),
595 new CompareUnboxed());
596 success
&= testMapAny(transport
, new Any(Type
.TYPE
, Type
.CHAR
),
597 new CompareUnboxed());
598 success
&= testMapAny(transport
, new Any(Type
.TYPE
, Type
.STRING
),
599 new CompareUnboxed());
600 success
&= testMapAny(transport
, new Any(Type
.TYPE
, Type
.TYPE
),
601 new CompareUnboxed());
602 success
&= testMapAny(transport
, new Any(Type
.TYPE
, Type
.ANY
),
603 new CompareUnboxed());
604 success
&= testMapAny(transport
,
606 new Type("[]boolean",
607 TypeClass
.SEQUENCE
)),
608 new CompareUnboxed());
609 success
&= testMapAny(transport
,
612 TypeClass
.SEQUENCE
)),
613 new CompareUnboxed());
614 success
&= testMapAny(transport
,
617 TypeClass
.SEQUENCE
)),
618 new CompareUnboxed());
619 success
&= testMapAny(transport
,
621 new Type("[]unsigned short",
622 TypeClass
.SEQUENCE
)),
623 new CompareUnboxed());
624 success
&= testMapAny(transport
,
627 TypeClass
.SEQUENCE
)),
628 new CompareUnboxed());
629 success
&= testMapAny(transport
,
631 new Type("[]unsigned long",
632 TypeClass
.SEQUENCE
)),
633 new CompareUnboxed());
634 success
&= testMapAny(transport
,
637 TypeClass
.SEQUENCE
)),
638 new CompareUnboxed());
639 success
&= testMapAny(transport
,
641 new Type("[]unsigned hyper",
642 TypeClass
.SEQUENCE
)),
643 new CompareUnboxed());
644 success
&= testMapAny(transport
,
647 TypeClass
.SEQUENCE
)),
648 new CompareUnboxed());
649 success
&= testMapAny(transport
,
652 TypeClass
.SEQUENCE
)),
653 new CompareUnboxed());
654 success
&= testMapAny(transport
,
657 TypeClass
.SEQUENCE
)),
658 new CompareUnboxed());
659 success
&= testMapAny(transport
,
662 TypeClass
.SEQUENCE
)),
663 new CompareUnboxed());
664 success
&= testMapAny(transport
,
667 TypeClass
.SEQUENCE
)),
668 new CompareUnboxed());
669 success
&= testMapAny(transport
,
672 TypeClass
.SEQUENCE
)),
673 new CompareUnboxed());
675 success
&= testMapAny(transport
,
677 new Type("[]" + Enum1
.class.getName(),
678 TypeClass
.SEQUENCE
)),
679 new CompareUnboxed());
680 success
&= testMapAny(transport
,
683 + BaseStruct
.class.getName(),
684 TypeClass
.SEQUENCE
)),
685 new CompareUnboxed());
686 success
&= testMapAny(transport
,
690 + DerivedStruct
.class.getName(),
691 TypeClass
.SEQUENCE
)),
692 new CompareUnboxed());
694 success
&= testMapAny(transport
,
697 + XInterface
.class.getName(),
698 TypeClass
.SEQUENCE
)),
699 new CompareUnboxed());
700 success
&= testMapAny(transport
,
704 + BaseInterface
.class.getName(),
705 TypeClass
.SEQUENCE
)),
706 new CompareUnboxed());
707 success
&= testMapAny(transport
,
712 + DerivedInterface
.class.getName(),
713 TypeClass
.SEQUENCE
)),
714 new CompareUnboxed());
715 success
&= testMapAny(transport
,
717 new Type("[][]boolean",
718 TypeClass
.SEQUENCE
)),
719 new CompareUnboxed());
720 success
&= testMapAny(transport
,
723 TypeClass
.SEQUENCE
)),
724 new CompareUnboxed());
725 success
&= testMapAny(transport
,
727 new Type("[][]short",
728 TypeClass
.SEQUENCE
)),
729 new CompareUnboxed());
730 success
&= testMapAny(transport
,
732 new Type("[][]unsigned short",
733 TypeClass
.SEQUENCE
)),
734 new CompareUnboxed());
735 success
&= testMapAny(transport
,
738 TypeClass
.SEQUENCE
)),
739 new CompareUnboxed());
740 success
&= testMapAny(transport
,
742 new Type("[][]unsigned long",
743 TypeClass
.SEQUENCE
)),
744 new CompareUnboxed());
745 success
&= testMapAny(transport
,
747 new Type("[][]hyper",
748 TypeClass
.SEQUENCE
)),
749 new CompareUnboxed());
750 success
&= testMapAny(transport
,
752 new Type("[][]unsigned hyper",
753 TypeClass
.SEQUENCE
)),
754 new CompareUnboxed());
755 success
&= testMapAny(transport
,
757 new Type("[][]float",
758 TypeClass
.SEQUENCE
)),
759 new CompareUnboxed());
760 success
&= testMapAny(transport
,
762 new Type("[][]double",
763 TypeClass
.SEQUENCE
)),
764 new CompareUnboxed());
765 success
&= testMapAny(transport
,
768 TypeClass
.SEQUENCE
)),
769 new CompareUnboxed());
770 success
&= testMapAny(transport
,
772 new Type("[][]string",
773 TypeClass
.SEQUENCE
)),
774 new CompareUnboxed());
775 success
&= testMapAny(transport
,
778 TypeClass
.SEQUENCE
)),
779 new CompareUnboxed());
780 success
&= testMapAny(transport
,
783 TypeClass
.SEQUENCE
)),
784 new CompareUnboxed());
786 success
&= testMapAny(transport
,
789 + Enum1
.class.getName(),
790 TypeClass
.SEQUENCE
)),
791 new CompareUnboxed());
792 success
&= testMapAny(transport
,
795 + BaseStruct
.class.getName(),
796 TypeClass
.SEQUENCE
)),
797 new CompareUnboxed());
798 success
&= testMapAny(transport
,
802 + DerivedStruct
.class.getName(),
803 TypeClass
.SEQUENCE
)),
804 new CompareUnboxed());
806 success
&= testMapAny(transport
,
809 + XInterface
.class.getName(),
810 TypeClass
.SEQUENCE
)),
811 new CompareUnboxed());
812 success
&= testMapAny(transport
,
816 + BaseInterface
.class.getName(),
817 TypeClass
.SEQUENCE
)),
818 new CompareUnboxed());
819 success
&= testMapAny(transport
,
824 + DerivedInterface
.class.getName(),
825 TypeClass
.SEQUENCE
)),
826 new CompareUnboxed());
828 success
&= testMapAny(transport
,
830 new Type(Enum1
.class.getName(),
832 new CompareUnboxed());
833 success
&= testMapAny(transport
,
835 new Type(BaseStruct
.class.getName(),
837 new CompareUnboxed());
838 success
&= testMapAny(transport
,
841 DerivedStruct
.class.getName(),
843 new CompareUnboxed());
845 success
&= testMapAny(transport
,
849 com
.sun
.star
.uno
.Exception
.class.
851 TypeClass
.EXCEPTION
)),
852 new CompareUnboxed());
854 success
&= testMapAny(transport
,
857 BaseException
.class.getName(),
858 TypeClass
.EXCEPTION
)),
859 new CompareUnboxed());
860 success
&= testMapAny(transport
,
864 DerivedException
.class.getName(),
865 TypeClass
.EXCEPTION
)),
866 new CompareUnboxed());
868 success
&= testMapAny(transport
,
872 com
.sun
.star
.uno
.RuntimeException
.
874 TypeClass
.EXCEPTION
)),
875 new CompareUnboxed());
877 success
&= testMapAny(transport
,
881 BaseRuntimeException
.class.
883 TypeClass
.EXCEPTION
)),
884 new CompareUnboxed());
885 success
&= testMapAny(transport
,
889 DerivedRuntimeException
.class.
891 TypeClass
.EXCEPTION
)),
892 new CompareUnboxed());
894 success
&= testMapAny(transport
,
896 new Type(XInterface
.class.getName(),
897 TypeClass
.INTERFACE
)),
898 new CompareUnboxed());
899 success
&= testMapAny(transport
,
902 BaseInterface
.class.getName(),
903 TypeClass
.INTERFACE
)),
904 new CompareUnboxed());
905 success
&= testMapAny(transport
,
908 DerivedInterface
.class.getName(),
909 TypeClass
.INTERFACE
)),
910 new CompareUnboxed());
913 success
&= testMapAny(transport
, new boolean[] {},
915 success
&= testMapAny(transport
, new boolean[] { false, true },
917 success
&= testMapAny(transport
,
918 new Any(new Type(boolean[].class),
920 new CompareUnboxed());
921 success
&= testMapAny(transport
,
922 new Any(new Type(boolean[].class),
923 new boolean[] { false, true }),
924 new CompareUnboxed());
925 success
&= testMapAny(transport
, new byte[] {},
927 success
&= testMapAny(transport
, new byte[] { -128, 0, 127 },
929 success
&= testMapAny(transport
,
930 new Any(new Type(byte[].class),
932 new CompareUnboxed());
933 success
&= testMapAny(transport
,
934 new Any(new Type(byte[].class),
935 new byte[] { -128, 0, 127 }),
936 new CompareUnboxed());
937 success
&= testMapAny(transport
, new short[] {},
939 success
&= testMapAny(transport
, new short[] { -32768, 0, 32767 },
941 success
&= testMapAny(transport
,
942 new Any(new Type(short[].class),
944 new CompareUnboxed());
945 success
&= testMapAny(transport
,
946 new Any(new Type(short[].class),
947 new short[] { -32768, 0, 32767 }),
948 new CompareUnboxed());
949 success
&= testMapAny(transport
,
950 new Any(new Type("[]unsigned short",
954 success
&= testMapAny(transport
,
955 new Any(new Type("[]unsigned short",
957 new short[] { 0, -32768 }),
959 success
&= testMapAny(transport
, new int[] {},
961 success
&= testMapAny(transport
,
962 new int[] { -2147483648, 0, 2147483647 },
964 success
&= testMapAny(transport
,
965 new Any(new Type(int[].class),
967 new CompareUnboxed());
968 success
&= testMapAny(transport
,
969 new Any(new Type(int[].class),
970 new int[] { -2147483648, 0,
972 new CompareUnboxed());
973 success
&= testMapAny(transport
,
974 new Any(new Type("[]unsigned long",
978 success
&= testMapAny(transport
,
979 new Any(new Type("[]unsigned long",
981 new int[] { 0, -2147483648 }),
983 success
&= testMapAny(transport
, new long[] {},
985 success
&= testMapAny(transport
,
986 new long[] { -9223372036854775808L, 0L,
987 9223372036854775807L },
989 success
&= testMapAny(transport
,
990 new Any(new Type(long[].class),
992 new CompareUnboxed());
993 success
&= testMapAny(transport
,
994 new Any(new Type(long[].class),
995 new long[] { -9223372036854775808L,
997 9223372036854775807L }),
998 new CompareUnboxed());
999 success
&= testMapAny(transport
,
1000 new Any(new Type("[]unsigned hyper",
1001 TypeClass
.SEQUENCE
),
1003 new CompareBoxed());
1004 success
&= testMapAny(transport
,
1005 new Any(new Type("[]unsigned hyper",
1006 TypeClass
.SEQUENCE
),
1008 -9223372036854775808L }),
1009 new CompareBoxed());
1010 success
&= testMapAny(transport
, new float[] {},
1011 new CompareBoxed());
1012 success
&= testMapAny(transport
,
1013 new float[] { Float
.NEGATIVE_INFINITY
,
1014 Float
.MIN_VALUE
, -0.0f
, 0.0f
,
1016 Float
.POSITIVE_INFINITY
,
1018 new CompareBoxed());
1019 success
&= testMapAny(transport
,
1020 new Any(new Type(float[].class),
1022 new CompareUnboxed());
1023 success
&= testMapAny(transport
,
1024 new Any(new Type(float[].class),
1025 new float[] { Float
.NEGATIVE_INFINITY
,
1026 Float
.MIN_VALUE
, -0.0f
,
1027 0.0f
, Float
.MAX_VALUE
,
1028 Float
.POSITIVE_INFINITY
,
1030 new CompareUnboxed());
1031 success
&= testMapAny(transport
, new double[] {},
1032 new CompareBoxed());
1033 success
&= testMapAny(transport
,
1034 new double[] { Double
.NEGATIVE_INFINITY
,
1035 Double
.MIN_VALUE
, -0.0, 0.0,
1037 Double
.POSITIVE_INFINITY
,
1039 new CompareBoxed());
1040 success
&= testMapAny(transport
,
1041 new Any(new Type(double[].class),
1043 new CompareUnboxed());
1044 success
&= testMapAny(transport
,
1045 new Any(new Type(double[].class),
1047 Double
.NEGATIVE_INFINITY
,
1048 Double
.MIN_VALUE
, -0.0, 0.0,
1050 Double
.POSITIVE_INFINITY
,
1052 new CompareUnboxed());
1053 success
&= testMapAny(transport
, new char[] {},
1054 new CompareBoxed());
1055 success
&= testMapAny(transport
,
1056 new char[] { '\u0000', '\uDBFF', '\uFFFD' },
1057 new CompareBoxed());
1058 success
&= testMapAny(transport
,
1059 new Any(new Type(char[].class),
1061 new CompareUnboxed());
1062 success
&= testMapAny(transport
,
1064 new Type(char[].class),
1065 new char[] { '\u0000', '\uDBFF',
1067 new CompareUnboxed());
1068 success
&= testMapAny(transport
, new String
[] {},
1069 new CompareBoxed());
1070 success
&= testMapAny(transport
,
1071 new String
[] { "", "\uD800\uDC00", "Test" },
1072 new CompareBoxed());
1073 success
&= testMapAny(transport
,
1074 new Any(new Type(String
[].class),
1076 new CompareUnboxed());
1077 success
&= testMapAny(transport
,
1078 new Any(new Type(String
[].class),
1079 new String
[] { "", "\uD800\uDC00",
1081 new CompareUnboxed());
1082 success
&= testMapAny(transport
, new Type
[] {}, new CompareBoxed());
1083 success
&= testMapAny(transport
,
1086 new Type(DerivedInterface
.class.getName(),
1087 TypeClass
.INTERFACE
) },
1088 new CompareBoxed());
1089 success
&= testMapAny(transport
,
1090 new Any(new Type(Type
[].class),
1092 new CompareUnboxed());
1093 success
&= testMapAny(transport
,
1095 new Type(Type
[].class),
1099 DerivedInterface
.class.getName(),
1100 TypeClass
.INTERFACE
) }),
1101 new CompareUnboxed());
1102 success
&= testMapAny(transport
, new Object
[] {},
1103 new CompareBoxed());
1104 success
&= testMapAny(transport
,
1105 new Object
[] { Any
.VOID
, Boolean
.FALSE
},
1106 new CompareBoxed());
1107 success
&= testMapAny(transport
,
1110 new Any(Type
.BOOLEAN
, Boolean
.TRUE
) },
1111 new CompareBoxed(true));
1112 success
&= testMapAny(transport
,
1113 new Any(new Type(Any
[].class),
1115 new CompareUnboxed());
1116 success
&= testMapAny(transport
,
1117 new Any(new Type(Any
[].class),
1118 new Object
[] { Any
.VOID
,
1120 new CompareUnboxed());
1121 success
&= testMapAny(transport
,
1122 new Any(new Type(Any
[].class),
1125 new Any(Type
.BOOLEAN
,
1127 new CompareUnboxed(true));
1128 success
&= testMapAny(transport
, new Any
[] {},
1129 new CompareSpecific(new Object
[] {}));
1130 success
&= testMapAny(transport
,
1131 new Any
[] { Any
.VOID
,
1132 new Any(Type
.BOOLEAN
,
1134 new CompareSpecific(
1135 new Object
[] { Any
.VOID
, Boolean
.TRUE
}));
1136 success
&= testMapAny(transport
,
1137 new Any(new Type(Any
[].class), new Any
[] {}),
1138 new CompareSpecific(new Object
[] {}));
1139 success
&= testMapAny(transport
,
1140 new Any(new Type(Any
[].class),
1141 new Any
[] { Any
.VOID
,
1142 new Any(Type
.BOOLEAN
,
1144 new CompareSpecific(
1145 new Object
[] { Any
.VOID
, Boolean
.TRUE
}));
1146 success
&= testMapAny(transport
,
1147 new Any(new Type(Any
[].class),
1149 new CompareSpecific(new Object
[] {}));
1150 success
&= testMapAny(transport
,
1151 new Any(new Type(Any
[].class),
1152 new Boolean
[] { Boolean
.FALSE
}),
1153 new CompareSpecific(
1154 new Object
[] { Boolean
.FALSE
}));
1156 success
&= testMapAny(transport
, new Enum1
[] {},
1157 new CompareBoxed());
1158 success
&= testMapAny(transport
, new Enum1
[] { new Enum1(),
1160 new CompareSpecific(
1161 new Enum1
[] { new Enum1(),
1163 success
&= testMapAny(transport
,
1164 new Any(new Type(Enum1
[].class),
1166 new CompareUnboxed());
1167 success
&= testMapAny(transport
,
1168 new Any(new Type(Enum1
[].class),
1169 new Enum1
[] { new Enum1(),
1171 new CompareSpecific(
1172 new Enum1
[] { new Enum1(),
1174 success
&= testMapAny(transport
,
1175 new Any(new Type(Enum1
[].class),
1177 new CompareSpecific(new Enum1
[] {}));
1178 success
&= testMapAny(transport
,
1179 new Any(new Type(Enum1
[].class),
1180 new Enum2
[] { new Enum2() }),
1181 new CompareSpecific(
1182 new Enum1
[] { new Enum1() }));
1183 success
&= testMapAny(transport
, new BaseStruct
[] {},
1184 new CompareBoxed());
1185 success
&= testMapAny(transport
,
1186 new BaseStruct
[] { new BaseStruct(),
1187 new DerivedStruct() },
1188 new CompareSpecific(
1189 new BaseStruct
[] { new BaseStruct(),
1190 new BaseStruct() }));
1191 success
&= testMapAny(transport
,
1192 new Any(new Type(BaseStruct
[].class),
1193 new BaseStruct
[] {}),
1194 new CompareUnboxed());
1195 success
&= testMapAny(transport
,
1196 new Any(new Type(BaseStruct
[].class),
1199 new DerivedStruct() }),
1200 new CompareSpecific(
1201 new BaseStruct
[] { new BaseStruct(),
1202 new BaseStruct() }));
1203 success
&= testMapAny(transport
,
1204 new Any(new Type(BaseStruct
[].class),
1205 new DerivedStruct
[] {}),
1206 new CompareSpecific(new BaseStruct
[] {}));
1207 success
&= testMapAny(transport
,
1208 new Any(new Type(BaseStruct
[].class),
1209 new DerivedStruct
[] {
1210 new DerivedStruct() }),
1211 new CompareSpecific(
1212 new BaseStruct
[] { new BaseStruct() }));
1213 success
&= testMapAny(transport
, new DerivedStruct
[] {},
1214 new CompareBoxed());
1215 success
&= testMapAny(transport
,
1216 new DerivedStruct
[] { new DerivedStruct() },
1217 new CompareBoxed());
1218 success
&= testMapAny(transport
,
1219 new Any(new Type(DerivedStruct
[].class),
1220 new DerivedStruct
[] {}),
1221 new CompareUnboxed());
1222 success
&= testMapAny(transport
,
1223 new Any(new Type(DerivedStruct
[].class),
1224 new DerivedStruct
[] {
1225 new DerivedStruct() }),
1226 new CompareUnboxed());
1228 success
&= testMapAny(transport
, new XInterface
[] {},
1229 new CompareBoxed());
1230 success
&= testMapAny(transport
,
1232 null, new XInterface() {},
1233 new BaseInterface() {},
1234 new DerivedInterface() {} },
1235 new CompareBoxed());
1236 success
&= testMapAny(transport
,
1237 new Any(new Type(XInterface
[].class),
1238 new XInterface
[] {}),
1239 new CompareUnboxed());
1240 success
&= testMapAny(transport
,
1241 new Any(new Type(XInterface
[].class),
1243 null, new XInterface() {},
1244 new BaseInterface() {},
1245 new DerivedInterface() {} }),
1246 new CompareUnboxed());
1247 success
&= testMapAny(transport
,
1248 new Any(new Type(XInterface
[].class),
1250 new CompareSpecific(new XInterface
[] {}));
1252 XInterface if1
= new XInterface() {};
1253 XInterface if2
= new BaseInterface() {};
1254 XInterface if3
= new DerivedInterface() {};
1255 success
&= testMapAny(transport
,
1256 new Any(new Type(XInterface
[].class),
1257 new Object
[] { null, if1
, if2
,
1259 new CompareSpecific(
1260 new XInterface
[] { null, if1
, if2
,
1263 success
&= testMapAny(transport
,
1264 new Any(new Type(XInterface
[].class),
1265 new BaseInterface
[] {}),
1266 new CompareSpecific(new XInterface
[] {}));
1268 BaseInterface if1
= new BaseInterface() {};
1269 BaseInterface if2
= new DerivedInterface() {};
1270 success
&= testMapAny(transport
,
1271 new Any(new Type(XInterface
[].class),
1272 new BaseInterface
[] { null, if1
,
1274 new CompareSpecific(
1275 new XInterface
[] { null, if1
, if2
}));
1277 success
&= testMapAny(transport
,
1278 new Any(new Type(XInterface
[].class),
1279 new DerivedInterface
[] {}),
1280 new CompareSpecific(new XInterface
[] {}));
1282 DerivedInterface if1
= new DerivedInterface() {};
1283 success
&= testMapAny(transport
,
1284 new Any(new Type(XInterface
[].class),
1285 new DerivedInterface
[] { null,
1287 new CompareSpecific(
1288 new XInterface
[] { null, if1
}));
1290 success
&= testMapAny(transport
, new BaseInterface
[] {},
1291 new CompareBoxed());
1292 success
&= testMapAny(transport
,
1293 new BaseInterface
[] {
1294 null, new BaseInterface() {},
1295 new DerivedInterface() {} },
1296 new CompareBoxed());
1297 success
&= testMapAny(transport
,
1298 new Any(new Type(BaseInterface
[].class),
1299 new BaseInterface
[] {}),
1300 new CompareUnboxed());
1301 success
&= testMapAny(transport
,
1302 new Any(new Type(BaseInterface
[].class),
1303 new BaseInterface
[] {
1304 null, new BaseInterface() {},
1305 new DerivedInterface() {} }),
1306 new CompareUnboxed());
1307 success
&= testMapAny(transport
,
1308 new Any(new Type(BaseInterface
[].class),
1309 new DerivedInterface
[] {}),
1310 new CompareSpecific(new BaseInterface
[] {}));
1312 DerivedInterface if1
= new DerivedInterface() {};
1313 success
&= testMapAny(transport
,
1314 new Any(new Type(BaseInterface
[].class),
1315 new DerivedInterface
[] { null,
1317 new CompareSpecific(
1318 new BaseInterface
[] { null, if1
}));
1320 success
&= testMapAny(transport
, new DerivedInterface
[] {},
1321 new CompareBoxed());
1322 success
&= testMapAny(transport
,
1323 new DerivedInterface
[] {
1324 null, new DerivedInterface() {} },
1325 new CompareBoxed());
1326 success
&= testMapAny(transport
,
1327 new Any(new Type(DerivedInterface
[].class),
1328 new DerivedInterface
[] {}),
1329 new CompareUnboxed());
1330 success
&= testMapAny(transport
,
1331 new Any(new Type(DerivedInterface
[].class),
1332 new DerivedInterface
[] {
1334 new DerivedInterface() {} }),
1335 new CompareUnboxed());
1336 success
&= testMapAny(transport
,
1337 new boolean[][] { new boolean[] {} },
1338 new CompareBoxed());
1339 success
&= testMapAny(transport
,
1341 new boolean[] { false, true } },
1342 new CompareBoxed());
1343 success
&= testMapAny(transport
,
1344 new Any(new Type(boolean[][].class),
1345 new boolean[][] { new boolean[] {} }),
1346 new CompareUnboxed());
1347 success
&= testMapAny(transport
,
1348 new Any(new Type(boolean[][].class),
1350 new boolean[] { false, true } }),
1351 new CompareUnboxed());
1352 success
&= testMapAny(transport
, new byte[][] { new byte[] {} },
1353 new CompareBoxed());
1354 success
&= testMapAny(transport
,
1355 new byte[][] { new byte[] { -128, 0, 127 } },
1356 new CompareBoxed());
1357 success
&= testMapAny(transport
,
1358 new Any(new Type(byte[][].class),
1359 new byte[][] { new byte[] {} }),
1360 new CompareUnboxed());
1361 success
&= testMapAny(transport
,
1362 new Any(new Type(byte[][].class),
1364 new byte[] { -128, 0, 127 } }),
1365 new CompareUnboxed());
1366 success
&= testMapAny(transport
, new short[][] { new short[] {} },
1367 new CompareBoxed());
1368 success
&= testMapAny(transport
,
1370 new short[] { -32768, 0, 32767 } },
1371 new CompareBoxed());
1372 success
&= testMapAny(transport
,
1373 new Any(new Type(short[][].class),
1374 new short[][] { new short[] {} }),
1375 new CompareUnboxed());
1376 success
&= testMapAny(transport
,
1377 new Any(new Type(short[][].class),
1379 new short[] { -32768, 0,
1381 new CompareUnboxed());
1382 success
&= testMapAny(transport
,
1383 new Any(new Type("[][]unsigned short",
1384 TypeClass
.SEQUENCE
),
1385 new short[][] { new short[] {} }),
1386 new CompareBoxed());
1387 success
&= testMapAny(transport
,
1388 new Any(new Type("[][]unsigned short",
1389 TypeClass
.SEQUENCE
),
1391 new short[] { 0, -32768 } }),
1392 new CompareBoxed());
1393 success
&= testMapAny(transport
, new int[][] { new int[] {} },
1394 new CompareBoxed());
1395 success
&= testMapAny(transport
,
1396 new int[][] { new int[] { -2147483648, 0,
1398 new CompareBoxed());
1399 success
&= testMapAny(transport
,
1400 new Any(new Type(int[][].class),
1401 new int[][] { new int[] {} }),
1402 new CompareUnboxed());
1403 success
&= testMapAny(transport
,
1404 new Any(new Type(int[][].class),
1406 new int[] { -2147483648, 0,
1408 new CompareUnboxed());
1409 success
&= testMapAny(transport
,
1410 new Any(new Type("[][]unsigned long",
1411 TypeClass
.SEQUENCE
),
1412 new int[][] { new int[] {} }),
1413 new CompareBoxed());
1414 success
&= testMapAny(transport
,
1415 new Any(new Type("[][]unsigned long",
1416 TypeClass
.SEQUENCE
),
1418 new int[] { 0, -2147483648 } }),
1419 new CompareBoxed());
1420 success
&= testMapAny(transport
, new long[][] { new long[] {} },
1421 new CompareBoxed());
1422 success
&= testMapAny(transport
,
1424 new long[] { -9223372036854775808L, 0L,
1425 9223372036854775807L } },
1426 new CompareBoxed());
1427 success
&= testMapAny(transport
,
1428 new Any(new Type(long[][].class),
1429 new long[][] { new long[] {} }),
1430 new CompareUnboxed());
1431 success
&= testMapAny(transport
,
1432 new Any(new Type(long[][].class),
1435 -9223372036854775808L, 0L,
1436 9223372036854775807L } }),
1437 new CompareUnboxed());
1438 success
&= testMapAny(transport
,
1439 new Any(new Type("[][]unsigned hyper",
1440 TypeClass
.SEQUENCE
),
1441 new long[][] { new long[] {} }),
1442 new CompareBoxed());
1443 success
&= testMapAny(transport
,
1444 new Any(new Type("[][]unsigned hyper",
1445 TypeClass
.SEQUENCE
),
1449 -9223372036854775808L } }),
1450 new CompareBoxed());
1451 success
&= testMapAny(transport
, new float[][] { new float[] {} },
1452 new CompareBoxed());
1453 success
&= testMapAny(transport
,
1455 new float[] { Float
.NEGATIVE_INFINITY
,
1456 Float
.MIN_VALUE
, -0.0f
,
1457 0.0f
, Float
.MAX_VALUE
,
1458 Float
.POSITIVE_INFINITY
,
1460 new CompareBoxed());
1461 success
&= testMapAny(transport
,
1462 new Any(new Type(float[][].class),
1463 new float[][] { new float[] {} }),
1464 new CompareUnboxed());
1465 success
&= testMapAny(transport
,
1466 new Any(new Type(float[][].class),
1469 Float
.NEGATIVE_INFINITY
,
1470 Float
.MIN_VALUE
, -0.0f
, 0.0f
,
1472 Float
.POSITIVE_INFINITY
,
1474 new CompareUnboxed());
1475 success
&= testMapAny(transport
, new double[][] { new double[] {} },
1476 new CompareBoxed());
1477 success
&= testMapAny(transport
,
1479 new double[] { Double
.NEGATIVE_INFINITY
,
1480 Double
.MIN_VALUE
, -0.0,
1481 0.0, Double
.MAX_VALUE
,
1482 Double
.POSITIVE_INFINITY
,
1484 new CompareBoxed());
1485 success
&= testMapAny(transport
,
1486 new Any(new Type(double[][].class),
1487 new double[][] { new double[] {} }),
1488 new CompareUnboxed());
1489 success
&= testMapAny(transport
,
1490 new Any(new Type(double[][].class),
1493 Double
.NEGATIVE_INFINITY
,
1494 Double
.MIN_VALUE
, -0.0, 0.0,
1496 Double
.POSITIVE_INFINITY
,
1498 new CompareUnboxed());
1499 success
&= testMapAny(transport
, new char[][] { new char[] {} },
1500 new CompareBoxed());
1501 success
&= testMapAny(transport
,
1503 new char[] { '\u0000', '\uDBFF',
1505 new CompareBoxed());
1506 success
&= testMapAny(transport
,
1507 new Any(new Type(char[][].class),
1508 new char[][] { new char[] {} }),
1509 new CompareUnboxed());
1510 success
&= testMapAny(transport
,
1512 new Type(char[][].class),
1514 new char[] { '\u0000', '\uDBFF',
1516 new CompareUnboxed());
1517 success
&= testMapAny(transport
, new String
[][] { new String
[] {} },
1518 new CompareBoxed());
1519 success
&= testMapAny(transport
,
1521 new String
[] { "", "\uD800\uDC00",
1523 new CompareBoxed());
1524 success
&= testMapAny(transport
,
1525 new Any(new Type(String
[][].class),
1526 new String
[][] { new String
[] {} }),
1527 new CompareUnboxed());
1528 success
&= testMapAny(transport
,
1529 new Any(new Type(String
[][].class),
1531 new String
[] { "", "\uD800\uDC00",
1533 new CompareUnboxed());
1534 success
&= testMapAny(transport
, new Type
[][] { new Type
[] {} },
1535 new CompareBoxed());
1536 success
&= testMapAny(transport
,
1541 DerivedInterface
.class.getName(),
1542 TypeClass
.INTERFACE
) } },
1543 new CompareBoxed());
1544 success
&= testMapAny(transport
,
1545 new Any(new Type(Type
[][].class),
1546 new Type
[][] { new Type
[] {} }),
1547 new CompareUnboxed());
1548 success
&= testMapAny(transport
,
1550 new Type(Type
[][].class),
1555 DerivedInterface
.class.
1557 TypeClass
.INTERFACE
) } }),
1558 new CompareUnboxed());
1559 success
&= testMapAny(transport
, new Object
[][] { new Object
[] {} },
1560 new CompareBoxed());
1561 success
&= testMapAny(transport
,
1563 new Object
[] { Any
.VOID
,
1565 new CompareBoxed());
1566 success
&= testMapAny(transport
,
1570 new Any(Type
.BOOLEAN
,
1572 new CompareBoxed(true));
1573 success
&= testMapAny(transport
,
1574 new Any(new Type(Any
[][].class),
1575 new Object
[][] { new Object
[] {} }),
1576 new CompareUnboxed());
1577 success
&= testMapAny(transport
,
1578 new Any(new Type(Any
[][].class),
1580 new Object
[] { Any
.VOID
,
1582 new CompareUnboxed());
1583 success
&= testMapAny(transport
,
1584 new Any(new Type(Any
[][].class),
1588 new Any(Type
.BOOLEAN
,
1590 new CompareUnboxed(true));
1591 success
&= testMapAny(transport
, new Any
[][] { new Any
[] {} },
1592 new CompareSpecific(
1593 new Object
[][] { new Object
[] {} }));
1594 success
&= testMapAny(transport
,
1596 new Any
[] { Any
.VOID
,
1597 new Any(Type
.BOOLEAN
,
1599 new CompareSpecific(
1601 new Object
[] { Any
.VOID
,
1603 success
&= testMapAny(transport
,
1604 new Any(new Type(Any
[][].class),
1605 new Any
[][] { new Any
[] {} }),
1606 new CompareSpecific(
1607 new Object
[][] { new Object
[] {} }));
1608 success
&= testMapAny(transport
,
1609 new Any(new Type(Any
[][].class),
1613 new Any(Type
.BOOLEAN
,
1615 new CompareSpecific(
1617 new Object
[] { Any
.VOID
,
1619 success
&= testMapAny(transport
,
1620 new Any(new Type(Any
[][].class),
1621 new Boolean
[][] { new Boolean
[] {} }),
1622 new CompareSpecific(
1623 new Object
[][] { new Object
[] {} }));
1624 success
&= testMapAny(transport
,
1625 new Any(new Type(Any
[][].class),
1629 new CompareSpecific(
1631 new Object
[] { Boolean
.FALSE
} }));
1633 success
&= testMapAny(transport
, new Enum1
[][] { new Enum1
[] {} },
1634 new CompareBoxed());
1635 success
&= testMapAny(transport
,
1637 new Enum1
[] { new Enum1(),
1639 new CompareSpecific(
1641 new Enum1
[] { new Enum1(),
1643 success
&= testMapAny(transport
,
1644 new Any(new Type(Enum1
[][].class),
1645 new Enum1
[][] { new Enum1
[] {} }),
1646 new CompareUnboxed());
1647 success
&= testMapAny(transport
,
1648 new Any(new Type(Enum1
[][].class),
1650 new Enum1
[] { new Enum1(),
1652 new CompareSpecific(
1654 new Enum1
[] { new Enum1(),
1656 success
&= testMapAny(transport
,
1657 new Any(new Type(Enum1
[][].class),
1658 new Enum2
[][] { new Enum2
[] {} }),
1659 new CompareSpecific(
1660 new Enum1
[][] { new Enum1
[] {} }));
1661 success
&= testMapAny(transport
,
1662 new Any(new Type(Enum1
[][].class),
1664 new Enum2
[] { new Enum2() } }),
1665 new CompareSpecific(
1667 new Enum1
[] { new Enum1() } }));
1668 success
&= testMapAny(transport
,
1669 new BaseStruct
[][] { new BaseStruct
[] {} },
1670 new CompareBoxed());
1671 success
&= testMapAny(transport
,
1672 new BaseStruct
[][] {
1675 new DerivedStruct() } },
1676 new CompareSpecific(
1677 new BaseStruct
[][] {
1680 new BaseStruct() } }));
1681 success
&= testMapAny(transport
,
1682 new Any(new Type(BaseStruct
[][].class),
1683 new BaseStruct
[][] {
1684 new BaseStruct
[] {} }),
1685 new CompareUnboxed());
1686 success
&= testMapAny(transport
,
1687 new Any(new Type(BaseStruct
[][].class),
1688 new BaseStruct
[][] {
1691 new DerivedStruct() } }),
1692 new CompareSpecific(
1693 new BaseStruct
[][] {
1696 new BaseStruct() } }));
1697 success
&= testMapAny(transport
,
1698 new Any(new Type(BaseStruct
[][].class),
1699 new DerivedStruct
[][] {
1700 new DerivedStruct
[] {} }),
1701 new CompareSpecific(
1702 new BaseStruct
[][] {
1703 new BaseStruct
[] {} }));
1704 success
&= testMapAny(transport
,
1705 new Any(new Type(BaseStruct
[][].class),
1706 new DerivedStruct
[][] {
1707 new DerivedStruct
[] {
1708 new DerivedStruct() } }),
1709 new CompareSpecific(
1710 new BaseStruct
[][] {
1712 new BaseStruct() } }));
1713 success
&= testMapAny(transport
,
1714 new DerivedStruct
[][] {
1715 new DerivedStruct
[] {} },
1716 new CompareBoxed());
1717 success
&= testMapAny(transport
,
1718 new DerivedStruct
[][] {
1719 new DerivedStruct
[] {
1720 new DerivedStruct() } },
1721 new CompareBoxed());
1722 success
&= testMapAny(transport
,
1723 new Any(new Type(DerivedStruct
[][].class),
1724 new DerivedStruct
[][] {
1725 new DerivedStruct
[] {} }),
1726 new CompareUnboxed());
1727 success
&= testMapAny(transport
,
1728 new Any(new Type(DerivedStruct
[][].class),
1729 new DerivedStruct
[][] {
1730 new DerivedStruct
[] {
1731 new DerivedStruct() } }),
1732 new CompareUnboxed());
1734 success
&= testMapAny(transport
,
1735 new XInterface
[][] { new XInterface
[] {} },
1736 new CompareBoxed());
1737 success
&= testMapAny(transport
,
1738 new XInterface
[][] {
1740 null, new XInterface() {},
1741 new BaseInterface() {},
1742 new DerivedInterface() {} } },
1743 new CompareBoxed());
1744 success
&= testMapAny(transport
,
1745 new Any(new Type(XInterface
[][].class),
1746 new XInterface
[][] {
1747 new XInterface
[] {} }),
1748 new CompareUnboxed());
1749 success
&= testMapAny(transport
,
1751 new Type(XInterface
[][].class),
1752 new XInterface
[][] {
1754 null, new XInterface() {},
1755 new BaseInterface() {},
1756 new DerivedInterface() {} } }),
1757 new CompareUnboxed());
1758 success
&= testMapAny(transport
,
1759 new Any(new Type(XInterface
[][].class),
1760 new Object
[][] { new Object
[] {} }),
1761 new CompareSpecific(
1762 new XInterface
[][] {
1763 new XInterface
[] {} }));
1765 XInterface if1
= new XInterface() {};
1766 XInterface if2
= new BaseInterface() {};
1767 XInterface if3
= new DerivedInterface() {};
1768 success
&= testMapAny(transport
,
1769 new Any(new Type(XInterface
[][].class),
1771 new Object
[] { null, if1
, if2
,
1773 new CompareSpecific(
1774 new XInterface
[][] {
1775 new XInterface
[] { null, if1
, if2
,
1778 success
&= testMapAny(transport
,
1779 new Any(new Type(XInterface
[][].class),
1780 new BaseInterface
[][] {
1781 new BaseInterface
[] {} }),
1782 new CompareSpecific(
1783 new XInterface
[][] {
1784 new XInterface
[] {} }));
1786 BaseInterface if1
= new BaseInterface() {};
1787 BaseInterface if2
= new DerivedInterface() {};
1788 success
&= testMapAny(transport
,
1789 new Any(new Type(XInterface
[][].class),
1790 new BaseInterface
[][] {
1791 new BaseInterface
[] {
1792 null, if1
, if2
} }),
1793 new CompareSpecific(
1794 new XInterface
[][] {
1796 null, if1
, if2
} }));
1798 success
&= testMapAny(transport
,
1799 new Any(new Type(XInterface
[][].class),
1800 new DerivedInterface
[][] {
1801 new DerivedInterface
[] {} }),
1802 new CompareSpecific(
1803 new XInterface
[][] {
1804 new XInterface
[] {} }));
1806 DerivedInterface if1
= new DerivedInterface() {};
1807 success
&= testMapAny(transport
,
1808 new Any(new Type(XInterface
[][].class),
1809 new DerivedInterface
[][] {
1810 new DerivedInterface
[] {
1812 new CompareSpecific(
1813 new XInterface
[][] {
1817 success
&= testMapAny(transport
,
1818 new BaseInterface
[][] {
1819 new BaseInterface
[] {} },
1820 new CompareBoxed());
1821 success
&= testMapAny(transport
,
1822 new BaseInterface
[][] {
1823 new BaseInterface
[] {
1824 null, new BaseInterface() {},
1825 new DerivedInterface() {} } },
1826 new CompareBoxed());
1827 success
&= testMapAny(transport
,
1828 new Any(new Type(BaseInterface
[][].class),
1829 new BaseInterface
[][] {
1830 new BaseInterface
[] {} }),
1831 new CompareUnboxed());
1832 success
&= testMapAny(transport
,
1834 new Type(BaseInterface
[][].class),
1835 new BaseInterface
[][] {
1836 new BaseInterface
[] {
1837 null, new BaseInterface() {},
1838 new DerivedInterface() {} } }),
1839 new CompareUnboxed());
1840 success
&= testMapAny(transport
,
1841 new Any(new Type(BaseInterface
[][].class),
1842 new DerivedInterface
[][] {
1843 new DerivedInterface
[] {} }),
1844 new CompareSpecific(
1845 new BaseInterface
[][] {
1846 new BaseInterface
[] {} }));
1848 DerivedInterface if1
= new DerivedInterface() {};
1849 success
&= testMapAny(transport
,
1850 new Any(new Type(BaseInterface
[][].class),
1851 new DerivedInterface
[][] {
1852 new DerivedInterface
[] {
1854 new CompareSpecific(
1855 new BaseInterface
[][] {
1856 new BaseInterface
[] {
1859 success
&= testMapAny(transport
,
1860 new DerivedInterface
[][] {
1861 new DerivedInterface
[] {} },
1862 new CompareBoxed());
1863 success
&= testMapAny(transport
,
1864 new DerivedInterface
[][] {
1865 new DerivedInterface
[] {
1866 null, new DerivedInterface() {} } },
1867 new CompareBoxed());
1868 success
&= testMapAny(transport
,
1869 new Any(new Type(DerivedInterface
[][].class),
1870 new DerivedInterface
[][] {
1871 new DerivedInterface
[] {} }),
1872 new CompareUnboxed());
1873 success
&= testMapAny(transport
,
1875 new Type(DerivedInterface
[][].class),
1876 new DerivedInterface
[][] {
1877 new DerivedInterface
[] {
1879 new DerivedInterface() {} } }),
1880 new CompareUnboxed());
1884 success
&= testMapAny(transport
, new Enum1(), new CompareBoxed());
1885 success
&= testMapAny(transport
, new Any(new Type(Enum1
.class),
1887 new CompareUnboxed());
1888 success
&= testMapAny(transport
, new Any(new Type(Enum1
.class),
1890 new CompareSpecific(new Enum1()));
1895 success
&= testMapAny(transport
, new BaseStruct(),
1896 new CompareBoxed());
1897 success
&= testMapAny(transport
,
1898 new Any(new Type(BaseStruct
.class),
1900 new CompareUnboxed());
1901 success
&= testMapAny(transport
,
1902 new Any(new Type(BaseStruct
.class),
1903 new DerivedStruct()),
1904 new CompareSpecific(new BaseStruct()));
1905 success
&= testMapAny(transport
, new DerivedStruct(),
1906 new CompareBoxed());
1907 success
&= testMapAny(transport
,
1908 new Any(new Type(DerivedStruct
.class),
1909 new DerivedStruct()),
1910 new CompareUnboxed());
1914 success
&= testMapAny(transport
, new com
.sun
.star
.uno
.Exception(),
1916 com
.sun
.star
.uno
.Exception
.class));
1917 success
&= testMapAny(transport
,
1919 com
.sun
.star
.uno
.Exception
.class),
1920 new com
.sun
.star
.uno
.Exception()),
1922 com
.sun
.star
.uno
.Exception
.class));
1923 success
&= testMapAny(transport
,
1925 com
.sun
.star
.uno
.Exception
.class),
1926 new BaseException()),
1928 com
.sun
.star
.uno
.Exception
.class));
1929 success
&= testMapAny(transport
,
1931 com
.sun
.star
.uno
.Exception
.class),
1932 new DerivedException()),
1934 com
.sun
.star
.uno
.Exception
.class));
1936 success
&= testMapAny(transport
, new BaseException(),
1937 new CompareBoxed());
1938 success
&= testMapAny(transport
,
1939 new Any(new Type(BaseException
.class),
1940 new BaseException()),
1941 new CompareUnboxed());
1942 success
&= testMapAny(transport
,
1943 new Any(new Type(BaseException
.class),
1944 new DerivedException()),
1945 new CompareSpecific(new BaseException()));
1946 success
&= testMapAny(transport
, new DerivedException(),
1947 new CompareBoxed());
1948 success
&= testMapAny(transport
,
1949 new Any(new Type(DerivedException
.class),
1950 new DerivedException()),
1951 new CompareUnboxed());
1953 success
&= testMapAny(transport
,
1954 new com
.sun
.star
.uno
.RuntimeException(),
1956 com
.sun
.star
.uno
.RuntimeException
.class));
1957 success
&= testMapAny(transport
,
1960 com
.sun
.star
.uno
.RuntimeException
.
1962 new com
.sun
.star
.uno
.RuntimeException()),
1964 com
.sun
.star
.uno
.RuntimeException
.class));
1965 success
&= testMapAny(transport
,
1968 com
.sun
.star
.uno
.RuntimeException
.
1970 new BaseRuntimeException()),
1972 com
.sun
.star
.uno
.RuntimeException
.class));
1973 success
&= testMapAny(transport
,
1976 com
.sun
.star
.uno
.RuntimeException
.
1978 new DerivedRuntimeException()),
1980 com
.sun
.star
.uno
.RuntimeException
.class));
1982 success
&= testMapAny(transport
, new BaseRuntimeException(),
1983 new CompareBoxed());
1984 success
&= testMapAny(transport
,
1986 BaseRuntimeException
.class),
1987 new BaseRuntimeException()),
1988 new CompareUnboxed());
1989 success
&= testMapAny(transport
,
1991 BaseRuntimeException
.class),
1992 new DerivedRuntimeException()),
1993 new CompareSpecific(
1994 new BaseRuntimeException()));
1995 success
&= testMapAny(transport
, new DerivedRuntimeException(),
1996 new CompareBoxed());
1997 success
&= testMapAny(transport
,
1999 DerivedRuntimeException
.class),
2000 new DerivedRuntimeException()),
2001 new CompareUnboxed());
2005 success
&= testMapAny(transport
, null, new CompareBoxed());
2006 success
&= testMapAny(transport
, new XInterface() {},
2007 new CompareBoxed());
2008 success
&= testMapAny(transport
, new BaseInterface() {},
2009 new CompareBoxed());
2010 success
&= testMapAny(transport
, new DerivedInterface() {},
2011 new CompareBoxed());
2012 success
&= testMapAny(transport
,
2013 new Any(new Type(XInterface
.class), null),
2014 new CompareUnboxed());
2015 success
&= testMapAny(transport
,
2016 new Any(new Type(XInterface
.class),
2017 new XInterface() {}),
2018 new CompareUnboxed());
2019 success
&= testMapAny(transport
,
2020 new Any(new Type(XInterface
.class),
2021 new BaseInterface() {}),
2022 new CompareUnboxed());
2023 success
&= testMapAny(transport
,
2024 new Any(new Type(XInterface
.class),
2025 new DerivedInterface() {}),
2026 new CompareUnboxed());
2027 success
&= testMapAny(transport
,
2028 new Any(new Type(BaseInterface
.class), null),
2029 new CompareBoxed());
2030 success
&= testMapAny(transport
,
2031 new Any(new Type(BaseInterface
.class),
2032 new BaseInterface() {}),
2033 new CompareBoxed());
2034 success
&= testMapAny(transport
,
2035 new Any(new Type(BaseInterface
.class),
2036 new DerivedInterface() {}),
2037 new CompareBoxed());
2038 success
&= testMapAny(transport
,
2039 new Any(new Type(DerivedInterface
.class),
2041 new CompareBoxed());
2042 success
&= testMapAny(transport
,
2043 new Any(new Type(DerivedInterface
.class),
2044 new DerivedInterface() {}),
2045 new CompareBoxed());
2049 transport
.mapAny(new Object());
2050 System
.out
.println("BAD mapAny(Object), no exception");
2052 } catch (StackOverflowError e
) {
2053 System
.out
.println("BAD mapAny(Object): " + e
);
2055 } catch (RuntimeException e
) {}
2060 private TestAny() {} // do not instantiate
2062 private static boolean testType(Class zclass
, TypeClass tclass
,
2064 Type t1
= new Type(zclass
);
2065 Type t2
= new Type(tname
, tclass
);
2067 if (t1
.getTypeClass() != tclass
) {
2069 System
.out
.println("BAD Type(" + zclass
+ ").getTypeClass() = "
2070 + t1
.getTypeClass() + " != " + tclass
);
2072 if (!t1
.getTypeName().equals(tname
)) {
2074 System
.out
.println("BAD Type(" + zclass
+ ").getTypeName() = "
2075 + t1
.getTypeName() + " != " + tname
);
2077 if (!t1
.equals(t2
)) {
2079 System
.out
.println("BAD Type(" + zclass
+ ") != Type(" + tname
2080 + ", " + tclass
+ ")");
2085 private static boolean testMapAny(XTransport transport
, Object any
,
2087 Object any2
= transport
.mapAny(any
);
2088 boolean eq
= compare
.equal(any
, any2
);
2090 System
.out
.println("BAD mapAny(" + any
+ ") -> " + any2
);
2095 private static abstract class Compare
{
2096 public abstract boolean equal(Object o1
, Object o2
);
2099 private static final class CompareBoxed
extends Compare
{
2100 public CompareBoxed() {
2104 public CompareBoxed(boolean unboxInner
) {
2105 this.unboxInner
= unboxInner
;
2108 public boolean equal(Object o1
, Object o2
) {
2109 if (o1
instanceof Any
) {
2110 return o2
instanceof Any
2111 && ((Any
) o1
).getType().equals(((Any
) o2
).getType())
2112 && equalValues(((Any
) o1
).getObject(),
2113 ((Any
) o2
).getObject());
2115 return equalValues(o1
, o2
);
2119 private boolean equalValues(Object o1
, Object o2
) {
2122 } else if (o1
.getClass().isArray()) {
2123 if (!(o2
!= null && o1
.getClass() == o2
.getClass()
2124 && Array
.getLength(o1
) == Array
.getLength(o2
))) {
2127 for (int i
= 0; i
< Array
.getLength(o1
); ++i
) {
2128 Object oo1
= Array
.get(o1
, i
);
2129 if (unboxInner
&& oo1
instanceof Any
) {
2130 oo1
= ((Any
) oo1
).getObject();
2132 if (!equal(oo1
, Array
.get(o2
, i
))) {
2138 return o1
.equals(o2
);
2142 private final boolean unboxInner
;
2145 private static final class CompareUnboxed
extends Compare
{
2146 public CompareUnboxed() {
2150 public CompareUnboxed(boolean unboxInner
) {
2151 this.unboxInner
= unboxInner
;
2154 public boolean equal(Object o1
, Object o2
) {
2155 return new CompareBoxed(unboxInner
).equal(((Any
) o1
).getObject(),
2159 private final boolean unboxInner
;
2162 private static final class CompareSpecific
extends Compare
{
2163 public CompareSpecific(Object specific
) {
2164 this.specific
= specific
;
2167 public boolean equal(Object o1
, Object o2
) {
2168 return new CompareBoxed().equal(specific
, o2
);
2171 private final Object specific
;
2174 private static final class CompareClass
extends Compare
{
2175 public CompareClass(Class clazz
) {
2179 public boolean equal(Object o1
, Object o2
) {
2180 return o2
!= null && o2
.getClass() == clazz
;
2183 private final Class clazz
;
2186 public static class Enum1
extends Enum
{
2191 public static Enum1
fromInt(int value
) {
2195 public boolean equals(Object obj
) {
2196 return obj
!= null && obj
.getClass() == Enum1
.class;
2200 public static class Enum2
extends Enum1
{
2201 public boolean equals(Object obj
) {
2202 return obj
!= null && obj
.getClass() == Enum2
.class;
2206 public static class BaseStruct
{
2207 public boolean equals(Object obj
) {
2208 return obj
!= null && obj
.getClass() == BaseStruct
.class;
2212 public static class DerivedStruct
extends BaseStruct
{
2213 public boolean equals(Object obj
) {
2214 return obj
!= null && obj
.getClass() == DerivedStruct
.class;
2218 public static class BaseException
extends com
.sun
.star
.uno
.Exception
{
2219 public BaseException() {}
2221 public BaseException(String message
) {
2225 public boolean equals(Object obj
) {
2226 return obj
!= null && obj
.getClass() == BaseException
.class;
2230 public static class DerivedException
extends BaseException
{
2231 public DerivedException() {}
2233 public DerivedException(String message
) {
2237 public boolean equals(Object obj
) {
2238 return obj
!= null && obj
.getClass() == DerivedException
.class;
2242 public static class BaseRuntimeException
2243 extends com
.sun
.star
.uno
.RuntimeException
2245 public BaseRuntimeException() {}
2247 public BaseRuntimeException(String message
) {
2251 public boolean equals(Object obj
) {
2253 && obj
.getClass() == BaseRuntimeException
.class;
2257 public static class DerivedRuntimeException
extends BaseRuntimeException
2259 public DerivedRuntimeException() {}
2261 public DerivedRuntimeException(String message
) {
2265 public boolean equals(Object obj
) {
2267 && obj
.getClass() == DerivedRuntimeException
.class;