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: cppobj.cxx,v $
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 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_testtools.hxx"
35 #include "cppu/unotype.hxx"
36 #include <osl/diagnose.h>
37 #include "osl/diagnose.hxx"
38 #include <osl/thread.h>
39 #include <osl/mutex.hxx>
42 #include <cppuhelper/implbase3.hxx>
43 #include <cppuhelper/factory.hxx>
44 #include "cppuhelper/exc_hlp.hxx"
45 #include "cppuhelper/compbase_ex.hxx"
46 #include <com/sun/star/lang/XServiceInfo.hpp>
47 #include <com/sun/star/lang/XComponent.hpp>
48 #include <com/sun/star/registry/XRegistryKey.hpp>
49 #include "com/sun/star/uno/Any.hxx"
50 #include "com/sun/star/uno/RuntimeException.hpp"
51 #include "com/sun/star/uno/Sequence.hxx"
53 #include "test/testtools/bridgetest/Constructors.hpp"
54 #include "test/testtools/bridgetest/Constructors2.hpp"
55 #include "test/testtools/bridgetest/TestPolyStruct.hpp"
56 #include "test/testtools/bridgetest/TestPolyStruct2.hpp"
57 #include "test/testtools/bridgetest/XBridgeTest2.hpp"
58 #include "test/testtools/bridgetest/XMulti.hpp"
60 #include "currentcontextchecker.hxx"
66 using namespace com::sun::star::uno
;
67 using namespace com::sun::star::lang
;
68 using namespace com::sun::star::registry
;
69 using namespace test::testtools::bridgetest
;
71 #define SERVICENAME "com.sun.star.test.bridge.CppTestObject"
72 #define IMPLNAME "com.sun.star.comp.bridge.CppTestObject"
74 namespace bridge_object
77 //--------------------------------------------------------------------------------------------------
78 inline static Sequence
< OUString
> getSupportedServiceNames()
80 OUString
aName( RTL_CONSTASCII_USTRINGPARAM(SERVICENAME
) );
81 return Sequence
< OUString
>( &aName
, 1 );
84 //==================================================================================================
85 static void assign( TestElement
& rData
,
86 sal_Bool bBool
, sal_Unicode cChar
, sal_Int8 nByte
,
87 sal_Int16 nShort
, sal_uInt16 nUShort
,
88 sal_Int32 nLong
, sal_uInt32 nULong
,
89 sal_Int64 nHyper
, sal_uInt64 nUHyper
,
90 float fFloat
, double fDouble
,
91 TestEnum eEnum
, const ::rtl::OUString
& rStr
,
92 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xTest
,
93 const ::com::sun::star::uno::Any
& rAny
)
99 rData
.UShort
= nUShort
;
101 rData
.ULong
= nULong
;
102 rData
.Hyper
= nHyper
;
103 rData
.UHyper
= nUHyper
;
104 rData
.Float
= fFloat
;
105 rData
.Double
= fDouble
;
108 rData
.Interface
= xTest
;
111 //==================================================================================================
112 static void assign( TestData
& rData
,
113 sal_Bool bBool
, sal_Unicode cChar
, sal_Int8 nByte
,
114 sal_Int16 nShort
, sal_uInt16 nUShort
,
115 sal_Int32 nLong
, sal_uInt32 nULong
,
116 sal_Int64 nHyper
, sal_uInt64 nUHyper
,
117 float fFloat
, double fDouble
,
118 TestEnum eEnum
, const ::rtl::OUString
& rStr
,
119 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xTest
,
120 const ::com::sun::star::uno::Any
& rAny
,
121 const com::sun::star::uno::Sequence
< TestElement
>& rSequence
)
123 assign( (TestElement
&)rData
,
124 bBool
, cChar
, nByte
, nShort
, nUShort
, nLong
, nULong
, nHyper
, nUHyper
, fFloat
, fDouble
,
125 eEnum
, rStr
, xTest
, rAny
);
126 rData
.Sequence
= rSequence
;
129 //==================================================================================================
131 protected osl::DebugBase
<Test_Impl
>,
132 public WeakImplHelper3
< XBridgeTest2
, XServiceInfo
, XRecursiveCall
>
134 TestData _aData
, _aStructData
;
135 sal_Int32 m_nLastCallId
;
136 sal_Bool m_bFirstCall
;
137 sal_Bool m_bSequenceOfCallTestPassed
;
140 Sequence
<sal_Bool
> _arBool
;
141 Sequence
<sal_Unicode
> _arChar
;
142 Sequence
<sal_Int8
> _arByte
;
143 Sequence
<sal_Int16
> _arShort
;
144 Sequence
<sal_uInt16
> _arUShort
;
145 Sequence
<sal_Int32
> _arLong
;
146 Sequence
<sal_uInt32
> _arULong
;
147 Sequence
<sal_Int64
> _arHyper
;
148 Sequence
<sal_uInt64
> _arUHyper
;
149 Sequence
<OUString
> _arString
;
150 Sequence
<float> _arFloat
;
151 Sequence
<double> _arDouble
;
152 Sequence
<TestEnum
> _arEnum
;
153 Sequence
<Reference
<XInterface
> > _arObject
;
154 Sequence
<Sequence
<sal_Int32
> > _arLong2
;
155 Sequence
<Sequence
<Sequence
<sal_Int32
> > > _arLong3
;
156 Sequence
<Any
> _arAny
;
157 Sequence
<TestElement
> _arStruct
;
160 Test_Impl() : m_nLastCallId( 0 ),
161 m_bFirstCall( sal_True
),
162 m_bSequenceOfCallTestPassed( sal_True
)
166 OSL_TRACE( "> scalar Test_Impl dtor <\n" );
169 void SAL_CALL
acquire() throw ()
171 OWeakObject::acquire();
173 void SAL_CALL
release() throw ()
175 OWeakObject::release();
179 virtual OUString SAL_CALL
getImplementationName() throw (RuntimeException
);
180 virtual sal_Bool SAL_CALL
supportsService( const OUString
& rServiceName
) throw (RuntimeException
);
181 virtual Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw (RuntimeException
);
184 virtual void SAL_CALL
setValues( sal_Bool bBool
, sal_Unicode cChar
, sal_Int8 nByte
,
185 sal_Int16 nShort
, sal_uInt16 nUShort
,
186 sal_Int32 nLong
, sal_uInt32 nULong
,
187 sal_Int64 nHyper
, sal_uInt64 nUHyper
,
188 float fFloat
, double fDouble
,
189 TestEnum eEnum
, const ::rtl::OUString
& rStr
,
190 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xTest
,
191 const ::com::sun::star::uno::Any
& rAny
,
192 const ::com::sun::star::uno::Sequence
<TestElement
>& rSequence
,
193 const TestData
& rStruct
)
194 throw(com::sun::star::uno::RuntimeException
);
196 virtual TestData SAL_CALL
setValues2( sal_Bool
& bBool
, sal_Unicode
& cChar
, sal_Int8
& nByte
,
197 sal_Int16
& nShort
, sal_uInt16
& nUShort
,
198 sal_Int32
& nLong
, sal_uInt32
& nULong
,
199 sal_Int64
& nHyper
, sal_uInt64
& nUHyper
,
200 float& fFloat
, double& fDouble
,
201 TestEnum
& eEnum
, rtl::OUString
& rStr
,
202 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xTest
,
203 ::com::sun::star::uno::Any
& rAny
,
204 ::com::sun::star::uno::Sequence
<TestElement
>& rSequence
,
206 throw(com::sun::star::uno::RuntimeException
);
208 virtual TestData SAL_CALL
getValues( sal_Bool
& bBool
, sal_Unicode
& cChar
, sal_Int8
& nByte
,
209 sal_Int16
& nShort
, sal_uInt16
& nUShort
,
210 sal_Int32
& nLong
, sal_uInt32
& nULong
,
211 sal_Int64
& nHyper
, sal_uInt64
& nUHyper
,
212 float& fFloat
, double& fDouble
,
213 TestEnum
& eEnum
, rtl::OUString
& rStr
,
214 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xTest
,
215 ::com::sun::star::uno::Any
& rAny
,
216 ::com::sun::star::uno::Sequence
< TestElement
>& rSequence
,
218 throw(com::sun::star::uno::RuntimeException
);
220 virtual sal_Bool SAL_CALL
getBool() throw(com::sun::star::uno::RuntimeException
)
221 { return _aData
.Bool
; }
222 virtual sal_Int8 SAL_CALL
getByte() throw(com::sun::star::uno::RuntimeException
)
223 { return _aData
.Byte
; }
224 virtual sal_Unicode SAL_CALL
getChar() throw(com::sun::star::uno::RuntimeException
)
225 { return _aData
.Char
; }
226 virtual sal_Int16 SAL_CALL
getShort() throw(com::sun::star::uno::RuntimeException
)
227 { return _aData
.Short
; }
228 virtual sal_uInt16 SAL_CALL
getUShort() throw(com::sun::star::uno::RuntimeException
)
229 { return _aData
.UShort
; }
230 virtual sal_Int32 SAL_CALL
getLong() throw(com::sun::star::uno::RuntimeException
)
231 { return _aData
.Long
; }
232 virtual sal_uInt32 SAL_CALL
getULong() throw(com::sun::star::uno::RuntimeException
)
233 { return _aData
.ULong
; }
234 virtual sal_Int64 SAL_CALL
getHyper() throw(com::sun::star::uno::RuntimeException
)
235 { return _aData
.Hyper
; }
236 virtual sal_uInt64 SAL_CALL
getUHyper() throw(com::sun::star::uno::RuntimeException
)
237 { return _aData
.UHyper
; }
238 virtual float SAL_CALL
getFloat() throw(com::sun::star::uno::RuntimeException
)
239 { return _aData
.Float
; }
240 virtual double SAL_CALL
getDouble() throw(com::sun::star::uno::RuntimeException
)
241 { return _aData
.Double
; }
242 virtual TestEnum SAL_CALL
getEnum() throw(com::sun::star::uno::RuntimeException
)
243 { return _aData
.Enum
; }
244 virtual rtl::OUString SAL_CALL
getString() throw(com::sun::star::uno::RuntimeException
)
245 { return _aData
.String
; }
246 virtual com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getInterface( ) throw(com::sun::star::uno::RuntimeException
)
247 { return _aData
.Interface
; }
248 virtual com::sun::star::uno::Any SAL_CALL
getAny() throw(com::sun::star::uno::RuntimeException
)
249 { return _aData
.Any
; }
250 virtual com::sun::star::uno::Sequence
< TestElement
> SAL_CALL
getSequence() throw(com::sun::star::uno::RuntimeException
)
251 { return _aData
.Sequence
; }
252 virtual TestData SAL_CALL
getStruct() throw(com::sun::star::uno::RuntimeException
)
253 { return _aStructData
; }
255 virtual void SAL_CALL
setBool( sal_Bool _bool
) throw(::com::sun::star::uno::RuntimeException
)
256 { _aData
.Bool
= _bool
; }
257 virtual void SAL_CALL
setByte( sal_Int8 _byte
) throw(::com::sun::star::uno::RuntimeException
)
258 { _aData
.Byte
= _byte
; }
259 virtual void SAL_CALL
setChar( sal_Unicode _char
) throw(::com::sun::star::uno::RuntimeException
)
260 { _aData
.Char
= _char
; }
261 virtual void SAL_CALL
setShort( sal_Int16 _short
) throw(::com::sun::star::uno::RuntimeException
)
262 { _aData
.Short
= _short
; }
263 virtual void SAL_CALL
setUShort( sal_uInt16 _ushort
) throw(::com::sun::star::uno::RuntimeException
)
264 { _aData
.UShort
= _ushort
; }
265 virtual void SAL_CALL
setLong( sal_Int32 _long
) throw(::com::sun::star::uno::RuntimeException
)
266 { _aData
.Long
= _long
; }
267 virtual void SAL_CALL
setULong( sal_uInt32 _ulong
) throw(::com::sun::star::uno::RuntimeException
)
268 { _aData
.ULong
= _ulong
; }
269 virtual void SAL_CALL
setHyper( sal_Int64 _hyper
) throw(::com::sun::star::uno::RuntimeException
)
270 { _aData
.Hyper
= _hyper
; }
271 virtual void SAL_CALL
setUHyper( sal_uInt64 _uhyper
) throw(::com::sun::star::uno::RuntimeException
)
272 { _aData
.UHyper
= _uhyper
; }
273 virtual void SAL_CALL
setFloat( float _float
) throw(::com::sun::star::uno::RuntimeException
)
274 { _aData
.Float
= _float
; }
275 virtual void SAL_CALL
setDouble( double _double
) throw(::com::sun::star::uno::RuntimeException
)
276 { _aData
.Double
= _double
; }
277 virtual void SAL_CALL
setEnum( TestEnum _enum
) throw(::com::sun::star::uno::RuntimeException
)
278 { _aData
.Enum
= _enum
; }
279 virtual void SAL_CALL
setString( const ::rtl::OUString
& _string
) throw(::com::sun::star::uno::RuntimeException
)
280 { _aData
.String
= _string
; }
281 virtual void SAL_CALL
setInterface( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _interface
) throw(::com::sun::star::uno::RuntimeException
)
282 { _aData
.Interface
= _interface
; }
283 virtual void SAL_CALL
setAny( const ::com::sun::star::uno::Any
& _any
) throw(::com::sun::star::uno::RuntimeException
)
284 { _aData
.Any
= _any
; }
285 virtual void SAL_CALL
setSequence( const ::com::sun::star::uno::Sequence
<TestElement
>& _sequence
) throw(::com::sun::star::uno::RuntimeException
)
286 { _aData
.Sequence
= _sequence
; }
287 virtual void SAL_CALL
setStruct( const TestData
& _struct
) throw(::com::sun::star::uno::RuntimeException
)
288 { _aStructData
= _struct
; }
290 virtual sal_Int32 SAL_CALL
getRaiseAttr1() throw (RuntimeException
)
291 { throw RuntimeException(); }
293 virtual void SAL_CALL
setRaiseAttr1(sal_Int32
)
294 throw (IllegalArgumentException
, RuntimeException
)
295 { throw IllegalArgumentException(); }
297 virtual sal_Int32 SAL_CALL
getRaiseAttr2()
298 throw (IllegalArgumentException
, RuntimeException
)
299 { throw IllegalArgumentException(); }
301 virtual TestPolyStruct
< sal_Bool
> SAL_CALL
transportPolyBoolean(
302 TestPolyStruct
< sal_Bool
> const & arg
) throw (RuntimeException
)
305 virtual void SAL_CALL
transportPolyHyper(TestPolyStruct
< sal_Int64
> &)
306 throw (RuntimeException
) {}
308 virtual void SAL_CALL
transportPolySequence(
309 TestPolyStruct
< Sequence
< Any
> > const & arg1
,
310 TestPolyStruct
< Sequence
< Any
> > & arg2
) throw (RuntimeException
)
313 virtual TestPolyStruct
< sal_Int32
> SAL_CALL
getNullPolyLong()
314 throw (RuntimeException
)
315 { return TestPolyStruct
< sal_Int32
>(0); /* work around MS compiler bug */ }
317 virtual TestPolyStruct
< rtl::OUString
> SAL_CALL
getNullPolyString()
318 throw (RuntimeException
)
319 { return TestPolyStruct
< rtl::OUString
>(); }
321 virtual TestPolyStruct
< Type
> SAL_CALL
getNullPolyType()
322 throw (RuntimeException
)
323 { return TestPolyStruct
< Type
>(); }
325 virtual TestPolyStruct
< Any
> SAL_CALL
getNullPolyAny()
326 throw (RuntimeException
)
327 { return TestPolyStruct
< Any
>(); }
329 virtual TestPolyStruct
< Sequence
< sal_Bool
> > SAL_CALL
330 getNullPolySequence() throw (RuntimeException
)
331 { return TestPolyStruct
< Sequence
< sal_Bool
> >(); }
333 virtual TestPolyStruct
< TestEnum
> SAL_CALL
getNullPolyEnum()
334 throw (RuntimeException
)
335 { return TestPolyStruct
< TestEnum
>(
336 test::testtools::bridgetest::TestEnum_TEST
);
337 /* work around MS compiler bug */ }
339 virtual TestPolyStruct
< TestBadEnum
> SAL_CALL
getNullPolyBadEnum()
340 throw (RuntimeException
)
341 { return TestPolyStruct
< TestBadEnum
>(
342 test::testtools::bridgetest::TestBadEnum_M
);
343 /* explicitly instantiate with default enumerator */ }
345 virtual TestPolyStruct
< TestStruct
> SAL_CALL
getNullPolyStruct()
346 throw (RuntimeException
)
347 { return TestPolyStruct
< TestStruct
>(); }
349 virtual TestPolyStruct
< Reference
< XBridgeTestBase
> > SAL_CALL
350 getNullPolyInterface() throw (RuntimeException
)
351 { return TestPolyStruct
< Reference
< XBridgeTestBase
> >(); }
353 virtual ::com::sun::star::uno::Any SAL_CALL
transportAny(
354 const ::com::sun::star::uno::Any
& value
)
355 throw(::com::sun::star::uno::RuntimeException
);
357 virtual void SAL_CALL
call( sal_Int32 nCallId
, sal_Int32 nWaitMUSEC
)
358 throw(::com::sun::star::uno::RuntimeException
);
359 virtual void SAL_CALL
callOneway( sal_Int32 nCallId
, sal_Int32 nWaitMUSEC
)
360 throw(::com::sun::star::uno::RuntimeException
);
361 virtual sal_Bool SAL_CALL
sequenceOfCallTestPassed( )
362 throw(::com::sun::star::uno::RuntimeException
);
363 virtual void SAL_CALL
startRecursiveCall(
364 const ::com::sun::star::uno::Reference
< XRecursiveCall
>& xCall
, sal_Int32 nToCall
)
365 throw(::com::sun::star::uno::RuntimeException
);
367 virtual Reference
< XMulti
> SAL_CALL
getMulti() throw (RuntimeException
);
369 virtual rtl::OUString SAL_CALL
testMulti(Reference
< XMulti
> const & multi
)
370 throw (RuntimeException
);
372 public: // XBridgeTest
373 virtual TestData SAL_CALL
raiseException( sal_Int16 nArgumentPos
, const OUString
& rMsg
, const Reference
< XInterface
> & xCOntext
)
374 throw(::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
376 virtual void SAL_CALL
raiseRuntimeExceptionOneway(
377 const ::rtl::OUString
& Message
, const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& Context
)
378 throw(::com::sun::star::uno::RuntimeException
);
380 virtual sal_Int32 SAL_CALL
getRuntimeException() throw(::com::sun::star::uno::RuntimeException
);
381 virtual void SAL_CALL
setRuntimeException( sal_Int32 _runtimeexception
) throw(::com::sun::star::uno::RuntimeException
);
384 virtual Sequence
< sal_Bool
> SAL_CALL
setSequenceBool(
385 const Sequence
< sal_Bool
>& aSeq
) throw (RuntimeException
);
386 virtual Sequence
< sal_Unicode
> SAL_CALL
setSequenceChar(
387 const Sequence
< sal_Unicode
>& aSeq
) throw (RuntimeException
);
388 virtual Sequence
< sal_Int8
> SAL_CALL
setSequenceByte(
389 const Sequence
< sal_Int8
>& aSeq
) throw (RuntimeException
);
390 virtual Sequence
< sal_Int16
> SAL_CALL
setSequenceShort(
391 const Sequence
< sal_Int16
>& aSeq
) throw (RuntimeException
);
392 virtual Sequence
< sal_uInt16
> SAL_CALL
setSequenceUShort(
393 const Sequence
< sal_uInt16
>& aSeq
) throw (RuntimeException
);
394 virtual Sequence
< sal_Int32
> SAL_CALL
setSequenceLong(
395 const Sequence
< sal_Int32
>& aSeq
) throw (RuntimeException
);
396 virtual Sequence
< sal_uInt32
> SAL_CALL
setSequenceULong(
397 const Sequence
< sal_uInt32
>& aSeq
) throw (RuntimeException
);
398 virtual Sequence
< sal_Int64
> SAL_CALL
setSequenceHyper(
399 const Sequence
< sal_Int64
>& aSeq
) throw (RuntimeException
);
400 virtual Sequence
< sal_uInt64
> SAL_CALL
setSequenceUHyper(
401 const Sequence
< sal_uInt64
>& aSeq
) throw (RuntimeException
);
402 virtual Sequence
< float > SAL_CALL
setSequenceFloat(
403 const Sequence
< float >& aSeq
) throw (RuntimeException
);
404 virtual Sequence
< double > SAL_CALL
setSequenceDouble(
405 const Sequence
< double >& aSeq
) throw (RuntimeException
);
406 virtual Sequence
< TestEnum
> SAL_CALL
setSequenceEnum(
407 const Sequence
< TestEnum
>& aSeq
) throw (RuntimeException
) ;
408 virtual Sequence
< OUString
> SAL_CALL
setSequenceString(
409 const Sequence
< OUString
>& aString
) throw (RuntimeException
);
410 virtual Sequence
< Reference
< XInterface
> > SAL_CALL
setSequenceXInterface(
411 const Sequence
< Reference
< XInterface
> >& aSeq
)
412 throw (RuntimeException
);
413 virtual Sequence
<Any
> SAL_CALL
setSequenceAny(
414 const Sequence
<Any
>& aSeq
) throw (RuntimeException
);
415 virtual Sequence
<TestElement
> SAL_CALL
setSequenceStruct(
416 const Sequence
< TestElement
>& aSeq
) throw (RuntimeException
);
417 virtual Sequence
< Sequence
< sal_Int32
> > SAL_CALL
setDim2(
418 const Sequence
<Sequence
< sal_Int32
> >& aSeq
) throw (RuntimeException
);
419 virtual Sequence
< Sequence
< Sequence
< sal_Int32
> > > SAL_CALL
setDim3(
420 const Sequence
< Sequence
< Sequence
< sal_Int32
> > >& aSeq
)
421 throw (RuntimeException
);
422 virtual void SAL_CALL
setSequencesInOut(Sequence
< sal_Bool
>& aSeqBoolean
,
423 Sequence
< sal_Unicode
>& aSeqChar
,
424 Sequence
< sal_Int8
>& aSeqByte
,
425 Sequence
< sal_Int16
>& aSeqShort
,
426 Sequence
< sal_uInt16
>& aSeqUShort
,
427 Sequence
< sal_Int32
>& aSeqLong
,
428 Sequence
< sal_uInt32
>& aSeqULong
,
429 Sequence
< sal_Int64
>& aSeqHyper
,
430 Sequence
< sal_uInt64
>& aSeqUHyper
,
431 Sequence
< float >& aSeqFloat
,
432 Sequence
< double >& aSeqDouble
,
433 Sequence
< TestEnum
>& aSeqTestEnum
,
434 Sequence
< OUString
>& aSeqString
,
435 Sequence
<Reference
<XInterface
> >& aSeqXInterface
,
436 Sequence
< Any
>& aSeqAny
,
437 Sequence
< Sequence
< sal_Int32
> >& aSeqDim2
,
438 Sequence
< Sequence
< Sequence
< sal_Int32
> > >& aSeqDim3
)
439 throw (RuntimeException
);
440 virtual void SAL_CALL
setSequencesOut( Sequence
< sal_Bool
>& aSeqBoolean
,
441 Sequence
< sal_Unicode
>& aSeqChar
,
442 Sequence
< sal_Int8
>& aSeqByte
,
443 Sequence
< sal_Int16
>& aSeqShort
,
444 Sequence
< sal_uInt16
>& aSeqUShort
,
445 Sequence
< sal_Int32
>& aSeqLong
,
446 Sequence
< sal_uInt32
>& aSeqULong
,
447 Sequence
< sal_Int64
>& aSeqHyper
,
448 Sequence
< sal_uInt64
>& aSeqUHyper
,
449 Sequence
< float >& aSeqFloat
,
450 Sequence
< double >& aSeqDouble
,
451 Sequence
< TestEnum
>& aSeqEnum
,
452 Sequence
< OUString
>& aSeqString
,
453 Sequence
< Reference
< XInterface
> >& aSeqXInterface
,
454 Sequence
< Any
>& aSeqAny
,
455 Sequence
< Sequence
< sal_Int32
> >& aSeqDim2
,
456 Sequence
< Sequence
< Sequence
< sal_Int32
> > >& aSeqDim3
)
457 throw (RuntimeException
);
458 virtual void SAL_CALL
testConstructorsService(
459 Reference
< XComponentContext
> const & context
)
460 throw (RuntimeException
);
461 virtual Reference
< XCurrentContextChecker
> SAL_CALL
462 getCurrentContextChecker()
463 throw (RuntimeException
);
466 virtual void SAL_CALL
callRecursivly( const ::com::sun::star::uno::Reference
< XRecursiveCall
>& xCall
, sal_Int32 nToCall
) throw(::com::sun::star::uno::RuntimeException
);
469 //Dummy class for XComponent implementation
470 class Dummy
: protected osl::DebugBase
<Dummy
>,
471 public WeakComponentImplHelperBase
474 Dummy(): WeakComponentImplHelperBase(*Mutex::getGlobalMutex()){}
477 //__________________________________________________________________________________________________
478 Any
Test_Impl::transportAny( const Any
& value
) throw ( ::com::sun::star::uno::RuntimeException
)
483 //__________________________________________________________________________________________________
484 void Test_Impl::call( sal_Int32 nCallId
, sal_Int32 nWaitMUSEC
) throw(::com::sun::star::uno::RuntimeException
)
486 TimeValue value
= { nWaitMUSEC
/ 1000000 , nWaitMUSEC
* 1000 };
487 osl_waitThread( &value
);
490 m_bFirstCall
= sal_False
;
494 m_bSequenceOfCallTestPassed
= m_bSequenceOfCallTestPassed
&& (nCallId
> m_nLastCallId
);
496 m_nLastCallId
= nCallId
;
499 //__________________________________________________________________________________________________
500 void Test_Impl::callOneway( sal_Int32 nCallId
, sal_Int32 nWaitMUSEC
) throw (::com::sun::star::uno::RuntimeException
)
502 TimeValue value
= { nWaitMUSEC
/ 1000000 , nWaitMUSEC
* 1000 };
503 osl_waitThread( &value
);
504 m_bSequenceOfCallTestPassed
= m_bSequenceOfCallTestPassed
&& (nCallId
> m_nLastCallId
);
505 m_nLastCallId
= nCallId
;
508 //__________________________________________________________________________________________________
509 sal_Bool
Test_Impl::sequenceOfCallTestPassed() throw (::com::sun::star::uno::RuntimeException
)
511 return m_bSequenceOfCallTestPassed
;
514 //__________________________________________________________________________________________________
515 void SAL_CALL
Test_Impl::startRecursiveCall(
516 const ::com::sun::star::uno::Reference
< XRecursiveCall
>& xCall
, sal_Int32 nToCall
)
517 throw(::com::sun::star::uno::RuntimeException
)
519 MutexGuard
guard( m_mutex
);
523 xCall
->callRecursivly( this , nToCall
);
528 void SAL_CALL
Test_Impl::callRecursivly(
529 const ::com::sun::star::uno::Reference
< XRecursiveCall
>& xCall
,
531 throw(::com::sun::star::uno::RuntimeException
)
533 MutexGuard
guard( m_mutex
);
537 xCall
->callRecursivly( this , nToCall
);
541 Reference
< XMulti
> Test_Impl::getMulti() throw (RuntimeException
) {
542 return new testtools::bridgetest::Multi
;
545 rtl::OUString
Test_Impl::testMulti(Reference
< XMulti
> const & multi
)
546 throw (RuntimeException
)
548 return testtools::bridgetest::testMulti(multi
);
551 //__________________________________________________________________________________________________
552 void Test_Impl::setValues( sal_Bool bBool
, sal_Unicode cChar
, sal_Int8 nByte
,
553 sal_Int16 nShort
, sal_uInt16 nUShort
,
554 sal_Int32 nLong
, sal_uInt32 nULong
,
555 sal_Int64 nHyper
, sal_uInt64 nUHyper
,
556 float fFloat
, double fDouble
,
557 TestEnum eEnum
, const ::rtl::OUString
& rStr
,
558 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xTest
,
559 const ::com::sun::star::uno::Any
& rAny
,
560 const ::com::sun::star::uno::Sequence
<TestElement
>& rSequence
,
561 const TestData
& rStruct
)
562 throw(com::sun::star::uno::RuntimeException
)
565 bBool
, cChar
, nByte
, nShort
, nUShort
, nLong
, nULong
, nHyper
, nUHyper
, fFloat
, fDouble
,
566 eEnum
, rStr
, xTest
, rAny
, rSequence
);
567 _aStructData
= rStruct
;
569 //__________________________________________________________________________________________________
570 TestData
Test_Impl::setValues2( sal_Bool
& bBool
, sal_Unicode
& cChar
, sal_Int8
& nByte
,
571 sal_Int16
& nShort
, sal_uInt16
& nUShort
,
572 sal_Int32
& nLong
, sal_uInt32
& nULong
,
573 sal_Int64
& nHyper
, sal_uInt64
& nUHyper
,
574 float& fFloat
, double& fDouble
,
575 TestEnum
& eEnum
, rtl::OUString
& rStr
,
576 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xTest
,
577 ::com::sun::star::uno::Any
& rAny
,
578 ::com::sun::star::uno::Sequence
<TestElement
>& rSequence
,
580 throw(com::sun::star::uno::RuntimeException
)
583 bBool
, cChar
, nByte
, nShort
, nUShort
, nLong
, nULong
, nHyper
, nUHyper
, fFloat
, fDouble
,
584 eEnum
, rStr
, xTest
, rAny
, rSequence
);
585 _aStructData
= rStruct
;
587 TestElement elem
= rSequence
[ 0 ];
588 rSequence
[ 0 ] = rSequence
[ 1 ];
589 rSequence
[ 1 ] = elem
;
593 //__________________________________________________________________________________________________
594 TestData
Test_Impl::getValues( sal_Bool
& bBool
, sal_Unicode
& cChar
, sal_Int8
& nByte
,
595 sal_Int16
& nShort
, sal_uInt16
& nUShort
,
596 sal_Int32
& nLong
, sal_uInt32
& nULong
,
597 sal_Int64
& nHyper
, sal_uInt64
& nUHyper
,
598 float& fFloat
, double& fDouble
,
599 TestEnum
& eEnum
, rtl::OUString
& rStr
,
600 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xTest
,
601 ::com::sun::star::uno::Any
& rAny
,
602 ::com::sun::star::uno::Sequence
<TestElement
>& rSequence
,
604 throw(com::sun::star::uno::RuntimeException
)
609 nShort
= _aData
.Short
;
610 nUShort
= _aData
.UShort
;
612 nULong
= _aData
.ULong
;
613 nHyper
= _aData
.Hyper
;
614 nUHyper
= _aData
.UHyper
;
615 fFloat
= _aData
.Float
;
616 fDouble
= _aData
.Double
;
618 rStr
= _aData
.String
;
619 xTest
= _aData
.Interface
;
621 rSequence
= _aData
.Sequence
;
622 rStruct
= _aStructData
;
625 //__________________________________________________________________________________________________
626 TestData
Test_Impl::raiseException( sal_Int16 nArgumentPos
, const OUString
& rMsg
, const Reference
< XInterface
> & xContext
)
627 throw(::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
)
629 IllegalArgumentException aExc
;
630 aExc
.ArgumentPosition
= nArgumentPos
;
631 aExc
.Message
= _aData
.String
= rMsg
;
632 aExc
.Context
= _aData
.Interface
= xContext
;
636 void Test_Impl::raiseRuntimeExceptionOneway( const OUString
& rMsg
, const Reference
< XInterface
> & xContext
)
637 throw(::com::sun::star::uno::RuntimeException
)
639 RuntimeException aExc
;
640 aExc
.Message
= _aData
.String
= rMsg
;
641 aExc
.Context
= _aData
.Interface
= xContext
;
645 void dothrow2( RuntimeException e
)
649 void dothrow( RuntimeException
const & e
)
652 // currently only for MSVC:
653 // just to test whether all bridges fall back to a RuntimeException
654 // in case of a thrown non-UNO exception:
657 throw ::std::bad_alloc();
663 Any
a( getCaughtException() );
664 RuntimeException exc
;
665 OSL_VERIFY( a
>>= exc
);
668 exc
.Message
, RTL_TEXTENCODING_UTF8
).getStr() );
670 catch (...) // never throws anything
672 fprintf( stderr
, "\ngetCaughtException() failed!\n" );
679 //______________________________________________________________________________
680 sal_Int32
Test_Impl::getRuntimeException()
681 throw (RuntimeException
)
685 dothrow( RuntimeException( _aData
.String
, _aData
.Interface
) );
689 Any
a( getCaughtException() );
692 return 0; // for dummy
694 //__________________________________________________________________________________________________
695 void Test_Impl::setRuntimeException( sal_Int32
) throw(::com::sun::star::uno::RuntimeException
)
697 RuntimeException aExc
;
698 aExc
.Message
= _aData
.String
;
699 aExc
.Context
= _aData
.Interface
;
700 throwException( makeAny( aExc
) );
703 // XBridgeTest2 -------------------------------------------------------------
704 Sequence
< sal_Bool
> SAL_CALL
Test_Impl::setSequenceBool(
705 const Sequence
< sal_Bool
>& aSeq
) throw (RuntimeException
)
711 Sequence
< sal_Unicode
> SAL_CALL
Test_Impl::setSequenceChar(
712 const Sequence
< sal_Unicode
>& aSeq
) throw (RuntimeException
)
718 Sequence
< sal_Int8
> SAL_CALL
Test_Impl::setSequenceByte(
719 const Sequence
< sal_Int8
>& aSeq
) throw (RuntimeException
)
725 Sequence
< sal_Int16
> SAL_CALL
Test_Impl::setSequenceShort(
726 const Sequence
< sal_Int16
>& aSeq
) throw (RuntimeException
)
732 Sequence
< sal_uInt16
> SAL_CALL
Test_Impl::setSequenceUShort(
733 const Sequence
< sal_uInt16
>& aSeq
) throw (RuntimeException
)
739 Sequence
< sal_Int32
> SAL_CALL
Test_Impl::setSequenceLong(
740 const Sequence
< sal_Int32
>& aSeq
) throw (RuntimeException
)
746 Sequence
< sal_uInt32
> SAL_CALL
Test_Impl::setSequenceULong(
747 const Sequence
< sal_uInt32
>& aSeq
) throw (RuntimeException
)
753 Sequence
< sal_Int64
> SAL_CALL
Test_Impl::setSequenceHyper(
754 const Sequence
< sal_Int64
>& aSeq
) throw (RuntimeException
)
760 Sequence
< sal_uInt64
> SAL_CALL
Test_Impl::setSequenceUHyper(
761 const Sequence
< sal_uInt64
>& aSeq
) throw (RuntimeException
)
767 Sequence
< float > SAL_CALL
Test_Impl::setSequenceFloat(
768 const Sequence
< float >& aSeq
) throw (RuntimeException
)
774 Sequence
< double > SAL_CALL
Test_Impl::setSequenceDouble(
775 const Sequence
< double >& aSeq
) throw (RuntimeException
)
781 Sequence
< TestEnum
> SAL_CALL
Test_Impl::setSequenceEnum(
782 const Sequence
< TestEnum
>& aSeq
) throw (RuntimeException
)
788 Sequence
< OUString
> SAL_CALL
Test_Impl::setSequenceString(
789 const Sequence
< OUString
>& aSeq
) throw (RuntimeException
)
795 Sequence
< Reference
< XInterface
> > SAL_CALL
Test_Impl::setSequenceXInterface(
796 const Sequence
< Reference
< XInterface
> >& aSeq
)
797 throw (RuntimeException
)
803 Sequence
<Any
> SAL_CALL
Test_Impl::setSequenceAny(
804 const Sequence
<Any
>& aSeq
) throw (RuntimeException
)
810 Sequence
<TestElement
> SAL_CALL
Test_Impl::setSequenceStruct(
811 const Sequence
< TestElement
>& aSeq
) throw (RuntimeException
)
817 Sequence
< Sequence
< sal_Int32
> > SAL_CALL
Test_Impl::setDim2(
818 const Sequence
<Sequence
< sal_Int32
> >& aSeq
) throw (RuntimeException
)
824 Sequence
< Sequence
< Sequence
< sal_Int32
> > > SAL_CALL
Test_Impl::setDim3(
825 const Sequence
< Sequence
< Sequence
< sal_Int32
> > >& aSeq
)
826 throw (RuntimeException
)
832 void SAL_CALL
Test_Impl::setSequencesInOut(Sequence
< sal_Bool
>& aSeqBoolean
,
833 Sequence
< sal_Unicode
>& aSeqChar
,
834 Sequence
< sal_Int8
>& aSeqByte
,
835 Sequence
< sal_Int16
>& aSeqShort
,
836 Sequence
< sal_uInt16
>& aSeqUShort
,
837 Sequence
< sal_Int32
>& aSeqLong
,
838 Sequence
< sal_uInt32
>& aSeqULong
,
839 Sequence
< sal_Int64
>& aSeqHyper
,
840 Sequence
< sal_uInt64
>& aSeqUHyper
,
841 Sequence
< float >& aSeqFloat
,
842 Sequence
< double >& aSeqDouble
,
843 Sequence
< TestEnum
>& aSeqTestEnum
,
844 Sequence
< OUString
>& aSeqString
,
845 Sequence
<Reference
<XInterface
> >& aSeqXInterface
,
846 Sequence
< Any
>& aSeqAny
,
847 Sequence
< Sequence
< sal_Int32
> >& aSeqDim2
,
848 Sequence
< Sequence
< Sequence
< sal_Int32
> > >& aSeqDim3
)
849 throw (RuntimeException
)
851 _arBool
= aSeqBoolean
;
854 _arShort
= aSeqShort
;
855 _arUShort
= aSeqUShort
;
857 _arULong
= aSeqULong
;
858 _arHyper
= aSeqHyper
;
859 _arUHyper
= aSeqUHyper
;
860 _arFloat
= aSeqFloat
;
861 _arDouble
= aSeqDouble
;
862 _arEnum
= aSeqTestEnum
;
863 _arString
= aSeqString
;
864 _arObject
= aSeqXInterface
;
870 void SAL_CALL
Test_Impl::setSequencesOut( Sequence
< sal_Bool
>& aSeqBoolean
,
871 Sequence
< sal_Unicode
>& aSeqChar
,
872 Sequence
< sal_Int8
>& aSeqByte
,
873 Sequence
< sal_Int16
>& aSeqShort
,
874 Sequence
< sal_uInt16
>& aSeqUShort
,
875 Sequence
< sal_Int32
>& aSeqLong
,
876 Sequence
< sal_uInt32
>& aSeqULong
,
877 Sequence
< sal_Int64
>& aSeqHyper
,
878 Sequence
< sal_uInt64
>& aSeqUHyper
,
879 Sequence
< float >& aSeqFloat
,
880 Sequence
< double >& aSeqDouble
,
881 Sequence
< TestEnum
>& aSeqEnum
,
882 Sequence
< OUString
>& aSeqString
,
883 Sequence
< Reference
< XInterface
> >& aSeqXInterface
,
884 Sequence
< Any
>& aSeqAny
,
885 Sequence
< Sequence
< sal_Int32
> >& aSeqDim2
,
886 Sequence
< Sequence
< Sequence
< sal_Int32
> > >& aSeqDim3
)
887 throw (RuntimeException
)
889 aSeqBoolean
= _arBool
;
892 aSeqShort
= _arShort
;
893 aSeqUShort
= _arUShort
;
895 aSeqULong
= _arULong
;
896 aSeqHyper
= _arHyper
;
897 aSeqUHyper
= _arUHyper
;
898 aSeqFloat
= _arFloat
;
899 aSeqDouble
= _arDouble
;
901 aSeqString
= _arString
;
902 aSeqXInterface
= _arObject
;
908 void Test_Impl::testConstructorsService(
909 Reference
< XComponentContext
> const & context
) throw (RuntimeException
)
911 Sequence
< sal_Bool
> arg14(1); arg14
[0] = true;
912 Sequence
< sal_Int8
> arg15(1); arg15
[0] = SAL_MIN_INT8
;
913 Sequence
< sal_Int16
> arg16(1); arg16
[0] = SAL_MIN_INT16
;
914 Sequence
< sal_uInt16
> arg17(1); arg17
[0] = SAL_MAX_UINT16
;
915 Sequence
< sal_Int32
> arg18(1); arg18
[0] = SAL_MIN_INT32
;
916 Sequence
< sal_uInt32
> arg19(1); arg19
[0] = SAL_MAX_UINT32
;
917 Sequence
< sal_Int64
> arg20(1); arg20
[0] = SAL_MIN_INT64
;
918 Sequence
< sal_uInt64
> arg21(1); arg21
[0] = SAL_MAX_UINT64
;
919 Sequence
< float > arg22(1); arg22
[0] = 0.123f
;
920 Sequence
< double > arg23(1); arg23
[0] = 0.456;
921 Sequence
< sal_Unicode
> arg24(1); arg24
[0] = 'X';
922 Sequence
< OUString
> arg25(1);
923 arg25
[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("test"));
924 Sequence
< Type
> arg26(1); arg26
[0] = UnoType
< Any
>::get();
925 Sequence
< Any
> arg27(1); arg27
[0] <<= true;
926 Sequence
< Sequence
< sal_Bool
> > arg28(1);
927 arg28
[0] = Sequence
< sal_Bool
>(1); arg28
[0][0] = true;
928 Sequence
< Sequence
< Any
> > arg29(1); arg29
[0] = Sequence
< Any
>(1);
929 arg29
[0][0] <<= true;
930 Sequence
< TestEnum
> arg30(1); arg30
[0] = TestEnum_TWO
;
931 Sequence
< TestStruct
> arg31(1); arg31
[0].member
= 10;
932 Sequence
< TestPolyStruct
< sal_Bool
> > arg32(1); arg32
[0].member
= true;
933 Sequence
< TestPolyStruct
< Any
> > arg33(1); arg33
[0].member
<<= true;
934 Sequence
< Reference
< XInterface
> > arg34(1);
935 Constructors::create1(context
,
947 OUString(RTL_CONSTASCII_USTRINGPARAM("test")),
948 UnoType
< Any
>::get(),
973 TestPolyStruct
< sal_Bool
>(true),
974 TestPolyStruct
< Any
>(makeAny(true)),
975 Reference
< XInterface
>(0));
976 Sequence
< Any
> args(40);
978 args
[1] <<= SAL_MIN_INT8
;
979 args
[2] <<= SAL_MIN_INT16
;
980 args
[3] <<= SAL_MAX_UINT16
;
981 args
[4] <<= SAL_MIN_INT32
;
982 args
[5] <<= SAL_MAX_UINT32
;
983 args
[6] <<= SAL_MIN_INT64
;
984 args
[7] <<= SAL_MAX_UINT64
;
987 sal_Unicode arg10c
= 'X';
988 args
[10].setValue(&arg10c
, UnoType
< UnoCharType
>::get());
989 args
[11] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("test"));
990 args
[12] <<= UnoType
< Any
>::get();
1002 args
[24].setValue(&arg24
, UnoType
< UnoSequenceType
< UnoCharType
> >::get());
1013 args
[35] <<= TestEnum_TWO
;
1014 args
[36] <<= TestStruct(10);
1015 args
[37] <<= TestPolyStruct
< sal_Bool
>(true);
1016 args
[38] <<= TestPolyStruct
< Any
>(makeAny(true));
1017 args
[39] <<= Reference
< XInterface
>(0);
1018 Constructors::create2(context
, args
);
1020 Sequence
<Type
> argSeq1(1); argSeq1
[0] = cppu::UnoType
<sal_Int32
>::get();
1021 Sequence
<Reference
<XInterface
> > argSeq2(1); argSeq2
[0] = static_cast<XComponent
*>(new Dummy());
1022 Sequence
<Reference
<XComponent
> > argSeq2a(1); argSeq2a
[0] = static_cast<XComponent
*>(new Dummy());
1024 Sequence
<TestPolyStruct2
<sal_Unicode
, Sequence
<Any
> > > argSeq3(1);
1025 argSeq3
[0] = TestPolyStruct2
<sal_Unicode
, Sequence
<Any
> >('X', arg27
);
1026 Sequence
<TestPolyStruct2
<TestPolyStruct
<sal_Unicode
>, Sequence
<Any
> > > argSeq4(1);
1027 argSeq4
[0] = TestPolyStruct2
<TestPolyStruct
<sal_Unicode
>, Sequence
<Any
> >(
1028 TestPolyStruct
<sal_Unicode
>('X'), arg27
);
1029 Sequence
<Sequence
<sal_Int32
> > argSeq5(1);
1030 argSeq5
[0] = Sequence
<sal_Int32
>(1); argSeq5
[0][0] = SAL_MIN_INT32
;
1031 Sequence
<TestPolyStruct
<sal_Int32
> > argSeq6(1);
1032 argSeq6
[0] = TestPolyStruct
<sal_Int32
>(SAL_MIN_INT32
);
1033 Sequence
<TestPolyStruct
<TestPolyStruct2
<sal_Unicode
, Any
> > > argSeq7(1);
1034 argSeq7
[0] = TestPolyStruct
<TestPolyStruct2
<sal_Unicode
, Any
> >(
1035 TestPolyStruct2
<sal_Unicode
, Any
>('X', Any(true)));
1036 Sequence
<TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
, Any
>,OUString
> > > argSeq8(1);
1037 argSeq8
[0] = TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
, Any
>,OUString
> > (
1038 TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
, Any
>,OUString
>(
1039 TestPolyStruct2
<sal_Unicode
, Any
>('X', Any(true)), OUString(RTL_CONSTASCII_USTRINGPARAM("test"))));
1040 Sequence
<TestPolyStruct2
<OUString
, TestPolyStruct2
<sal_Unicode
, TestPolyStruct
<Any
> > > > argSeq9(1);
1041 argSeq9
[0] = TestPolyStruct2
<OUString
, TestPolyStruct2
<sal_Unicode
, TestPolyStruct
<Any
> > >(
1042 OUString(RTL_CONSTASCII_USTRINGPARAM("test")), TestPolyStruct2
<sal_Unicode
, TestPolyStruct
<Any
> >(
1043 'X', TestPolyStruct
<Any
>(Any(true))));
1044 Sequence
<TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
, Any
>, TestPolyStruct
<sal_Unicode
> > > argSeq10(1);
1045 argSeq10
[0] = TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
, Any
>, TestPolyStruct
<sal_Unicode
> >(
1046 TestPolyStruct2
<sal_Unicode
, Any
>('X', Any(true)), TestPolyStruct
<sal_Unicode
>('X'));
1047 Sequence
<Sequence
<TestPolyStruct
<sal_Unicode
> > > argSeq11(1);
1048 argSeq11
[0] = Sequence
<TestPolyStruct
<sal_Unicode
> >(1);
1049 argSeq11
[0][0] = TestPolyStruct
<sal_Unicode
>('X');
1050 Sequence
<Sequence
<TestPolyStruct
<TestPolyStruct2
<sal_Unicode
,Any
> > > > argSeq12(1);
1051 argSeq12
[0] = Sequence
<TestPolyStruct
<TestPolyStruct2
<sal_Unicode
,Any
> > >(1);
1052 argSeq12
[0][0] = TestPolyStruct
<TestPolyStruct2
<sal_Unicode
,Any
> >(
1053 TestPolyStruct2
<sal_Unicode
,Any
>('X', Any(true)));
1054 Sequence
<Sequence
<TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
,Any
>,OUString
> > > > argSeq13(1);
1055 argSeq13
[0] = Sequence
<TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
,Any
>,OUString
> > >(1);
1056 argSeq13
[0][0] = TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
,Any
>,OUString
> >(
1057 TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
,Any
>,OUString
>(
1058 TestPolyStruct2
<sal_Unicode
,Any
>('X', Any(true)), OUString(RTL_CONSTASCII_USTRINGPARAM("test"))));
1059 Sequence
<Sequence
<TestPolyStruct2
<OUString
, TestPolyStruct2
<sal_Unicode
, TestPolyStruct
<Any
> > > > > argSeq14(1);
1060 argSeq14
[0] = Sequence
<TestPolyStruct2
<OUString
, TestPolyStruct2
<sal_Unicode
, TestPolyStruct
<Any
> > > >(1);
1061 argSeq14
[0][0] = TestPolyStruct2
<OUString
, TestPolyStruct2
<sal_Unicode
, TestPolyStruct
<Any
> > >(
1062 OUString(RTL_CONSTASCII_USTRINGPARAM("test")), TestPolyStruct2
<sal_Unicode
, TestPolyStruct
<Any
> >(
1063 'X', TestPolyStruct
<Any
>(Any(true))));
1064 Sequence
<Sequence
<TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
,Any
>, TestPolyStruct
<sal_Unicode
> > > > argSeq15(1);
1065 argSeq15
[0] = Sequence
<TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
,Any
>, TestPolyStruct
<sal_Unicode
> > >(1);
1066 argSeq15
[0][0] = TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
,Any
>, TestPolyStruct
<sal_Unicode
> >(
1067 TestPolyStruct2
<sal_Unicode
,Any
>('X',Any(true)), TestPolyStruct
<sal_Unicode
>('X'));
1069 Constructors2::create1(
1071 TestPolyStruct
<Type
>(cppu::UnoType
<sal_Int32
>::get()),
1072 TestPolyStruct
<Any
>(Any(true)),
1073 TestPolyStruct
<sal_Bool
>(true),
1074 TestPolyStruct
<sal_Int8
>(SAL_MIN_INT8
),
1075 TestPolyStruct
<sal_Int16
>(SAL_MIN_INT16
),
1076 TestPolyStruct
<sal_Int32
>(SAL_MIN_INT32
),
1077 TestPolyStruct
<sal_Int64
>(SAL_MIN_INT64
),
1078 TestPolyStruct
<sal_Unicode
>('X'),
1079 TestPolyStruct
<OUString
>(OUString(RTL_CONSTASCII_USTRINGPARAM("test"))),
1080 TestPolyStruct
<float>(0.123f
),
1081 TestPolyStruct
<double>(0.456),
1082 TestPolyStruct
<Reference
<XInterface
> >(static_cast<XBridgeTest2
*>(this)),
1083 TestPolyStruct
<Reference
<XComponent
> >(static_cast<XComponent
*>(new Dummy())),
1084 TestPolyStruct
<TestEnum
>(TestEnum_TWO
),
1085 TestPolyStruct
<TestPolyStruct2
<sal_Unicode
, Any
> >(
1086 TestPolyStruct2
<sal_Unicode
, Any
>('X', Any(true))),
1087 TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
, Any
>,OUString
> > (
1088 TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
, Any
>,OUString
>(
1089 TestPolyStruct2
<sal_Unicode
, Any
>('X', Any(true)), OUString(RTL_CONSTASCII_USTRINGPARAM("test")))),
1090 TestPolyStruct2
<OUString
, TestPolyStruct2
<sal_Unicode
,TestPolyStruct
<Any
> > >(
1091 OUString(RTL_CONSTASCII_USTRINGPARAM("test")),
1092 TestPolyStruct2
<sal_Unicode
, TestPolyStruct
<Any
> >('X', TestPolyStruct
<Any
>(Any(true)))),
1093 TestPolyStruct2
<TestPolyStruct2
<sal_Unicode
, Any
>, TestPolyStruct
<sal_Unicode
> >(
1094 TestPolyStruct2
<sal_Unicode
, Any
>('X', Any(true)),
1095 TestPolyStruct
<sal_Unicode
>('X')),
1096 TestPolyStruct
<Sequence
<Type
> >(argSeq1
),
1097 TestPolyStruct
<Sequence
<Any
> >(arg27
),
1098 TestPolyStruct
<Sequence
<sal_Bool
> >(arg14
),
1099 TestPolyStruct
<Sequence
<sal_Int8
> >(arg15
),
1100 TestPolyStruct
<Sequence
<sal_Int16
> >(arg16
),
1101 TestPolyStruct
<Sequence
<sal_Int32
> >(arg18
),
1102 TestPolyStruct
<Sequence
<sal_Int64
> >(arg20
),
1103 TestPolyStruct
<Sequence
<sal_Unicode
> >(arg24
),
1104 TestPolyStruct
<Sequence
<OUString
> >(arg25
),
1105 TestPolyStruct
<Sequence
<float> >(arg22
),
1106 TestPolyStruct
<Sequence
<double> >(arg23
),
1107 TestPolyStruct
<Sequence
<Reference
<XInterface
> > >(argSeq2
),
1108 TestPolyStruct
<Sequence
<Reference
<XComponent
> > >(argSeq2a
),
1109 TestPolyStruct
<Sequence
<TestEnum
> >(arg30
),
1110 TestPolyStruct
<Sequence
<TestPolyStruct2
<sal_Unicode
, Sequence
<Any
> > > >(argSeq3
),
1111 TestPolyStruct
<Sequence
<TestPolyStruct2
<TestPolyStruct
<sal_Unicode
>, Sequence
<Any
> > > > (argSeq4
),
1112 TestPolyStruct
<Sequence
<Sequence
<sal_Int32
> > >(argSeq5
),
1125 Reference
< XCurrentContextChecker
> Test_Impl::getCurrentContextChecker()
1126 throw (RuntimeException
)
1128 return new testtools::bridgetest::CurrentContextChecker
;
1132 //__________________________________________________________________________________________________
1133 OUString
Test_Impl::getImplementationName()
1134 throw (RuntimeException
)
1136 return OUString( RTL_CONSTASCII_USTRINGPARAM(IMPLNAME
) );
1138 //__________________________________________________________________________________________________
1139 sal_Bool
Test_Impl::supportsService( const OUString
& rServiceName
)
1140 throw (RuntimeException
)
1142 const Sequence
< OUString
> & rSNL
= getSupportedServiceNames();
1143 const OUString
* pArray
= rSNL
.getConstArray();
1144 for ( sal_Int32 nPos
= rSNL
.getLength(); nPos
--; )
1146 if (pArray
[nPos
] == rServiceName
)
1151 //__________________________________________________________________________________________________
1152 Sequence
< OUString
> Test_Impl::getSupportedServiceNames()
1153 throw (RuntimeException
)
1155 return bridge_object::getSupportedServiceNames();
1160 //==================================================================================================
1161 static Reference
< XInterface
> SAL_CALL
Test_Impl_create( const Reference
< XMultiServiceFactory
> & )
1163 return Reference
< XInterface
>( (XBridgeTest
*)new Test_Impl() );
1170 //==================================================================================================
1171 void SAL_CALL
component_getImplementationEnvironment(
1172 const sal_Char
** ppEnvTypeName
, uno_Environment
** )
1174 *ppEnvTypeName
= CPPU_CURRENT_LANGUAGE_BINDING_NAME
;
1176 //==================================================================================================
1177 sal_Bool SAL_CALL
component_writeInfo( void *, void * pRegistryKey
)
1183 Reference
< XRegistryKey
> xNewKey(
1184 reinterpret_cast< XRegistryKey
* >( pRegistryKey
)->createKey(
1185 OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLNAME
"/UNO/SERVICES") ) ) );
1186 xNewKey
->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM(SERVICENAME
) ) );
1190 catch (InvalidRegistryException
&)
1192 OSL_ENSURE( sal_False
, "### InvalidRegistryException!" );
1197 //==================================================================================================
1198 void * SAL_CALL
component_getFactory(
1199 const sal_Char
* pImplName
, void * pServiceManager
, void * )
1203 if (pServiceManager
&& rtl_str_compare( pImplName
, IMPLNAME
) == 0)
1205 Reference
< XSingleServiceFactory
> xFactory( createSingleFactory(
1206 reinterpret_cast< XMultiServiceFactory
* >( pServiceManager
),
1207 OUString( RTL_CONSTASCII_USTRINGPARAM(IMPLNAME
) ),
1208 bridge_object::Test_Impl_create
,
1209 bridge_object::getSupportedServiceNames() ) );
1213 xFactory
->acquire();
1214 pRet
= xFactory
.get();