xref: /AOO41X/main/codemaker/test/javamaker/Test.java (revision 6cb2fd0368c0bfc9279c5d8c2b60b3bc454c530a)
1*6cb2fd03SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*6cb2fd03SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*6cb2fd03SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*6cb2fd03SAndrew Rist  * distributed with this work for additional information
6*6cb2fd03SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*6cb2fd03SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*6cb2fd03SAndrew Rist  * "License"); you may not use this file except in compliance
9*6cb2fd03SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*6cb2fd03SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*6cb2fd03SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*6cb2fd03SAndrew Rist  * software distributed under the License is distributed on an
15*6cb2fd03SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*6cb2fd03SAndrew Rist  * KIND, either express or implied.  See the License for the
17*6cb2fd03SAndrew Rist  * specific language governing permissions and limitations
18*6cb2fd03SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*6cb2fd03SAndrew Rist  *************************************************************/
21*6cb2fd03SAndrew Rist 
22*6cb2fd03SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir package test.codemaker.javamaker;
25cdf0e10cSrcweir 
26cdf0e10cSrcweir import com.sun.star.comp.helper.Bootstrap;
27cdf0e10cSrcweir import com.sun.star.lang.XEventListener;
28cdf0e10cSrcweir import com.sun.star.uno.Any;
29cdf0e10cSrcweir import com.sun.star.uno.DeploymentException;
30cdf0e10cSrcweir import com.sun.star.uno.Type;
31cdf0e10cSrcweir import com.sun.star.uno.XComponentContext;
32cdf0e10cSrcweir import com.sun.star.uno.XNamingService;
33cdf0e10cSrcweir import complexlib.ComplexTestCase;
34cdf0e10cSrcweir import java.util.EventListener;
35cdf0e10cSrcweir import test.codemaker.javamaker.Enum1;
36cdf0e10cSrcweir import test.codemaker.javamaker.Enum2;
37cdf0e10cSrcweir import test.codemaker.javamaker.PolyStruct;
38cdf0e10cSrcweir import test.codemaker.javamaker.S2;
39cdf0e10cSrcweir import test.codemaker.javamaker.Struct2;
40cdf0e10cSrcweir import test.codemaker.javamaker.services.service_abstract;
41cdf0e10cSrcweir import test.codemaker.javamaker.services.service_assert;
42cdf0e10cSrcweir import test.codemaker.javamaker.services.service_break;
43cdf0e10cSrcweir import test.codemaker.javamaker.services.service_catch;
44cdf0e10cSrcweir import test.codemaker.javamaker.services.service_class;
45cdf0e10cSrcweir import test.codemaker.javamaker.services.service_continue;
46cdf0e10cSrcweir import test.codemaker.javamaker.services.service_do;
47cdf0e10cSrcweir import test.codemaker.javamaker.services.service_else;
48cdf0e10cSrcweir import test.codemaker.javamaker.services.service_extends;
49cdf0e10cSrcweir import test.codemaker.javamaker.services.service_final;
50cdf0e10cSrcweir import test.codemaker.javamaker.services.service_finally;
51cdf0e10cSrcweir import test.codemaker.javamaker.services.service_for;
52cdf0e10cSrcweir import test.codemaker.javamaker.services.service_goto;
53cdf0e10cSrcweir import test.codemaker.javamaker.services.service_if;
54cdf0e10cSrcweir import test.codemaker.javamaker.services.service_implements;
55cdf0e10cSrcweir import test.codemaker.javamaker.services.service_import;
56cdf0e10cSrcweir import test.codemaker.javamaker.services.service_instanceof;
57cdf0e10cSrcweir import test.codemaker.javamaker.services.service_int;
58cdf0e10cSrcweir import test.codemaker.javamaker.services.service_native;
59cdf0e10cSrcweir import test.codemaker.javamaker.services.service_new;
60cdf0e10cSrcweir import test.codemaker.javamaker.services.service_package;
61cdf0e10cSrcweir import test.codemaker.javamaker.services.service_private;
62cdf0e10cSrcweir import test.codemaker.javamaker.services.service_protected;
63cdf0e10cSrcweir import test.codemaker.javamaker.services.service_public;
64cdf0e10cSrcweir import test.codemaker.javamaker.services.service_return;
65cdf0e10cSrcweir import test.codemaker.javamaker.services.service_static;
66cdf0e10cSrcweir import test.codemaker.javamaker.services.service_strictfp;
67cdf0e10cSrcweir import test.codemaker.javamaker.services.service_super;
68cdf0e10cSrcweir import test.codemaker.javamaker.services.service_synchronized;
69cdf0e10cSrcweir import test.codemaker.javamaker.services.service_this;
70cdf0e10cSrcweir import test.codemaker.javamaker.services.service_throw;
71cdf0e10cSrcweir import test.codemaker.javamaker.services.service_throws;
72cdf0e10cSrcweir import test.codemaker.javamaker.services.service_try;
73cdf0e10cSrcweir import test.codemaker.javamaker.services.service_volatile;
74cdf0e10cSrcweir import test.codemaker.javamaker.services.service_while;
75cdf0e10cSrcweir import test.codemaker.javamaker.singleton_abstract;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir public final class Test extends ComplexTestCase {
getTestMethodNames()78cdf0e10cSrcweir     public String[] getTestMethodNames() {
79cdf0e10cSrcweir         return new String[] {
80cdf0e10cSrcweir             "testEnum1", "testEnum2", "testPolyStruct", "testEmptyStruct2",
81cdf0e10cSrcweir             "testFullStruct2", "testXEventListener", "testS1", "testS2",
82cdf0e10cSrcweir             "testKeywordServices", "testSingletons" };
83cdf0e10cSrcweir     }
84cdf0e10cSrcweir 
before()85cdf0e10cSrcweir     public void before() throws Exception {
86cdf0e10cSrcweir         context = Bootstrap.createInitialComponentContext(null);
87cdf0e10cSrcweir     }
88cdf0e10cSrcweir 
testEnum1()89cdf0e10cSrcweir     public void testEnum1() {
90cdf0e10cSrcweir         assure(Enum1.VALUE1.getValue() == -100);
91cdf0e10cSrcweir         assure(Enum1.VALUE2.getValue() == 100);
92cdf0e10cSrcweir         assure(Enum1.VALUE1_value == -100);
93cdf0e10cSrcweir         assure(Enum1.VALUE2_value == 100);
94cdf0e10cSrcweir         assure(Enum1.getDefault() == Enum1.VALUE1);
95cdf0e10cSrcweir         assure(Enum1.fromInt(-101) == null);
96cdf0e10cSrcweir         assure(Enum1.fromInt(-100) == Enum1.VALUE1);
97cdf0e10cSrcweir         assure(Enum1.fromInt(-99) == null);
98cdf0e10cSrcweir         assure(Enum1.fromInt(0) == null);
99cdf0e10cSrcweir         assure(Enum1.fromInt(99) == null);
100cdf0e10cSrcweir         assure(Enum1.fromInt(100) == Enum1.VALUE2);
101cdf0e10cSrcweir         assure(Enum1.fromInt(101) == null);
102cdf0e10cSrcweir     }
103cdf0e10cSrcweir 
testEnum2()104cdf0e10cSrcweir     public void testEnum2() {
105cdf0e10cSrcweir         assure(Enum2.VALUE0.getValue() == 0);
106cdf0e10cSrcweir         assure(Enum2.VALUE1.getValue() == 1);
107cdf0e10cSrcweir         assure(Enum2.VALUE2.getValue() == 2);
108cdf0e10cSrcweir         assure(Enum2.VALUE4.getValue() == 4);
109cdf0e10cSrcweir         assure(Enum2.VALUE0_value == 0);
110cdf0e10cSrcweir         assure(Enum2.VALUE1_value == 1);
111cdf0e10cSrcweir         assure(Enum2.VALUE2_value == 2);
112cdf0e10cSrcweir         assure(Enum2.VALUE4_value == 4);
113cdf0e10cSrcweir         assure(Enum2.getDefault() == Enum2.VALUE0);
114cdf0e10cSrcweir         assure(Enum2.fromInt(-1) == null);
115cdf0e10cSrcweir         assure(Enum2.fromInt(0) == Enum2.VALUE0);
116cdf0e10cSrcweir         assure(Enum2.fromInt(1) == Enum2.VALUE1);
117cdf0e10cSrcweir         assure(Enum2.fromInt(2) == Enum2.VALUE2);
118cdf0e10cSrcweir         assure(Enum2.fromInt(3) == null);
119cdf0e10cSrcweir         assure(Enum2.fromInt(4) == Enum2.VALUE4);
120cdf0e10cSrcweir         assure(Enum2.fromInt(5) == null);
121cdf0e10cSrcweir     }
122cdf0e10cSrcweir 
testPolyStruct()123cdf0e10cSrcweir     public void testPolyStruct() {
124cdf0e10cSrcweir         PolyStruct s = new PolyStruct();
125cdf0e10cSrcweir         assure(s.member1 == null);
126cdf0e10cSrcweir         assure(s.member2 == 0);
127cdf0e10cSrcweir         s = new PolyStruct("ABC", 5);
128cdf0e10cSrcweir         assure(s.member1.equals("ABC"));
129cdf0e10cSrcweir         assure(s.member2 == 5);
130cdf0e10cSrcweir     }
131cdf0e10cSrcweir 
testEmptyStruct2()132cdf0e10cSrcweir     public void testEmptyStruct2() {
133cdf0e10cSrcweir         Struct2 s = new Struct2();
134cdf0e10cSrcweir         assure(s.p1 == false);
135cdf0e10cSrcweir         assure(s.p2 == 0);
136cdf0e10cSrcweir         assure(s.p3 == 0);
137cdf0e10cSrcweir         assure(s.p4 == 0);
138cdf0e10cSrcweir         assure(s.p5 == 0);
139cdf0e10cSrcweir         assure(s.p6 == 0);
140cdf0e10cSrcweir         assure(s.p7 == 0L);
141cdf0e10cSrcweir         assure(s.p8 == 0L);
142cdf0e10cSrcweir         assure(s.p9 == 0.0f);
143cdf0e10cSrcweir         assure(s.p10 == 0.0);
144cdf0e10cSrcweir         assure(s.p11 == '\u0000');
145cdf0e10cSrcweir         assure(s.p12.equals(""));
146cdf0e10cSrcweir         assure(s.p13.equals(Type.VOID));
147cdf0e10cSrcweir         assure(s.p14.equals(Any.VOID));
148cdf0e10cSrcweir         assure(s.p15 == Enum2.VALUE0);
149cdf0e10cSrcweir         assure(s.p16.member1 == 0);
150cdf0e10cSrcweir         assure(s.p17 == null);
151cdf0e10cSrcweir         assure(s.p18 == null);
152cdf0e10cSrcweir         assure(s.t1 == false);
153cdf0e10cSrcweir         assure(s.t2 == 0);
154cdf0e10cSrcweir         assure(s.t3 == 0);
155cdf0e10cSrcweir         assure(s.t4 == 0);
156cdf0e10cSrcweir         assure(s.t5 == 0);
157cdf0e10cSrcweir         assure(s.t6 == 0);
158cdf0e10cSrcweir         assure(s.t7 == 0L);
159cdf0e10cSrcweir         assure(s.t8 == 0L);
160cdf0e10cSrcweir         assure(s.t9 == 0.0f);
161cdf0e10cSrcweir         assure(s.t10 == 0.0);
162cdf0e10cSrcweir         assure(s.t11 == '\u0000');
163cdf0e10cSrcweir         assure(s.t12.equals(""));
164cdf0e10cSrcweir         assure(s.t13.equals(Type.VOID));
165cdf0e10cSrcweir         assure(s.t14.equals(Any.VOID));
166cdf0e10cSrcweir         assure(s.t15 == Enum2.VALUE0);
167cdf0e10cSrcweir         assure(s.t16.member1 == 0);
168cdf0e10cSrcweir         assure(s.t17 == null);
169cdf0e10cSrcweir         assure(s.t18 == null);
170cdf0e10cSrcweir         assure(s.a1.length == 0);
171cdf0e10cSrcweir         assure(s.a2.length == 0);
172cdf0e10cSrcweir         assure(s.a3.length == 0);
173cdf0e10cSrcweir         assure(s.a4.length == 0);
174cdf0e10cSrcweir         assure(s.a5.length == 0);
175cdf0e10cSrcweir         assure(s.a6.length == 0);
176cdf0e10cSrcweir         assure(s.a7.length == 0);
177cdf0e10cSrcweir         assure(s.a8.length == 0);
178cdf0e10cSrcweir         assure(s.a9.length == 0);
179cdf0e10cSrcweir         assure(s.a10.length == 0);
180cdf0e10cSrcweir         assure(s.a11.length == 0);
181cdf0e10cSrcweir         assure(s.a12.length == 0);
182cdf0e10cSrcweir         assure(s.a13.length == 0);
183cdf0e10cSrcweir         assure(s.a14.length == 0);
184cdf0e10cSrcweir         assure(s.a15.length == 0);
185cdf0e10cSrcweir         assure(s.a16.length == 0);
186cdf0e10cSrcweir         assure(s.a17.length == 0);
187cdf0e10cSrcweir         assure(s.a18.length == 0);
188cdf0e10cSrcweir         assure(s.aa1.length == 0);
189cdf0e10cSrcweir         assure(s.aa2.length == 0);
190cdf0e10cSrcweir         assure(s.aa3.length == 0);
191cdf0e10cSrcweir         assure(s.aa4.length == 0);
192cdf0e10cSrcweir         assure(s.aa5.length == 0);
193cdf0e10cSrcweir         assure(s.aa6.length == 0);
194cdf0e10cSrcweir         assure(s.aa7.length == 0);
195cdf0e10cSrcweir         assure(s.aa8.length == 0);
196cdf0e10cSrcweir         assure(s.aa9.length == 0);
197cdf0e10cSrcweir         assure(s.aa10.length == 0);
198cdf0e10cSrcweir         assure(s.aa11.length == 0);
199cdf0e10cSrcweir         assure(s.aa12.length == 0);
200cdf0e10cSrcweir         assure(s.aa13.length == 0);
201cdf0e10cSrcweir         assure(s.aa14.length == 0);
202cdf0e10cSrcweir         assure(s.aa15.length == 0);
203cdf0e10cSrcweir         assure(s.aa16.length == 0);
204cdf0e10cSrcweir         assure(s.aa17.length == 0);
205cdf0e10cSrcweir         assure(s.aa18.length == 0);
206cdf0e10cSrcweir         assure(s.at1.length == 0);
207cdf0e10cSrcweir         assure(s.at2.length == 0);
208cdf0e10cSrcweir         assure(s.at3.length == 0);
209cdf0e10cSrcweir         assure(s.at4.length == 0);
210cdf0e10cSrcweir         assure(s.at5.length == 0);
211cdf0e10cSrcweir         assure(s.at6.length == 0);
212cdf0e10cSrcweir         assure(s.at7.length == 0);
213cdf0e10cSrcweir         assure(s.at8.length == 0);
214cdf0e10cSrcweir         assure(s.at9.length == 0);
215cdf0e10cSrcweir         assure(s.at10.length == 0);
216cdf0e10cSrcweir         assure(s.at11.length == 0);
217cdf0e10cSrcweir         assure(s.at12.length == 0);
218cdf0e10cSrcweir         assure(s.at13.length == 0);
219cdf0e10cSrcweir         assure(s.at14.length == 0);
220cdf0e10cSrcweir         assure(s.at15.length == 0);
221cdf0e10cSrcweir         assure(s.at16.length == 0);
222cdf0e10cSrcweir         assure(s.at17.length == 0);
223cdf0e10cSrcweir         assure(s.at18.length == 0);
224cdf0e10cSrcweir     }
225cdf0e10cSrcweir 
testFullStruct2()226cdf0e10cSrcweir     public void testFullStruct2() {
227cdf0e10cSrcweir         //TODO:
228cdf0e10cSrcweir         Struct2 s = new Struct2(
229cdf0e10cSrcweir             true, (byte) 1, (short) 2, (short) 3, 4, 5, 6L, 7L, 0.8f, 0.9, 'A',
230cdf0e10cSrcweir             "BCD", Type.UNSIGNED_HYPER, new Integer(22), Enum2.VALUE4,
231cdf0e10cSrcweir             new Struct1(1), null, null, false, (byte) 0, (short) 0, (short) 0,
232cdf0e10cSrcweir             0, 0, 0L, 0L, 0.0f, 0.0, '\u0000', "", Type.VOID, Any.VOID,
233cdf0e10cSrcweir             Enum2.VALUE0, new Struct1(), null, null,
234cdf0e10cSrcweir             new boolean[] { false, true }, new byte[] { (byte) 1, (byte) 2 },
235cdf0e10cSrcweir             new short[0], new short[0], new int[0], new int[0],
236cdf0e10cSrcweir             new long[0], new long[0], new float[0], new double[0], new char[0],
237cdf0e10cSrcweir             new String[0], new Type[0], new Object[0], new Enum2[0],
238cdf0e10cSrcweir             new Struct1[] { new Struct1(1), new Struct1(2) }, new Object[0],
239cdf0e10cSrcweir             new XNamingService[0], new boolean[0][], new byte[0][],
240cdf0e10cSrcweir             new short[0][], new short[0][], new int[0][], new int[0][],
241cdf0e10cSrcweir             new long[0][], new long[0][], new float[0][], new double[0][],
242cdf0e10cSrcweir             new char[0][], new String[0][], new Type[0][], new Object[0][],
243cdf0e10cSrcweir             new Enum2[0][], new Struct1[0][], new Object[0][],
244cdf0e10cSrcweir             new XNamingService[0][], new boolean[0][], new byte[0][],
245cdf0e10cSrcweir             new short[0][], new short[0][], new int[0][], new int[0][],
246cdf0e10cSrcweir             new long[0][], new long[0][], new float[0][], new double[0][],
247cdf0e10cSrcweir             new char[0][], new String[0][], new Type[0][], new Object[0][],
248cdf0e10cSrcweir             new Enum2[0][], new Struct1[0][], new Object[0][],
249cdf0e10cSrcweir             new XNamingService[0][]);
250cdf0e10cSrcweir         assure(s.p1 == true);
251cdf0e10cSrcweir         assure(s.p2 == 1);
252cdf0e10cSrcweir         assure(s.p3 == 2);
253cdf0e10cSrcweir         assure(s.p4 == 3);
254cdf0e10cSrcweir         assure(s.p5 == 4);
255cdf0e10cSrcweir         assure(s.p6 == 5);
256cdf0e10cSrcweir         assure(s.p7 == 6L);
257cdf0e10cSrcweir         assure(s.p8 == 7L);
258cdf0e10cSrcweir         assure(s.p9 == 0.8f);
259cdf0e10cSrcweir         assure(s.p10 == 0.9);
260cdf0e10cSrcweir         assure(s.p11 == 'A');
261cdf0e10cSrcweir         assure(s.p12.equals("BCD"));
262cdf0e10cSrcweir         assure(s.p13.equals(Type.UNSIGNED_HYPER));
263cdf0e10cSrcweir         assure(s.p14.equals(new Integer(22)));
264cdf0e10cSrcweir         assure(s.p15 == Enum2.VALUE4);
265cdf0e10cSrcweir         assure(s.p16.member1 == 1);
266cdf0e10cSrcweir         assure(s.p17 == null);
267cdf0e10cSrcweir         assure(s.p18 == null);
268cdf0e10cSrcweir         assure(s.t1 == false);
269cdf0e10cSrcweir         assure(s.t2 == 0);
270cdf0e10cSrcweir         assure(s.t3 == 0);
271cdf0e10cSrcweir         assure(s.t4 == 0);
272cdf0e10cSrcweir         assure(s.t5 == 0);
273cdf0e10cSrcweir         assure(s.t6 == 0);
274cdf0e10cSrcweir         assure(s.t7 == 0L);
275cdf0e10cSrcweir         assure(s.t8 == 0L);
276cdf0e10cSrcweir         assure(s.t9 == 0.0f);
277cdf0e10cSrcweir         assure(s.t10 == 0.0);
278cdf0e10cSrcweir         assure(s.t11 == '\u0000');
279cdf0e10cSrcweir         assure(s.t12.equals(""));
280cdf0e10cSrcweir         assure(s.t13.equals(Type.VOID));
281cdf0e10cSrcweir         assure(s.t14.equals(Any.VOID));
282cdf0e10cSrcweir         assure(s.t15 == Enum2.VALUE0);
283cdf0e10cSrcweir         assure(s.t16.member1 == 0);
284cdf0e10cSrcweir         assure(s.t17 == null);
285cdf0e10cSrcweir         assure(s.t18 == null);
286cdf0e10cSrcweir         assure(s.a1.length == 2);
287cdf0e10cSrcweir         assure(s.a1[0] == false);
288cdf0e10cSrcweir         assure(s.a1[1] == true);
289cdf0e10cSrcweir         assure(s.a2.length == 2);
290cdf0e10cSrcweir         assure(s.a2[0] == 1);
291cdf0e10cSrcweir         assure(s.a2[1] == 2);
292cdf0e10cSrcweir         assure(s.a3.length == 0);
293cdf0e10cSrcweir         assure(s.a4.length == 0);
294cdf0e10cSrcweir         assure(s.a5.length == 0);
295cdf0e10cSrcweir         assure(s.a6.length == 0);
296cdf0e10cSrcweir         assure(s.a7.length == 0);
297cdf0e10cSrcweir         assure(s.a8.length == 0);
298cdf0e10cSrcweir         assure(s.a9.length == 0);
299cdf0e10cSrcweir         assure(s.a10.length == 0);
300cdf0e10cSrcweir         assure(s.a11.length == 0);
301cdf0e10cSrcweir         assure(s.a12.length == 0);
302cdf0e10cSrcweir         assure(s.a13.length == 0);
303cdf0e10cSrcweir         assure(s.a14.length == 0);
304cdf0e10cSrcweir         assure(s.a15.length == 0);
305cdf0e10cSrcweir         assure(s.a16.length == 2);
306cdf0e10cSrcweir         assure(s.a16[0].member1 == 1);
307cdf0e10cSrcweir         assure(s.a16[1].member1 == 2);
308cdf0e10cSrcweir         assure(s.a17.length == 0);
309cdf0e10cSrcweir         assure(s.a18.length == 0);
310cdf0e10cSrcweir         assure(s.aa1.length == 0);
311cdf0e10cSrcweir         assure(s.aa2.length == 0);
312cdf0e10cSrcweir         assure(s.aa3.length == 0);
313cdf0e10cSrcweir         assure(s.aa4.length == 0);
314cdf0e10cSrcweir         assure(s.aa5.length == 0);
315cdf0e10cSrcweir         assure(s.aa6.length == 0);
316cdf0e10cSrcweir         assure(s.aa7.length == 0);
317cdf0e10cSrcweir         assure(s.aa8.length == 0);
318cdf0e10cSrcweir         assure(s.aa9.length == 0);
319cdf0e10cSrcweir         assure(s.aa10.length == 0);
320cdf0e10cSrcweir         assure(s.aa11.length == 0);
321cdf0e10cSrcweir         assure(s.aa12.length == 0);
322cdf0e10cSrcweir         assure(s.aa13.length == 0);
323cdf0e10cSrcweir         assure(s.aa14.length == 0);
324cdf0e10cSrcweir         assure(s.aa15.length == 0);
325cdf0e10cSrcweir         assure(s.aa16.length == 0);
326cdf0e10cSrcweir         assure(s.aa17.length == 0);
327cdf0e10cSrcweir         assure(s.aa18.length == 0);
328cdf0e10cSrcweir         assure(s.at1.length == 0);
329cdf0e10cSrcweir         assure(s.at2.length == 0);
330cdf0e10cSrcweir         assure(s.at3.length == 0);
331cdf0e10cSrcweir         assure(s.at4.length == 0);
332cdf0e10cSrcweir         assure(s.at5.length == 0);
333cdf0e10cSrcweir         assure(s.at6.length == 0);
334cdf0e10cSrcweir         assure(s.at7.length == 0);
335cdf0e10cSrcweir         assure(s.at8.length == 0);
336cdf0e10cSrcweir         assure(s.at9.length == 0);
337cdf0e10cSrcweir         assure(s.at10.length == 0);
338cdf0e10cSrcweir         assure(s.at11.length == 0);
339cdf0e10cSrcweir         assure(s.at12.length == 0);
340cdf0e10cSrcweir         assure(s.at13.length == 0);
341cdf0e10cSrcweir         assure(s.at14.length == 0);
342cdf0e10cSrcweir         assure(s.at15.length == 0);
343cdf0e10cSrcweir         assure(s.at16.length == 0);
344cdf0e10cSrcweir         assure(s.at17.length == 0);
345cdf0e10cSrcweir         assure(s.at18.length == 0);
346cdf0e10cSrcweir     }
347cdf0e10cSrcweir 
testXEventListener()348cdf0e10cSrcweir     public void testXEventListener() {
349cdf0e10cSrcweir         assure(EventListener.class.isAssignableFrom(XEventListener.class));
350cdf0e10cSrcweir     }
351cdf0e10cSrcweir 
testS1()352cdf0e10cSrcweir     public void testS1() throws com.sun.star.uno.Exception {
353cdf0e10cSrcweir         //TODO:
354cdf0e10cSrcweir         try {
355cdf0e10cSrcweir             S1.create1(context);
356cdf0e10cSrcweir             failed("S1.create1");
357cdf0e10cSrcweir         } catch (DeploymentException e) {}
358cdf0e10cSrcweir         try {
359cdf0e10cSrcweir             S1.create2(context, new Any[0]);
360cdf0e10cSrcweir             failed("S1.create2");
361cdf0e10cSrcweir         } catch (com.sun.star.uno.Exception e) {}
362cdf0e10cSrcweir         try {
363cdf0e10cSrcweir             S1.create3(context, new Any[0]);
364cdf0e10cSrcweir             failed("S1.create3");
365cdf0e10cSrcweir         } catch (DeploymentException e) {}
366cdf0e10cSrcweir         try {
367cdf0e10cSrcweir             S1.create4(context, 0, 0, 0);
368cdf0e10cSrcweir             failed("S1.create4");
369cdf0e10cSrcweir         } catch (DeploymentException e) {}
370cdf0e10cSrcweir         try {
371cdf0e10cSrcweir             S1.create5(
372cdf0e10cSrcweir                 context, false, (byte) 0, (short) 0, (short) 0, 0, 0, 0L, 0L,
373cdf0e10cSrcweir                 0.0f, 0.0, '\u0000', "", Type.VOID, Any.VOID, Enum2.VALUE0,
374cdf0e10cSrcweir                 new Struct1(), null, null, false, (byte) 0, (short) 0,
375cdf0e10cSrcweir                 (short) 0, 0, 0, 0L, 0L, 0.0f, 0.0, '\u0000', "", Type.VOID,
376cdf0e10cSrcweir                 Any.VOID, Enum2.VALUE0, new Struct1(), null, null,
377cdf0e10cSrcweir                 new boolean[0], new byte[0], new short[0], new short[0],
378cdf0e10cSrcweir                 new int[0], new int[0], new long[0], new long[0], new float[0],
379cdf0e10cSrcweir                 new double[0], new char[0], new String[0], new Type[0],
380cdf0e10cSrcweir                 new Object[0], new Enum2[0], new Struct1[0], new Object[0],
381cdf0e10cSrcweir                 new XNamingService[0], new boolean[0][], new byte[0][],
382cdf0e10cSrcweir                 new short[0][], new short[0][], new int[0][], new int[0][],
383cdf0e10cSrcweir                 new long[0][], new long[0][], new float[0][], new double[0][],
384cdf0e10cSrcweir                 new char[0][], new String[0][], new Type[0][], new Object[0][],
385cdf0e10cSrcweir                 new Enum2[0][], new Struct1[0][], new Object[0][],
386cdf0e10cSrcweir                 new XNamingService[0][], new boolean[0][], new byte[0][],
387cdf0e10cSrcweir                 new short[0][], new short[0][], new int[0][], new int[0][],
388cdf0e10cSrcweir                 new long[0][], new long[0][], new float[0][], new double[0][],
389cdf0e10cSrcweir                 new char[0][], new String[0][], new Type[0][], new Object[0][],
390cdf0e10cSrcweir                 new Enum2[0][], new Struct1[0][], new Object[0][],
391cdf0e10cSrcweir                 new XNamingService[0][]);
392cdf0e10cSrcweir             failed("S1.create4");
393cdf0e10cSrcweir         } catch (DeploymentException e) {}
394cdf0e10cSrcweir     }
395cdf0e10cSrcweir 
testS2()396cdf0e10cSrcweir     public void testS2() {
397cdf0e10cSrcweir         //TODO
398cdf0e10cSrcweir     }
399cdf0e10cSrcweir 
testKeywordServices()400cdf0e10cSrcweir     public void testKeywordServices() {
401cdf0e10cSrcweir         try {
402cdf0e10cSrcweir             service_abstract.method_abstract(context, 0);
403cdf0e10cSrcweir             failed("service_abstract.method_abstract");
404cdf0e10cSrcweir         } catch (DeploymentException e) {}
405cdf0e10cSrcweir         try {
406cdf0e10cSrcweir             service_assert.method_assert(context, 0);
407cdf0e10cSrcweir             failed("service_assert.method_assert");
408cdf0e10cSrcweir         } catch (DeploymentException e) {}
409cdf0e10cSrcweir         try {
410cdf0e10cSrcweir             service_break.method_break(context, 0);
411cdf0e10cSrcweir             failed("service_break.method_break");
412cdf0e10cSrcweir         } catch (DeploymentException e) {}
413cdf0e10cSrcweir         try {
414cdf0e10cSrcweir             service_catch.method_catch(context, 0);
415cdf0e10cSrcweir             failed("service_catch.method_catch");
416cdf0e10cSrcweir         } catch (DeploymentException e) {}
417cdf0e10cSrcweir         try {
418cdf0e10cSrcweir             service_class.method_class(context, 0);
419cdf0e10cSrcweir             failed("service_class.method_class");
420cdf0e10cSrcweir         } catch (DeploymentException e) {}
421cdf0e10cSrcweir         try {
422cdf0e10cSrcweir             service_continue.method_continue(context, 0);
423cdf0e10cSrcweir             failed("service_continue.method_continue");
424cdf0e10cSrcweir         } catch (DeploymentException e) {}
425cdf0e10cSrcweir         try {
426cdf0e10cSrcweir             service_do.method_do(context, 0);
427cdf0e10cSrcweir             failed("service_do.method_do");
428cdf0e10cSrcweir         } catch (DeploymentException e) {}
429cdf0e10cSrcweir         try {
430cdf0e10cSrcweir             service_else.method_else(context, 0);
431cdf0e10cSrcweir             failed("service_else.method_else");
432cdf0e10cSrcweir         } catch (DeploymentException e) {}
433cdf0e10cSrcweir         try {
434cdf0e10cSrcweir             service_extends.method_extends(context, 0);
435cdf0e10cSrcweir             failed("service_extends.method_extends");
436cdf0e10cSrcweir         } catch (DeploymentException e) {}
437cdf0e10cSrcweir         try {
438cdf0e10cSrcweir             service_final.method_final(context, 0);
439cdf0e10cSrcweir             failed("service_final.method_final");
440cdf0e10cSrcweir         } catch (DeploymentException e) {}
441cdf0e10cSrcweir         try {
442cdf0e10cSrcweir             service_finally.method_finally(context, 0);
443cdf0e10cSrcweir             failed("service_finally.method_finally");
444cdf0e10cSrcweir         } catch (DeploymentException e) {}
445cdf0e10cSrcweir         try {
446cdf0e10cSrcweir             service_for.method_for(context, 0);
447cdf0e10cSrcweir             failed("service_for.method_for");
448cdf0e10cSrcweir         } catch (DeploymentException e) {}
449cdf0e10cSrcweir         try {
450cdf0e10cSrcweir             service_goto.method_goto(context, 0);
451cdf0e10cSrcweir             failed("service_goto.method_goto");
452cdf0e10cSrcweir         } catch (DeploymentException e) {}
453cdf0e10cSrcweir         try {
454cdf0e10cSrcweir             service_if.method_if(context, 0);
455cdf0e10cSrcweir             failed("service_if.method_if");
456cdf0e10cSrcweir         } catch (DeploymentException e) {}
457cdf0e10cSrcweir         try {
458cdf0e10cSrcweir             service_implements.method_implements(context, 0);
459cdf0e10cSrcweir             failed("service_implements.method_implements");
460cdf0e10cSrcweir         } catch (DeploymentException e) {}
461cdf0e10cSrcweir         try {
462cdf0e10cSrcweir             service_import.method_import(context, 0);
463cdf0e10cSrcweir             failed("service_import.method_import");
464cdf0e10cSrcweir         } catch (DeploymentException e) {}
465cdf0e10cSrcweir         try {
466cdf0e10cSrcweir             service_instanceof.method_instanceof(context, 0);
467cdf0e10cSrcweir             failed("service_instanceof.method_instanceof");
468cdf0e10cSrcweir         } catch (DeploymentException e) {}
469cdf0e10cSrcweir         try {
470cdf0e10cSrcweir             service_int.method_int(context, 0);
471cdf0e10cSrcweir             failed("service_int.method_int");
472cdf0e10cSrcweir         } catch (DeploymentException e) {}
473cdf0e10cSrcweir         try {
474cdf0e10cSrcweir             service_native.method_native(context, 0);
475cdf0e10cSrcweir             failed("service_native.method_native");
476cdf0e10cSrcweir         } catch (DeploymentException e) {}
477cdf0e10cSrcweir         try {
478cdf0e10cSrcweir             service_new.method_new(context, 0);
479cdf0e10cSrcweir             failed("service_new.method_new");
480cdf0e10cSrcweir         } catch (DeploymentException e) {}
481cdf0e10cSrcweir         try {
482cdf0e10cSrcweir             service_package.method_package(context, 0);
483cdf0e10cSrcweir             failed("service_package.method_package");
484cdf0e10cSrcweir         } catch (DeploymentException e) {}
485cdf0e10cSrcweir         try {
486cdf0e10cSrcweir             service_private.method_private(context, 0);
487cdf0e10cSrcweir             failed("service_private.method_private");
488cdf0e10cSrcweir         } catch (DeploymentException e) {}
489cdf0e10cSrcweir         try {
490cdf0e10cSrcweir             service_protected.method_protected(context, 0);
491cdf0e10cSrcweir             failed("service_protected.method_protected");
492cdf0e10cSrcweir         } catch (DeploymentException e) {}
493cdf0e10cSrcweir         try {
494cdf0e10cSrcweir             service_public.method_public(context, 0);
495cdf0e10cSrcweir             failed("service_public.method_public");
496cdf0e10cSrcweir         } catch (DeploymentException e) {}
497cdf0e10cSrcweir         try {
498cdf0e10cSrcweir             service_return.method_return(context, 0);
499cdf0e10cSrcweir             failed("service_return.method_return");
500cdf0e10cSrcweir         } catch (DeploymentException e) {}
501cdf0e10cSrcweir         try {
502cdf0e10cSrcweir             service_static.method_static(context, 0);
503cdf0e10cSrcweir             failed("service_static.method_static");
504cdf0e10cSrcweir         } catch (DeploymentException e) {}
505cdf0e10cSrcweir         try {
506cdf0e10cSrcweir             service_strictfp.method_strictfp(context, 0);
507cdf0e10cSrcweir             failed("service_strictfp.method_strictfp");
508cdf0e10cSrcweir         } catch (DeploymentException e) {}
509cdf0e10cSrcweir         try {
510cdf0e10cSrcweir             service_super.method_super(context, 0);
511cdf0e10cSrcweir             failed("service_super.method_super");
512cdf0e10cSrcweir         } catch (DeploymentException e) {}
513cdf0e10cSrcweir         try {
514cdf0e10cSrcweir             service_synchronized.method_synchronized(context, 0);
515cdf0e10cSrcweir             failed("service_synchronized.method_synchronized");
516cdf0e10cSrcweir         } catch (DeploymentException e) {}
517cdf0e10cSrcweir         try {
518cdf0e10cSrcweir             service_this.method_this(context, 0);
519cdf0e10cSrcweir             failed("service_this.method_this");
520cdf0e10cSrcweir         } catch (DeploymentException e) {}
521cdf0e10cSrcweir         try {
522cdf0e10cSrcweir             service_throw.method_throw(context, 0);
523cdf0e10cSrcweir             failed("service_throw.method_throw");
524cdf0e10cSrcweir         } catch (DeploymentException e) {}
525cdf0e10cSrcweir         try {
526cdf0e10cSrcweir             service_throws.method_throws(context, 0);
527cdf0e10cSrcweir             failed("service_throws.method_throws");
528cdf0e10cSrcweir         } catch (DeploymentException e) {}
529cdf0e10cSrcweir         try {
530cdf0e10cSrcweir             service_try.method_try(context, 0);
531cdf0e10cSrcweir             failed("service_try.method_try");
532cdf0e10cSrcweir         } catch (DeploymentException e) {}
533cdf0e10cSrcweir         try {
534cdf0e10cSrcweir             service_volatile.method_volatile(context, 0);
535cdf0e10cSrcweir             failed("service_volatile.method_volatile");
536cdf0e10cSrcweir         } catch (DeploymentException e) {}
537cdf0e10cSrcweir         try {
538cdf0e10cSrcweir             service_while.method_while(context, 0);
539cdf0e10cSrcweir             failed("service_while.method_while");
540cdf0e10cSrcweir         } catch (DeploymentException e) {}
541cdf0e10cSrcweir     }
542cdf0e10cSrcweir 
testSingletons()543cdf0e10cSrcweir     public void testSingletons() {
544cdf0e10cSrcweir         try {
545cdf0e10cSrcweir             S4.get(context);
546cdf0e10cSrcweir             failed("S4");
547cdf0e10cSrcweir         } catch (DeploymentException e) {}
548cdf0e10cSrcweir         try {
549cdf0e10cSrcweir             singleton_abstract.get(context);
550cdf0e10cSrcweir             failed("singleton_abstract");
551cdf0e10cSrcweir         } catch (DeploymentException e) {}
552cdf0e10cSrcweir     }
553cdf0e10cSrcweir 
554cdf0e10cSrcweir     private XComponentContext context;
555cdf0e10cSrcweir }
556