Branch data Line data Source code
1 : : #ifndef INCLUDED_TEST_TESTTOOLS_BRIDGETEST_CONSTRUCTORS_HPP
2 : : #define INCLUDED_TEST_TESTTOOLS_BRIDGETEST_CONSTRUCTORS_HPP
3 : :
4 : : #include "sal/config.h"
5 : :
6 : : #include "com/sun/star/uno/Exception.hpp"
7 : : #include "com/sun/star/uno/XComponentContext.hpp"
8 : : #include "com/sun/star/lang/XMultiComponentFactory.hpp"
9 : : #include "com/sun/star/uno/RuntimeException.hpp"
10 : : #include "test/testtools/bridgetest/TestPolyStruct.hpp"
11 : : #include "test/testtools/bridgetest/BadConstructorArguments.hpp"
12 : : #include "com/sun/star/uno/DeploymentException.hpp"
13 : : #include "test/testtools/bridgetest/TestStruct.hpp"
14 : : #include "com/sun/star/uno/XInterface.hpp"
15 : : #include "test/testtools/bridgetest/TestEnum.hpp"
16 : : #include "com/sun/star/uno/Any.hxx"
17 : : #include "com/sun/star/uno/Reference.hxx"
18 : : #include "com/sun/star/uno/Sequence.hxx"
19 : : #include "com/sun/star/uno/Type.hxx"
20 : : #include "cppu/unotype.hxx"
21 : : #include "rtl/ustring.h"
22 : : #include "rtl/ustring.hxx"
23 : : #include "sal/types.h"
24 : :
25 : : namespace test { namespace testtools { namespace bridgetest {
26 : :
27 : : class Constructors {
28 : : public:
29 : 3 : static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > create1(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, ::sal_Bool arg0, ::sal_Int8 arg1, ::sal_Int16 arg2, ::sal_uInt16 arg3, ::sal_Int32 arg4, ::sal_uInt32 arg5, ::sal_Int64 arg6, ::sal_uInt64 arg7, float arg8, double arg9, ::sal_Unicode arg10, const ::rtl::OUString& arg11, const ::com::sun::star::uno::Type& arg12, const ::com::sun::star::uno::Any& arg13, const ::com::sun::star::uno::Sequence< ::sal_Bool >& arg14, const ::com::sun::star::uno::Sequence< ::sal_Int8 >& arg15, const ::com::sun::star::uno::Sequence< ::sal_Int16 >& arg16, const ::com::sun::star::uno::Sequence< ::sal_uInt16 >& arg17, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& arg18, const ::com::sun::star::uno::Sequence< ::sal_uInt32 >& arg19, const ::com::sun::star::uno::Sequence< ::sal_Int64 >& arg20, const ::com::sun::star::uno::Sequence< ::sal_uInt64 >& arg21, const ::com::sun::star::uno::Sequence< float >& arg22, const ::com::sun::star::uno::Sequence< double >& arg23, const ::com::sun::star::uno::Sequence< ::sal_Unicode >& arg24, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& arg25, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >& arg26, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& arg27, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::sal_Bool > >& arg28, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& arg29, const ::com::sun::star::uno::Sequence< ::test::testtools::bridgetest::TestEnum >& arg30, const ::com::sun::star::uno::Sequence< ::test::testtools::bridgetest::TestStruct >& arg31, const ::com::sun::star::uno::Sequence< ::test::testtools::bridgetest::TestPolyStruct< ::sal_Bool > >& arg32, const ::com::sun::star::uno::Sequence< ::test::testtools::bridgetest::TestPolyStruct< ::com::sun::star::uno::Any > >& arg33, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >& arg34, ::test::testtools::bridgetest::TestEnum arg35, const ::test::testtools::bridgetest::TestStruct& arg36, const ::test::testtools::bridgetest::TestPolyStruct< ::sal_Bool >& arg37, const ::test::testtools::bridgetest::TestPolyStruct< ::com::sun::star::uno::Any >& arg38, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& arg39) {
30 [ + - ][ + - ]: 3 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory > the_factory(the_context->getServiceManager());
31 [ - + ]: 3 : if (!the_factory.is()) {
32 [ # # ][ # # ]: 0 : throw com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service manager")), the_context);
33 : : }
34 [ + - ]: 3 : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(40);
35 [ + - ][ + - ]: 3 : the_arguments[0] <<= arg0;
36 [ + - ][ + - ]: 3 : the_arguments[1] <<= arg1;
37 [ + - ][ + - ]: 3 : the_arguments[2] <<= arg2;
38 [ + - ][ + - ]: 3 : the_arguments[3] <<= arg3;
39 [ + - ][ + - ]: 3 : the_arguments[4] <<= arg4;
40 [ + - ][ + - ]: 3 : the_arguments[5] <<= arg5;
41 [ + - ][ + - ]: 3 : the_arguments[6] <<= arg6;
42 [ + - ][ + - ]: 3 : the_arguments[7] <<= arg7;
43 [ + - ][ + - ]: 3 : the_arguments[8] <<= arg8;
44 [ + - ][ + - ]: 3 : the_arguments[9] <<= arg9;
45 [ + - ]: 3 : the_arguments[10] = ::com::sun::star::uno::Any(&arg10, ::cppu::UnoType< ::cppu::UnoCharType >::get());
46 [ + - ][ + - ]: 3 : the_arguments[11] <<= arg11;
47 [ + - ][ + - ]: 3 : the_arguments[12] <<= arg12;
48 [ + - ][ + - ]: 3 : the_arguments[13] <<= arg13;
49 [ + - ][ + - ]: 3 : the_arguments[14] <<= arg14;
50 [ + - ][ + - ]: 3 : the_arguments[15] <<= arg15;
51 [ + - ][ + - ]: 3 : the_arguments[16] <<= arg16;
52 [ + - ][ + - ]: 3 : the_arguments[17] <<= arg17;
53 [ + - ][ + - ]: 3 : the_arguments[18] <<= arg18;
54 [ + - ][ + - ]: 3 : the_arguments[19] <<= arg19;
55 [ + - ][ + - ]: 3 : the_arguments[20] <<= arg20;
56 [ + - ][ + - ]: 3 : the_arguments[21] <<= arg21;
57 [ + - ][ + - ]: 3 : the_arguments[22] <<= arg22;
58 [ + - ][ + - ]: 3 : the_arguments[23] <<= arg23;
59 [ + - ][ + - ]: 3 : the_arguments[24] = ::com::sun::star::uno::Any(&arg24, ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoCharType > >::get());
60 [ + - ][ + - ]: 3 : the_arguments[25] <<= arg25;
61 [ + - ][ + - ]: 3 : the_arguments[26] <<= arg26;
62 [ + - ][ + - ]: 3 : the_arguments[27] <<= arg27;
63 [ + - ][ + - ]: 3 : the_arguments[28] <<= arg28;
64 [ + - ][ + - ]: 3 : the_arguments[29] <<= arg29;
65 [ + - ][ + - ]: 3 : the_arguments[30] <<= arg30;
66 [ + - ][ + - ]: 3 : the_arguments[31] <<= arg31;
67 [ + - ][ + - ]: 3 : the_arguments[32] <<= arg32;
68 [ + - ][ + - ]: 3 : the_arguments[33] <<= arg33;
69 [ + - ][ + - ]: 3 : the_arguments[34] <<= arg34;
70 [ + - ][ + - ]: 3 : the_arguments[35] <<= arg35;
71 [ + - ][ + - ]: 3 : the_arguments[36] <<= arg36;
72 [ + - ][ + - ]: 3 : the_arguments[37] <<= arg37;
73 [ + - ][ + - ]: 3 : the_arguments[38] <<= arg38;
74 [ + - ][ + - ]: 3 : the_arguments[39] <<= arg39;
75 : 3 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > the_instance;
76 : : try {
77 [ + - ][ + - ]: 3 : the_instance = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(the_factory->createInstanceWithArgumentsAndContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("test.testtools.bridgetest.Constructors")), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
[ + - ][ + - ]
[ + - ]
78 : 0 : } catch (::com::sun::star::uno::RuntimeException &) {
79 : 0 : throw;
80 : 0 : } catch (::test::testtools::bridgetest::BadConstructorArguments &) {
81 : 0 : throw;
82 [ # # # # ]: 0 : } catch (::com::sun::star::uno::Exception & the_exception) {
83 [ # # # # ]: 0 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service test.testtools.bridgetest.Constructors of type com.sun.star.uno.XInterface: ")) + the_exception.Message, the_context);
84 : : }
85 [ - + ]: 3 : if (!the_instance.is()) {
86 [ # # ][ # # ]: 0 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service test.testtools.bridgetest.Constructors of type com.sun.star.uno.XInterface")), the_context);
87 : : }
88 [ + - ]: 3 : return the_instance;
89 : : }
90 : :
91 : 3 : static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > create2(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& args) {
92 [ + - ][ + - ]: 3 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory > the_factory(the_context->getServiceManager());
93 [ - + ]: 3 : if (!the_factory.is()) {
94 [ # # ][ # # ]: 0 : throw com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service manager")), the_context);
95 : : }
96 : 3 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > the_instance;
97 : : try {
98 [ + - ][ + - ]: 3 : the_instance = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(the_factory->createInstanceWithArgumentsAndContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("test.testtools.bridgetest.Constructors")), args, the_context), ::com::sun::star::uno::UNO_QUERY);
[ + - ][ + - ]
[ + - ]
99 : 0 : } catch (::com::sun::star::uno::RuntimeException &) {
100 : 0 : throw;
101 : 0 : } catch (::test::testtools::bridgetest::BadConstructorArguments &) {
102 : 0 : throw;
103 [ # # # # ]: 0 : } catch (::com::sun::star::uno::Exception & the_exception) {
104 [ # # # # ]: 0 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service test.testtools.bridgetest.Constructors of type com.sun.star.uno.XInterface: ")) + the_exception.Message, the_context);
105 : : }
106 [ - + ]: 3 : if (!the_instance.is()) {
107 [ # # ][ # # ]: 0 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service test.testtools.bridgetest.Constructors of type com.sun.star.uno.XInterface")), the_context);
108 : : }
109 : 3 : return the_instance;
110 : : }
111 : :
112 : : private:
113 : : Constructors(); // not implemented
114 : : Constructors(Constructors &); // not implemented
115 : : ~Constructors(); // not implemented
116 : : void operator =(Constructors); // not implemented
117 : : };
118 : :
119 : : } } }
120 : :
121 : : #endif // INCLUDED_TEST_TESTTOOLS_BRIDGETEST_CONSTRUCTORS_HPP
|