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