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 com.sun.star.comp.bridge; 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir import com.sun.star.comp.loader.FactoryHelper; 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir import com.sun.star.lang.XServiceInfo; 33*cdf0e10cSrcweir import com.sun.star.lang.XTypeProvider; 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir import com.sun.star.test.performance.ComplexTypes; 36*cdf0e10cSrcweir import com.sun.star.test.performance.XPerformanceTest; 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir import test.testtools.bridgetest.BadConstructorArguments; 39*cdf0e10cSrcweir import test.testtools.bridgetest.Constructors; 40*cdf0e10cSrcweir import test.testtools.bridgetest.Constructors2; 41*cdf0e10cSrcweir import test.testtools.bridgetest.TestDataElements; 42*cdf0e10cSrcweir import test.testtools.bridgetest.TestElement; 43*cdf0e10cSrcweir import test.testtools.bridgetest.TestEnum; 44*cdf0e10cSrcweir import test.testtools.bridgetest.TestPolyStruct; 45*cdf0e10cSrcweir import test.testtools.bridgetest.TestPolyStruct2; 46*cdf0e10cSrcweir import test.testtools.bridgetest.TestStruct; 47*cdf0e10cSrcweir import test.testtools.bridgetest.SmallStruct; 48*cdf0e10cSrcweir import test.testtools.bridgetest.MediumStruct; 49*cdf0e10cSrcweir import test.testtools.bridgetest.BigStruct; 50*cdf0e10cSrcweir import test.testtools.bridgetest.AllFloats; 51*cdf0e10cSrcweir import test.testtools.bridgetest.XBridgeTest; 52*cdf0e10cSrcweir import test.testtools.bridgetest.XBridgeTest2; 53*cdf0e10cSrcweir import test.testtools.bridgetest.XCurrentContextChecker; 54*cdf0e10cSrcweir import test.testtools.bridgetest.XMulti; 55*cdf0e10cSrcweir import test.testtools.bridgetest.XRecursiveCall; 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir 58*cdf0e10cSrcweir import com.sun.star.lang.IllegalArgumentException; 59*cdf0e10cSrcweir import com.sun.star.lang.XMultiServiceFactory; 60*cdf0e10cSrcweir import com.sun.star.lang.XSingleServiceFactory; 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir import com.sun.star.registry.XRegistryKey; 63*cdf0e10cSrcweir 64*cdf0e10cSrcweir import com.sun.star.uno.Any; 65*cdf0e10cSrcweir import com.sun.star.uno.Type; 66*cdf0e10cSrcweir import com.sun.star.uno.XComponentContext; 67*cdf0e10cSrcweir import com.sun.star.uno.XInterface; 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir public class TestComponent { 70*cdf0e10cSrcweir static public final boolean DEBUG = false; 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir static public class _PerformancTestObject implements XPerformanceTest, XServiceInfo, XTypeProvider { 73*cdf0e10cSrcweir static private final String __serviceName = "com.sun.star.comp.benchmark.JavaTestObject"; 74*cdf0e10cSrcweir 75*cdf0e10cSrcweir private boolean _bool; 76*cdf0e10cSrcweir private char _char; 77*cdf0e10cSrcweir private byte _byte; 78*cdf0e10cSrcweir private short _short; 79*cdf0e10cSrcweir private int _long; 80*cdf0e10cSrcweir private int _ulong; 81*cdf0e10cSrcweir private long _hyper; 82*cdf0e10cSrcweir private float _float; 83*cdf0e10cSrcweir private double _double; 84*cdf0e10cSrcweir private String _string = ""; 85*cdf0e10cSrcweir private Object _xInterface; 86*cdf0e10cSrcweir private Object _any; 87*cdf0e10cSrcweir private Object _interface_sequence[] = new Object[0]; 88*cdf0e10cSrcweir private ComplexTypes _complexTypes = new ComplexTypes(); 89*cdf0e10cSrcweir 90*cdf0e10cSrcweir // Attributes 91*cdf0e10cSrcweir public int getLong_attr() throws com.sun.star.uno.RuntimeException { 92*cdf0e10cSrcweir return _long; 93*cdf0e10cSrcweir } 94*cdf0e10cSrcweir 95*cdf0e10cSrcweir public void setLong_attr( int _long_attr ) throws com.sun.star.uno.RuntimeException { 96*cdf0e10cSrcweir _long = _long_attr; 97*cdf0e10cSrcweir } 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir public long getHyper_attr() throws com.sun.star.uno.RuntimeException { 100*cdf0e10cSrcweir return _hyper; 101*cdf0e10cSrcweir } 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir public void setHyper_attr( long _hyper_attr ) throws com.sun.star.uno.RuntimeException { 104*cdf0e10cSrcweir _hyper = _hyper_attr; 105*cdf0e10cSrcweir } 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir public float getFloat_attr() throws com.sun.star.uno.RuntimeException { 108*cdf0e10cSrcweir return _float; 109*cdf0e10cSrcweir } 110*cdf0e10cSrcweir 111*cdf0e10cSrcweir public void setFloat_attr( float _float_attr ) throws com.sun.star.uno.RuntimeException { 112*cdf0e10cSrcweir _float = _float; 113*cdf0e10cSrcweir } 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir public double getDouble_attr() throws com.sun.star.uno.RuntimeException { 116*cdf0e10cSrcweir return _double; 117*cdf0e10cSrcweir } 118*cdf0e10cSrcweir 119*cdf0e10cSrcweir public void setDouble_attr( double _double_attr ) throws com.sun.star.uno.RuntimeException { 120*cdf0e10cSrcweir _double = _double_attr; 121*cdf0e10cSrcweir } 122*cdf0e10cSrcweir 123*cdf0e10cSrcweir public String getString_attr() throws com.sun.star.uno.RuntimeException { 124*cdf0e10cSrcweir return _string; 125*cdf0e10cSrcweir } 126*cdf0e10cSrcweir 127*cdf0e10cSrcweir public void setString_attr( String _string_attr ) throws com.sun.star.uno.RuntimeException { 128*cdf0e10cSrcweir _string = _string_attr; 129*cdf0e10cSrcweir } 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir public Object getInterface_attr() throws com.sun.star.uno.RuntimeException { 132*cdf0e10cSrcweir return _xInterface; 133*cdf0e10cSrcweir } 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir public void setInterface_attr( java.lang.Object _interface_attr ) throws com.sun.star.uno.RuntimeException { 136*cdf0e10cSrcweir _xInterface = _interface_attr; 137*cdf0e10cSrcweir } 138*cdf0e10cSrcweir 139*cdf0e10cSrcweir public Object getAny_attr() throws com.sun.star.uno.RuntimeException { 140*cdf0e10cSrcweir return _any; 141*cdf0e10cSrcweir } 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir public void setAny_attr(Object _any_attr ) throws com.sun.star.uno.RuntimeException { 144*cdf0e10cSrcweir _any = _any_attr; 145*cdf0e10cSrcweir } 146*cdf0e10cSrcweir 147*cdf0e10cSrcweir public Object[] getSequence_attr() throws com.sun.star.uno.RuntimeException { 148*cdf0e10cSrcweir return _interface_sequence; 149*cdf0e10cSrcweir } 150*cdf0e10cSrcweir 151*cdf0e10cSrcweir public void setSequence_attr(Object[] _sequence_attr ) throws com.sun.star.uno.RuntimeException { 152*cdf0e10cSrcweir _interface_sequence = _sequence_attr; 153*cdf0e10cSrcweir } 154*cdf0e10cSrcweir 155*cdf0e10cSrcweir public ComplexTypes getStruct_attr() throws com.sun.star.uno.RuntimeException { 156*cdf0e10cSrcweir return _complexTypes; 157*cdf0e10cSrcweir } 158*cdf0e10cSrcweir 159*cdf0e10cSrcweir public void setStruct_attr( ComplexTypes _struct_attr ) throws com.sun.star.uno.RuntimeException { 160*cdf0e10cSrcweir _complexTypes = _struct_attr; 161*cdf0e10cSrcweir } 162*cdf0e10cSrcweir 163*cdf0e10cSrcweir 164*cdf0e10cSrcweir // Methods 165*cdf0e10cSrcweir public void async() throws com.sun.star.uno.RuntimeException { 166*cdf0e10cSrcweir } 167*cdf0e10cSrcweir 168*cdf0e10cSrcweir public void sync( ) throws com.sun.star.uno.RuntimeException { 169*cdf0e10cSrcweir } 170*cdf0e10cSrcweir 171*cdf0e10cSrcweir public ComplexTypes complex_in( /*IN*/ComplexTypes aVal ) throws com.sun.star.uno.RuntimeException { 172*cdf0e10cSrcweir return aVal; 173*cdf0e10cSrcweir } 174*cdf0e10cSrcweir 175*cdf0e10cSrcweir public ComplexTypes complex_inout( /*INOUT*/ComplexTypes[] aVal ) throws com.sun.star.uno.RuntimeException { 176*cdf0e10cSrcweir return aVal[0]; 177*cdf0e10cSrcweir } 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir public void complex_oneway( /*IN*/ComplexTypes aVal ) throws com.sun.star.uno.RuntimeException { 180*cdf0e10cSrcweir } 181*cdf0e10cSrcweir 182*cdf0e10cSrcweir public void complex_noreturn( /*IN*/ComplexTypes aVal ) throws com.sun.star.uno.RuntimeException { 183*cdf0e10cSrcweir } 184*cdf0e10cSrcweir 185*cdf0e10cSrcweir public XPerformanceTest createObject( ) throws com.sun.star.uno.RuntimeException { 186*cdf0e10cSrcweir return new _PerformancTestObject(); 187*cdf0e10cSrcweir } 188*cdf0e10cSrcweir 189*cdf0e10cSrcweir public int getLong() throws com.sun.star.uno.RuntimeException { 190*cdf0e10cSrcweir return _long; 191*cdf0e10cSrcweir } 192*cdf0e10cSrcweir 193*cdf0e10cSrcweir public void setLong(/*IN*/int n) throws com.sun.star.uno.RuntimeException { 194*cdf0e10cSrcweir _long = n; 195*cdf0e10cSrcweir } 196*cdf0e10cSrcweir 197*cdf0e10cSrcweir public long getHyper() throws com.sun.star.uno.RuntimeException { 198*cdf0e10cSrcweir return _hyper; 199*cdf0e10cSrcweir } 200*cdf0e10cSrcweir 201*cdf0e10cSrcweir public void setHyper(/*IN*/long n) throws com.sun.star.uno.RuntimeException { 202*cdf0e10cSrcweir _hyper = n; 203*cdf0e10cSrcweir } 204*cdf0e10cSrcweir 205*cdf0e10cSrcweir public float getFloat() throws com.sun.star.uno.RuntimeException { 206*cdf0e10cSrcweir return _float; 207*cdf0e10cSrcweir } 208*cdf0e10cSrcweir 209*cdf0e10cSrcweir public void setFloat( /*IN*/float f ) throws com.sun.star.uno.RuntimeException { 210*cdf0e10cSrcweir _float = f; 211*cdf0e10cSrcweir } 212*cdf0e10cSrcweir 213*cdf0e10cSrcweir public double getDouble( ) throws com.sun.star.uno.RuntimeException { 214*cdf0e10cSrcweir return _double; 215*cdf0e10cSrcweir } 216*cdf0e10cSrcweir 217*cdf0e10cSrcweir public void setDouble( /*IN*/double f ) throws com.sun.star.uno.RuntimeException { 218*cdf0e10cSrcweir _double = f; 219*cdf0e10cSrcweir } 220*cdf0e10cSrcweir 221*cdf0e10cSrcweir public String getString( ) throws com.sun.star.uno.RuntimeException { 222*cdf0e10cSrcweir return _string; 223*cdf0e10cSrcweir } 224*cdf0e10cSrcweir 225*cdf0e10cSrcweir public void setString( /*IN*/String s ) throws com.sun.star.uno.RuntimeException { 226*cdf0e10cSrcweir _string = s; 227*cdf0e10cSrcweir } 228*cdf0e10cSrcweir 229*cdf0e10cSrcweir public Object getInterface( ) throws com.sun.star.uno.RuntimeException { 230*cdf0e10cSrcweir return _xInterface; 231*cdf0e10cSrcweir } 232*cdf0e10cSrcweir 233*cdf0e10cSrcweir public void setInterface( /*IN*/Object x ) throws com.sun.star.uno.RuntimeException { 234*cdf0e10cSrcweir _xInterface = x; 235*cdf0e10cSrcweir } 236*cdf0e10cSrcweir 237*cdf0e10cSrcweir public Object getAny( ) throws com.sun.star.uno.RuntimeException { 238*cdf0e10cSrcweir return _any; 239*cdf0e10cSrcweir } 240*cdf0e10cSrcweir 241*cdf0e10cSrcweir public void setAny( /*IN*/java.lang.Object a ) throws com.sun.star.uno.RuntimeException { 242*cdf0e10cSrcweir _any = a; 243*cdf0e10cSrcweir } 244*cdf0e10cSrcweir 245*cdf0e10cSrcweir public Object[] getSequence( ) throws com.sun.star.uno.RuntimeException { 246*cdf0e10cSrcweir return _interface_sequence; 247*cdf0e10cSrcweir } 248*cdf0e10cSrcweir 249*cdf0e10cSrcweir public void setSequence( /*IN*/Object[] seq ) throws com.sun.star.uno.RuntimeException { 250*cdf0e10cSrcweir if(DEBUG) System.err.println("#### " + getClass().getName() + ".setSequence:" + seq); 251*cdf0e10cSrcweir 252*cdf0e10cSrcweir _interface_sequence = seq; 253*cdf0e10cSrcweir } 254*cdf0e10cSrcweir 255*cdf0e10cSrcweir public ComplexTypes getStruct( ) throws com.sun.star.uno.RuntimeException { 256*cdf0e10cSrcweir return _complexTypes; 257*cdf0e10cSrcweir } 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir public void setStruct( /*IN*/ComplexTypes c ) throws com.sun.star.uno.RuntimeException { 260*cdf0e10cSrcweir _complexTypes = c; 261*cdf0e10cSrcweir } 262*cdf0e10cSrcweir 263*cdf0e10cSrcweir public void raiseRuntimeException( ) throws com.sun.star.uno.RuntimeException { 264*cdf0e10cSrcweir throw new com.sun.star.uno.RuntimeException(); 265*cdf0e10cSrcweir } 266*cdf0e10cSrcweir 267*cdf0e10cSrcweir // XServiceInfo 268*cdf0e10cSrcweir public String getImplementationName() throws com.sun.star.uno.RuntimeException { 269*cdf0e10cSrcweir return __serviceName; 270*cdf0e10cSrcweir } 271*cdf0e10cSrcweir 272*cdf0e10cSrcweir public boolean supportsService(String rServiceName) throws com.sun.star.uno.RuntimeException { 273*cdf0e10cSrcweir String rSNL[] = getSupportedServiceNames(); 274*cdf0e10cSrcweir 275*cdf0e10cSrcweir for(int nPos = rSNL.length; (nPos--) != 0;) { 276*cdf0e10cSrcweir if (rSNL[nPos].equals(rServiceName)) 277*cdf0e10cSrcweir return true; 278*cdf0e10cSrcweir } 279*cdf0e10cSrcweir 280*cdf0e10cSrcweir return false; 281*cdf0e10cSrcweir } 282*cdf0e10cSrcweir 283*cdf0e10cSrcweir public String [] getSupportedServiceNames() throws com.sun.star.uno.RuntimeException { 284*cdf0e10cSrcweir return new String[]{__serviceName}; 285*cdf0e10cSrcweir } 286*cdf0e10cSrcweir 287*cdf0e10cSrcweir // XTypeProvider 288*cdf0e10cSrcweir public Type[] getTypes() throws com.sun.star.uno.RuntimeException { 289*cdf0e10cSrcweir try { 290*cdf0e10cSrcweir return new Type[]{new Type(XPerformanceTest.class), new Type(XServiceInfo.class), new Type(XTypeProvider.class)}; 291*cdf0e10cSrcweir } 292*cdf0e10cSrcweir catch(Exception exception) { 293*cdf0e10cSrcweir throw new com.sun.star.uno.RuntimeException(exception.getMessage()); 294*cdf0e10cSrcweir } 295*cdf0e10cSrcweir } 296*cdf0e10cSrcweir 297*cdf0e10cSrcweir public byte[] getImplementationId() throws com.sun.star.uno.RuntimeException { 298*cdf0e10cSrcweir return toString().getBytes(); 299*cdf0e10cSrcweir } 300*cdf0e10cSrcweir } 301*cdf0e10cSrcweir 302*cdf0e10cSrcweir static public class _TestObject implements XBridgeTest2, XRecursiveCall, XServiceInfo, XTypeProvider { 303*cdf0e10cSrcweir static private final String __serviceName = "com.sun.star.test.bridge.JavaTestObject"; 304*cdf0e10cSrcweir 305*cdf0e10cSrcweir private boolean _bool; 306*cdf0e10cSrcweir private char _char; 307*cdf0e10cSrcweir private byte _byte; 308*cdf0e10cSrcweir private short _short; 309*cdf0e10cSrcweir private short _ushort; 310*cdf0e10cSrcweir private int _long; 311*cdf0e10cSrcweir private int _ulong; 312*cdf0e10cSrcweir private long _hyper; 313*cdf0e10cSrcweir private long _uhyper; 314*cdf0e10cSrcweir private float _float; 315*cdf0e10cSrcweir private double _double; 316*cdf0e10cSrcweir private String _string; 317*cdf0e10cSrcweir private Object _xInterface; 318*cdf0e10cSrcweir private Object _any; 319*cdf0e10cSrcweir private TestEnum _testEnum = TestEnum.TEST; 320*cdf0e10cSrcweir private TestElement _testElements[] = new TestElement[0]; 321*cdf0e10cSrcweir private TestDataElements _testDataElements = new TestDataElements(); 322*cdf0e10cSrcweir 323*cdf0e10cSrcweir private int _nLastCallId; 324*cdf0e10cSrcweir private boolean _bFirstCall; 325*cdf0e10cSrcweir private boolean _bSequenceOfCallTestPassed; 326*cdf0e10cSrcweir 327*cdf0e10cSrcweir private boolean[] arBool; 328*cdf0e10cSrcweir private char[] arChar; 329*cdf0e10cSrcweir private byte[] arByte; 330*cdf0e10cSrcweir private short[] arShort; 331*cdf0e10cSrcweir private short[] arUShort; 332*cdf0e10cSrcweir private int[] arLong; 333*cdf0e10cSrcweir private int[] arULong; 334*cdf0e10cSrcweir private long[] arHyper; 335*cdf0e10cSrcweir private long[] arUHyper; 336*cdf0e10cSrcweir private float[] arFloat; 337*cdf0e10cSrcweir private double[] arDouble; 338*cdf0e10cSrcweir private String[] arString; 339*cdf0e10cSrcweir private Object[] arObject; 340*cdf0e10cSrcweir private Object[] arAny; 341*cdf0e10cSrcweir private TestEnum[] arEnum; 342*cdf0e10cSrcweir private int[][] arLong2; 343*cdf0e10cSrcweir private int[][][] arLong3; 344*cdf0e10cSrcweir public _TestObject(XMultiServiceFactory xMultiServiceFactory) { 345*cdf0e10cSrcweir if(DEBUG) System.err.println("##### " + getClass().getName() + ".<init> " + xMultiServiceFactory); 346*cdf0e10cSrcweir 347*cdf0e10cSrcweir _nLastCallId = 0; 348*cdf0e10cSrcweir _bFirstCall = true; 349*cdf0e10cSrcweir _bSequenceOfCallTestPassed = true; 350*cdf0e10cSrcweir } 351*cdf0e10cSrcweir 352*cdf0e10cSrcweir 353*cdf0e10cSrcweir public void setValues(boolean bBool, 354*cdf0e10cSrcweir char cChar, 355*cdf0e10cSrcweir byte nByte, 356*cdf0e10cSrcweir short nShort, 357*cdf0e10cSrcweir short nUShort, 358*cdf0e10cSrcweir int nLong, 359*cdf0e10cSrcweir int nULong, 360*cdf0e10cSrcweir long nHyper, 361*cdf0e10cSrcweir long nUHyper, 362*cdf0e10cSrcweir float fFloat, 363*cdf0e10cSrcweir double fDouble, 364*cdf0e10cSrcweir TestEnum testEnum, 365*cdf0e10cSrcweir String string, 366*cdf0e10cSrcweir Object xInterface, 367*cdf0e10cSrcweir Object any, 368*cdf0e10cSrcweir TestElement testElements[], 369*cdf0e10cSrcweir TestDataElements testDataElements) throws com.sun.star.uno.RuntimeException 370*cdf0e10cSrcweir { 371*cdf0e10cSrcweir if(DEBUG) System.err.println("##### " + getClass().getName() + ".setValues:" + any); 372*cdf0e10cSrcweir 373*cdf0e10cSrcweir _bool = bBool; 374*cdf0e10cSrcweir _char = cChar; 375*cdf0e10cSrcweir _byte = nByte; 376*cdf0e10cSrcweir _short = nShort; 377*cdf0e10cSrcweir _ushort = nUShort; 378*cdf0e10cSrcweir _long = nLong; 379*cdf0e10cSrcweir _ulong = nULong; 380*cdf0e10cSrcweir _hyper = nHyper; 381*cdf0e10cSrcweir _uhyper = nUHyper; 382*cdf0e10cSrcweir _float = fFloat; 383*cdf0e10cSrcweir _double = fDouble; 384*cdf0e10cSrcweir _testEnum = testEnum; 385*cdf0e10cSrcweir _string = string; 386*cdf0e10cSrcweir _xInterface = xInterface; 387*cdf0e10cSrcweir _any = any; 388*cdf0e10cSrcweir _testElements = testElements; 389*cdf0e10cSrcweir _testDataElements = testDataElements; 390*cdf0e10cSrcweir } 391*cdf0e10cSrcweir 392*cdf0e10cSrcweir 393*cdf0e10cSrcweir 394*cdf0e10cSrcweir public TestDataElements setValues2(/*INOUT*/boolean[] io_bool, 395*cdf0e10cSrcweir /*INOUT*/char[] io_char, 396*cdf0e10cSrcweir /*INOUT*/byte[] io_byte, 397*cdf0e10cSrcweir /*INOUT*/short[] io_short, 398*cdf0e10cSrcweir /*INOUT*/short[] io_ushort, 399*cdf0e10cSrcweir /*INOUT*/int[] io_long, 400*cdf0e10cSrcweir /*INOUT*/int[] io_ulong, 401*cdf0e10cSrcweir /*INOUT*/long[] io_hyper, 402*cdf0e10cSrcweir /*INOUT*/long[] io_uhyper, 403*cdf0e10cSrcweir /*INOUT*/float[] io_float, 404*cdf0e10cSrcweir /*INOUT*/double[] io_double, 405*cdf0e10cSrcweir /*INOUT*/TestEnum[] io_testEnum, 406*cdf0e10cSrcweir /*INOUT*/String[] io_string, 407*cdf0e10cSrcweir /*INOUT*/Object[] io_xInterface, 408*cdf0e10cSrcweir /*INOUT*/Object[] io_any, 409*cdf0e10cSrcweir /*INOUT*/TestElement[][] io_testElements, 410*cdf0e10cSrcweir /*INOUT*/TestDataElements[] io_testDataElements) throws com.sun.star.uno.RuntimeException 411*cdf0e10cSrcweir { 412*cdf0e10cSrcweir if(DEBUG) System.err.println("##### " + getClass().getName() + ".setValues2:" + io_any[0]); 413*cdf0e10cSrcweir 414*cdf0e10cSrcweir _bool = io_bool[0]; 415*cdf0e10cSrcweir _char = io_char[0]; 416*cdf0e10cSrcweir _byte = io_byte[0]; 417*cdf0e10cSrcweir _short = io_short[0]; 418*cdf0e10cSrcweir _ushort = io_ushort[0]; 419*cdf0e10cSrcweir _long = io_long[0]; 420*cdf0e10cSrcweir _ulong = io_ulong[0]; 421*cdf0e10cSrcweir _hyper = io_hyper[0]; 422*cdf0e10cSrcweir _uhyper = io_uhyper[0]; 423*cdf0e10cSrcweir _float = io_float[0]; 424*cdf0e10cSrcweir _double = io_double[0]; 425*cdf0e10cSrcweir _testEnum = io_testEnum[0]; 426*cdf0e10cSrcweir _string = io_string[0]; 427*cdf0e10cSrcweir _xInterface = io_xInterface[0]; 428*cdf0e10cSrcweir _any = io_any[0]; 429*cdf0e10cSrcweir _testElements = io_testElements[0]; 430*cdf0e10cSrcweir _testDataElements = io_testDataElements[0]; 431*cdf0e10cSrcweir 432*cdf0e10cSrcweir io_testElements[ 0 ] = 433*cdf0e10cSrcweir new TestElement [] { io_testElements[ 0 ][ 1 ], io_testElements[ 0 ][ 0 ] }; 434*cdf0e10cSrcweir 435*cdf0e10cSrcweir return _testDataElements; 436*cdf0e10cSrcweir } 437*cdf0e10cSrcweir 438*cdf0e10cSrcweir public TestDataElements getValues(/*OUT*/boolean[] o_bool, 439*cdf0e10cSrcweir /*OUT*/char[] o_char, 440*cdf0e10cSrcweir /*OUT*/byte[] o_byte, 441*cdf0e10cSrcweir /*OUT*/short[] o_short, 442*cdf0e10cSrcweir /*OUT*/short[] o_ushort, 443*cdf0e10cSrcweir /*OUT*/int[] o_long, 444*cdf0e10cSrcweir /*OUT*/int[] o_ulong, 445*cdf0e10cSrcweir /*OUT*/long[] o_hyper, 446*cdf0e10cSrcweir /*OUT*/long[] o_uhyper, 447*cdf0e10cSrcweir /*OUT*/float[] o_float, 448*cdf0e10cSrcweir /*OUT*/double[] o_double, 449*cdf0e10cSrcweir /*OUT*/TestEnum[] o_testEnum, 450*cdf0e10cSrcweir /*OUT*/String[] o_string, 451*cdf0e10cSrcweir /*OUT*/Object[] o_xInterface, 452*cdf0e10cSrcweir /*OUT*/Object[] o_any, 453*cdf0e10cSrcweir /*OUT*/TestElement[][] o_testElements, 454*cdf0e10cSrcweir /*OUT*/TestDataElements[] o_testDataElements) throws com.sun.star.uno.RuntimeException 455*cdf0e10cSrcweir { 456*cdf0e10cSrcweir if(DEBUG) System.err.println("##### " + getClass().getName() + ".getValues:" + _any); 457*cdf0e10cSrcweir 458*cdf0e10cSrcweir o_bool[0] = _bool; 459*cdf0e10cSrcweir o_char[0] = _char; 460*cdf0e10cSrcweir o_byte[0] = _byte; 461*cdf0e10cSrcweir o_short[0] = _short; 462*cdf0e10cSrcweir o_ushort[0] = _ushort; 463*cdf0e10cSrcweir o_long[0] = _long; 464*cdf0e10cSrcweir o_ulong[0] = _ulong; 465*cdf0e10cSrcweir o_hyper[0] = _hyper; 466*cdf0e10cSrcweir o_uhyper[0] = _uhyper; 467*cdf0e10cSrcweir o_float[0] = _float; 468*cdf0e10cSrcweir o_double[0] = _double; 469*cdf0e10cSrcweir o_testEnum[0] = _testEnum; 470*cdf0e10cSrcweir o_string[0] = _string; 471*cdf0e10cSrcweir o_xInterface[0] = _xInterface; 472*cdf0e10cSrcweir o_any[0] = _any; 473*cdf0e10cSrcweir o_testElements[0] = _testElements; 474*cdf0e10cSrcweir o_testDataElements[0] = _testDataElements; 475*cdf0e10cSrcweir 476*cdf0e10cSrcweir return _testDataElements; 477*cdf0e10cSrcweir } 478*cdf0e10cSrcweir 479*cdf0e10cSrcweir public SmallStruct echoSmallStruct( SmallStruct i_Struct) throws com.sun.star.uno.RuntimeException { 480*cdf0e10cSrcweir return i_Struct; 481*cdf0e10cSrcweir } 482*cdf0e10cSrcweir 483*cdf0e10cSrcweir public MediumStruct echoMediumStruct( MediumStruct i_Struct) throws com.sun.star.uno.RuntimeException { 484*cdf0e10cSrcweir return i_Struct; 485*cdf0e10cSrcweir } 486*cdf0e10cSrcweir 487*cdf0e10cSrcweir public BigStruct echoBigStruct( BigStruct i_Struct) throws com.sun.star.uno.RuntimeException { 488*cdf0e10cSrcweir return i_Struct; 489*cdf0e10cSrcweir } 490*cdf0e10cSrcweir 491*cdf0e10cSrcweir public AllFloats echoAllFloats( AllFloats i_Struct) throws com.sun.star.uno.RuntimeException { 492*cdf0e10cSrcweir return i_Struct; 493*cdf0e10cSrcweir } 494*cdf0e10cSrcweir 495*cdf0e10cSrcweir public int testPPCAlignment( long l1, long l2, int i1, long l3, int i2 ) throws com.sun.star.uno.RuntimeException { 496*cdf0e10cSrcweir return i2; 497*cdf0e10cSrcweir } 498*cdf0e10cSrcweir 499*cdf0e10cSrcweir // Attributes 500*cdf0e10cSrcweir public boolean getBool() throws com.sun.star.uno.RuntimeException { 501*cdf0e10cSrcweir return _bool; 502*cdf0e10cSrcweir } 503*cdf0e10cSrcweir 504*cdf0e10cSrcweir public void setBool(boolean bool) throws com.sun.star.uno.RuntimeException { 505*cdf0e10cSrcweir _bool = bool; 506*cdf0e10cSrcweir } 507*cdf0e10cSrcweir 508*cdf0e10cSrcweir public byte getByte() throws com.sun.star.uno.RuntimeException { 509*cdf0e10cSrcweir return _byte; 510*cdf0e10cSrcweir } 511*cdf0e10cSrcweir 512*cdf0e10cSrcweir public void setByte(byte zbyte) throws com.sun.star.uno.RuntimeException { 513*cdf0e10cSrcweir _byte = zbyte; 514*cdf0e10cSrcweir } 515*cdf0e10cSrcweir 516*cdf0e10cSrcweir public char getChar() throws com.sun.star.uno.RuntimeException { 517*cdf0e10cSrcweir return _char; 518*cdf0e10cSrcweir } 519*cdf0e10cSrcweir 520*cdf0e10cSrcweir public void setChar(char zchar) throws com.sun.star.uno.RuntimeException { 521*cdf0e10cSrcweir _char = zchar; 522*cdf0e10cSrcweir } 523*cdf0e10cSrcweir 524*cdf0e10cSrcweir public short getShort() throws com.sun.star.uno.RuntimeException { 525*cdf0e10cSrcweir return _short; 526*cdf0e10cSrcweir } 527*cdf0e10cSrcweir 528*cdf0e10cSrcweir public void setShort(short zshort) throws com.sun.star.uno.RuntimeException { 529*cdf0e10cSrcweir _short = zshort; 530*cdf0e10cSrcweir } 531*cdf0e10cSrcweir 532*cdf0e10cSrcweir public short getUShort() throws com.sun.star.uno.RuntimeException { 533*cdf0e10cSrcweir return _ushort; 534*cdf0e10cSrcweir } 535*cdf0e10cSrcweir 536*cdf0e10cSrcweir public void setUShort(short ushort) throws com.sun.star.uno.RuntimeException { 537*cdf0e10cSrcweir _ushort = ushort; 538*cdf0e10cSrcweir } 539*cdf0e10cSrcweir 540*cdf0e10cSrcweir public int getLong() throws com.sun.star.uno.RuntimeException { 541*cdf0e10cSrcweir return _long; 542*cdf0e10cSrcweir } 543*cdf0e10cSrcweir 544*cdf0e10cSrcweir public void setLong(int zint) throws com.sun.star.uno.RuntimeException { 545*cdf0e10cSrcweir _long = zint; 546*cdf0e10cSrcweir } 547*cdf0e10cSrcweir 548*cdf0e10cSrcweir public int getULong() throws com.sun.star.uno.RuntimeException { 549*cdf0e10cSrcweir return _ulong; 550*cdf0e10cSrcweir } 551*cdf0e10cSrcweir 552*cdf0e10cSrcweir public void setULong(int uint) throws com.sun.star.uno.RuntimeException { 553*cdf0e10cSrcweir _ulong = uint; 554*cdf0e10cSrcweir } 555*cdf0e10cSrcweir 556*cdf0e10cSrcweir public long getHyper() throws com.sun.star.uno.RuntimeException { 557*cdf0e10cSrcweir return _hyper; 558*cdf0e10cSrcweir } 559*cdf0e10cSrcweir 560*cdf0e10cSrcweir public void setHyper(long hyper) throws com.sun.star.uno.RuntimeException { 561*cdf0e10cSrcweir _hyper = hyper; 562*cdf0e10cSrcweir } 563*cdf0e10cSrcweir 564*cdf0e10cSrcweir public long getUHyper() throws com.sun.star.uno.RuntimeException { 565*cdf0e10cSrcweir return _uhyper; 566*cdf0e10cSrcweir } 567*cdf0e10cSrcweir 568*cdf0e10cSrcweir public void setUHyper(long uhyper) throws com.sun.star.uno.RuntimeException { 569*cdf0e10cSrcweir _uhyper = uhyper; 570*cdf0e10cSrcweir } 571*cdf0e10cSrcweir 572*cdf0e10cSrcweir public float getFloat() throws com.sun.star.uno.RuntimeException { 573*cdf0e10cSrcweir return _float; 574*cdf0e10cSrcweir } 575*cdf0e10cSrcweir 576*cdf0e10cSrcweir public void setFloat(float zfloat) throws com.sun.star.uno.RuntimeException { 577*cdf0e10cSrcweir _float = zfloat; 578*cdf0e10cSrcweir } 579*cdf0e10cSrcweir 580*cdf0e10cSrcweir public double getDouble() throws com.sun.star.uno.RuntimeException { 581*cdf0e10cSrcweir return _double; 582*cdf0e10cSrcweir } 583*cdf0e10cSrcweir 584*cdf0e10cSrcweir public void setDouble(double zdouble) throws com.sun.star.uno.RuntimeException { 585*cdf0e10cSrcweir _double = zdouble; 586*cdf0e10cSrcweir } 587*cdf0e10cSrcweir 588*cdf0e10cSrcweir public TestEnum getEnum() throws com.sun.star.uno.RuntimeException { 589*cdf0e10cSrcweir return _testEnum; 590*cdf0e10cSrcweir } 591*cdf0e10cSrcweir 592*cdf0e10cSrcweir public void setEnum(TestEnum testEnum) throws com.sun.star.uno.RuntimeException { 593*cdf0e10cSrcweir _testEnum = testEnum; 594*cdf0e10cSrcweir } 595*cdf0e10cSrcweir 596*cdf0e10cSrcweir public String getString() throws com.sun.star.uno.RuntimeException { 597*cdf0e10cSrcweir return _string; 598*cdf0e10cSrcweir } 599*cdf0e10cSrcweir 600*cdf0e10cSrcweir public void setString(String string) throws com.sun.star.uno.RuntimeException { 601*cdf0e10cSrcweir _string = string; 602*cdf0e10cSrcweir } 603*cdf0e10cSrcweir 604*cdf0e10cSrcweir public Object getInterface() throws com.sun.star.uno.RuntimeException { 605*cdf0e10cSrcweir return _xInterface; 606*cdf0e10cSrcweir } 607*cdf0e10cSrcweir 608*cdf0e10cSrcweir public void setInterface(Object zinterface) throws com.sun.star.uno.RuntimeException { 609*cdf0e10cSrcweir _xInterface = zinterface; 610*cdf0e10cSrcweir } 611*cdf0e10cSrcweir 612*cdf0e10cSrcweir public Object getAny() throws com.sun.star.uno.RuntimeException { 613*cdf0e10cSrcweir if(DEBUG) System.err.println("##### " + getClass().getName() + ".setAny:" + _any); 614*cdf0e10cSrcweir 615*cdf0e10cSrcweir return _any; 616*cdf0e10cSrcweir } 617*cdf0e10cSrcweir 618*cdf0e10cSrcweir public void setAny(Object any) throws com.sun.star.uno.RuntimeException { 619*cdf0e10cSrcweir if(DEBUG) System.err.println("##### " + getClass().getName() + ".setAny:" + any); 620*cdf0e10cSrcweir 621*cdf0e10cSrcweir _any = any; 622*cdf0e10cSrcweir } 623*cdf0e10cSrcweir 624*cdf0e10cSrcweir public TestElement[] getSequence() throws com.sun.star.uno.RuntimeException { 625*cdf0e10cSrcweir return _testElements; 626*cdf0e10cSrcweir } 627*cdf0e10cSrcweir 628*cdf0e10cSrcweir public void setSequence(TestElement testElements[]) throws com.sun.star.uno.RuntimeException { 629*cdf0e10cSrcweir _testElements = testElements; 630*cdf0e10cSrcweir } 631*cdf0e10cSrcweir 632*cdf0e10cSrcweir public TestDataElements getStruct() throws com.sun.star.uno.RuntimeException { 633*cdf0e10cSrcweir return _testDataElements; 634*cdf0e10cSrcweir } 635*cdf0e10cSrcweir 636*cdf0e10cSrcweir public void setStruct(TestDataElements testDataElements) throws com.sun.star.uno.RuntimeException { 637*cdf0e10cSrcweir _testDataElements = testDataElements; 638*cdf0e10cSrcweir } 639*cdf0e10cSrcweir 640*cdf0e10cSrcweir public int getRaiseAttr1() { 641*cdf0e10cSrcweir throw new com.sun.star.uno.RuntimeException(); 642*cdf0e10cSrcweir } 643*cdf0e10cSrcweir 644*cdf0e10cSrcweir public void setRaiseAttr1(int n) throws IllegalArgumentException { 645*cdf0e10cSrcweir throw new IllegalArgumentException(); 646*cdf0e10cSrcweir } 647*cdf0e10cSrcweir 648*cdf0e10cSrcweir public int getRaiseAttr2() throws IllegalArgumentException { 649*cdf0e10cSrcweir throw new IllegalArgumentException(); 650*cdf0e10cSrcweir } 651*cdf0e10cSrcweir 652*cdf0e10cSrcweir public TestPolyStruct transportPolyBoolean(TestPolyStruct arg) { 653*cdf0e10cSrcweir Boolean dummy = (Boolean) arg.member; 654*cdf0e10cSrcweir return arg; 655*cdf0e10cSrcweir } 656*cdf0e10cSrcweir 657*cdf0e10cSrcweir public void transportPolyHyper(TestPolyStruct[] arg) { 658*cdf0e10cSrcweir Long dummy = (Long) arg[0].member; 659*cdf0e10cSrcweir } 660*cdf0e10cSrcweir 661*cdf0e10cSrcweir public void transportPolySequence( 662*cdf0e10cSrcweir TestPolyStruct arg1, TestPolyStruct[] arg2) 663*cdf0e10cSrcweir { 664*cdf0e10cSrcweir Object[] dummy = (Object[]) arg1.member; 665*cdf0e10cSrcweir arg2[0] = arg1; 666*cdf0e10cSrcweir } 667*cdf0e10cSrcweir 668*cdf0e10cSrcweir public TestPolyStruct getNullPolyLong() { 669*cdf0e10cSrcweir return new TestPolyStruct(); 670*cdf0e10cSrcweir } 671*cdf0e10cSrcweir 672*cdf0e10cSrcweir public TestPolyStruct getNullPolyString() { 673*cdf0e10cSrcweir return new TestPolyStruct(); 674*cdf0e10cSrcweir } 675*cdf0e10cSrcweir 676*cdf0e10cSrcweir public TestPolyStruct getNullPolyType() { 677*cdf0e10cSrcweir return new TestPolyStruct(); 678*cdf0e10cSrcweir } 679*cdf0e10cSrcweir 680*cdf0e10cSrcweir public TestPolyStruct getNullPolyAny() { 681*cdf0e10cSrcweir return new TestPolyStruct(); 682*cdf0e10cSrcweir } 683*cdf0e10cSrcweir 684*cdf0e10cSrcweir public TestPolyStruct getNullPolySequence() { 685*cdf0e10cSrcweir return new TestPolyStruct(); 686*cdf0e10cSrcweir } 687*cdf0e10cSrcweir 688*cdf0e10cSrcweir public TestPolyStruct getNullPolyEnum() { 689*cdf0e10cSrcweir return new TestPolyStruct(); 690*cdf0e10cSrcweir } 691*cdf0e10cSrcweir 692*cdf0e10cSrcweir public TestPolyStruct getNullPolyBadEnum() { 693*cdf0e10cSrcweir return new TestPolyStruct(); 694*cdf0e10cSrcweir } 695*cdf0e10cSrcweir 696*cdf0e10cSrcweir public TestPolyStruct getNullPolyStruct() { 697*cdf0e10cSrcweir return new TestPolyStruct(); 698*cdf0e10cSrcweir } 699*cdf0e10cSrcweir 700*cdf0e10cSrcweir public TestPolyStruct getNullPolyInterface() { 701*cdf0e10cSrcweir return new TestPolyStruct(); 702*cdf0e10cSrcweir } 703*cdf0e10cSrcweir 704*cdf0e10cSrcweir public Object transportAny(Object value) throws com.sun.star.uno.RuntimeException { 705*cdf0e10cSrcweir return value; 706*cdf0e10cSrcweir } 707*cdf0e10cSrcweir 708*cdf0e10cSrcweir public void call(int nCallId , int nWaitMUSEC) throws com.sun.star.uno.RuntimeException { 709*cdf0e10cSrcweir // TimeValue value = { nWaitMUSEC / 1000000 , nWaitMUSEC * 1000 }; 710*cdf0e10cSrcweir // osl_waitThread( &value ); 711*cdf0e10cSrcweir try { 712*cdf0e10cSrcweir Thread.sleep(nWaitMUSEC / 10000); 713*cdf0e10cSrcweir } 714*cdf0e10cSrcweir catch(InterruptedException interruptedException) { 715*cdf0e10cSrcweir throw new com.sun.star.uno.RuntimeException(interruptedException.getMessage()); 716*cdf0e10cSrcweir } 717*cdf0e10cSrcweir 718*cdf0e10cSrcweir if(_bFirstCall) 719*cdf0e10cSrcweir _bFirstCall = false; 720*cdf0e10cSrcweir 721*cdf0e10cSrcweir else 722*cdf0e10cSrcweir _bSequenceOfCallTestPassed = _bSequenceOfCallTestPassed && (nCallId > _nLastCallId); 723*cdf0e10cSrcweir 724*cdf0e10cSrcweir _nLastCallId = nCallId; 725*cdf0e10cSrcweir } 726*cdf0e10cSrcweir 727*cdf0e10cSrcweir public void callOneway( int nCallId , int nWaitMUSEC ) throws com.sun.star.uno.RuntimeException { 728*cdf0e10cSrcweir // TimeValue value = { nWaitMUSEC / 1000000 , nWaitMUSEC * 1000 }; 729*cdf0e10cSrcweir // osl_waitThread( &value ); 730*cdf0e10cSrcweir try { 731*cdf0e10cSrcweir Thread.sleep(nWaitMUSEC / 10000); 732*cdf0e10cSrcweir } 733*cdf0e10cSrcweir catch(InterruptedException interruptedException) { 734*cdf0e10cSrcweir throw new com.sun.star.uno.RuntimeException(interruptedException.getMessage()); 735*cdf0e10cSrcweir } 736*cdf0e10cSrcweir 737*cdf0e10cSrcweir _bSequenceOfCallTestPassed = _bSequenceOfCallTestPassed && (nCallId > _nLastCallId); 738*cdf0e10cSrcweir _nLastCallId = nCallId; 739*cdf0e10cSrcweir } 740*cdf0e10cSrcweir 741*cdf0e10cSrcweir public boolean sequenceOfCallTestPassed() throws com.sun.star.uno.RuntimeException { 742*cdf0e10cSrcweir return _bSequenceOfCallTestPassed; 743*cdf0e10cSrcweir } 744*cdf0e10cSrcweir 745*cdf0e10cSrcweir public synchronized void callRecursivly(XRecursiveCall xCall, int nToCall) throws com.sun.star.uno.RuntimeException { 746*cdf0e10cSrcweir if(nToCall != 0) 747*cdf0e10cSrcweir { 748*cdf0e10cSrcweir nToCall --; 749*cdf0e10cSrcweir xCall.callRecursivly(this , nToCall); 750*cdf0e10cSrcweir } 751*cdf0e10cSrcweir } 752*cdf0e10cSrcweir 753*cdf0e10cSrcweir public synchronized void startRecursiveCall(XRecursiveCall xCall, int nToCall) throws com.sun.star.uno.RuntimeException { 754*cdf0e10cSrcweir if(nToCall != 0) 755*cdf0e10cSrcweir { 756*cdf0e10cSrcweir nToCall --; 757*cdf0e10cSrcweir xCall.callRecursivly( this , nToCall ); 758*cdf0e10cSrcweir } 759*cdf0e10cSrcweir } 760*cdf0e10cSrcweir 761*cdf0e10cSrcweir public XMulti getMulti() { 762*cdf0e10cSrcweir return new XMulti() { 763*cdf0e10cSrcweir public double getatt1() { 764*cdf0e10cSrcweir return attribute1; 765*cdf0e10cSrcweir } 766*cdf0e10cSrcweir 767*cdf0e10cSrcweir public void setatt1(double value) { 768*cdf0e10cSrcweir attribute1 = value; 769*cdf0e10cSrcweir } 770*cdf0e10cSrcweir 771*cdf0e10cSrcweir public int fn11(int arg) { 772*cdf0e10cSrcweir return 11 * arg; 773*cdf0e10cSrcweir } 774*cdf0e10cSrcweir 775*cdf0e10cSrcweir public String fn12(String arg) { 776*cdf0e10cSrcweir return "12" + arg; 777*cdf0e10cSrcweir } 778*cdf0e10cSrcweir 779*cdf0e10cSrcweir public int fn21(int arg) { 780*cdf0e10cSrcweir return 21 * arg; 781*cdf0e10cSrcweir } 782*cdf0e10cSrcweir 783*cdf0e10cSrcweir public String fn22(String arg) { 784*cdf0e10cSrcweir return "22" + arg; 785*cdf0e10cSrcweir } 786*cdf0e10cSrcweir 787*cdf0e10cSrcweir public double getatt3() { 788*cdf0e10cSrcweir return attribute3; 789*cdf0e10cSrcweir } 790*cdf0e10cSrcweir 791*cdf0e10cSrcweir public void setatt3(double value) { 792*cdf0e10cSrcweir attribute3 = value; 793*cdf0e10cSrcweir } 794*cdf0e10cSrcweir 795*cdf0e10cSrcweir public int fn31(int arg) { 796*cdf0e10cSrcweir return 31 * arg; 797*cdf0e10cSrcweir } 798*cdf0e10cSrcweir 799*cdf0e10cSrcweir public String fn32(String arg) { 800*cdf0e10cSrcweir return "32" + arg; 801*cdf0e10cSrcweir } 802*cdf0e10cSrcweir 803*cdf0e10cSrcweir public int fn33() { 804*cdf0e10cSrcweir return 33; 805*cdf0e10cSrcweir } 806*cdf0e10cSrcweir 807*cdf0e10cSrcweir public int fn41(int arg) { 808*cdf0e10cSrcweir return 41 * arg; 809*cdf0e10cSrcweir } 810*cdf0e10cSrcweir 811*cdf0e10cSrcweir public int fn61(int arg) { 812*cdf0e10cSrcweir return 61 * arg; 813*cdf0e10cSrcweir } 814*cdf0e10cSrcweir 815*cdf0e10cSrcweir public String fn62(String arg) { 816*cdf0e10cSrcweir return "62" + arg; 817*cdf0e10cSrcweir } 818*cdf0e10cSrcweir 819*cdf0e10cSrcweir public int fn71(int arg) { 820*cdf0e10cSrcweir return 71 * arg; 821*cdf0e10cSrcweir } 822*cdf0e10cSrcweir 823*cdf0e10cSrcweir public String fn72(String arg) { 824*cdf0e10cSrcweir return "72" + arg; 825*cdf0e10cSrcweir } 826*cdf0e10cSrcweir 827*cdf0e10cSrcweir public int fn73() { 828*cdf0e10cSrcweir return 73; 829*cdf0e10cSrcweir } 830*cdf0e10cSrcweir 831*cdf0e10cSrcweir private double attribute1 = 0.0; 832*cdf0e10cSrcweir private double attribute3 = 0.0; 833*cdf0e10cSrcweir }; 834*cdf0e10cSrcweir } 835*cdf0e10cSrcweir 836*cdf0e10cSrcweir private static final class CheckFailed extends Exception { 837*cdf0e10cSrcweir CheckFailed(String message) { 838*cdf0e10cSrcweir super(message); 839*cdf0e10cSrcweir } 840*cdf0e10cSrcweir } 841*cdf0e10cSrcweir 842*cdf0e10cSrcweir private static void checkEqual(int value, int argument) 843*cdf0e10cSrcweir throws CheckFailed 844*cdf0e10cSrcweir { 845*cdf0e10cSrcweir if (argument != value) { 846*cdf0e10cSrcweir throw new CheckFailed(value + " != " + argument); 847*cdf0e10cSrcweir } 848*cdf0e10cSrcweir } 849*cdf0e10cSrcweir 850*cdf0e10cSrcweir private static void checkEqual(double value, double argument) 851*cdf0e10cSrcweir throws CheckFailed 852*cdf0e10cSrcweir { 853*cdf0e10cSrcweir if (argument != value) { 854*cdf0e10cSrcweir throw new CheckFailed(value + " != " + argument); 855*cdf0e10cSrcweir } 856*cdf0e10cSrcweir } 857*cdf0e10cSrcweir 858*cdf0e10cSrcweir private static void checkEqual(String value, String argument) 859*cdf0e10cSrcweir throws CheckFailed 860*cdf0e10cSrcweir { 861*cdf0e10cSrcweir if (!argument.equals(value)) { 862*cdf0e10cSrcweir throw new CheckFailed(value + " != " + argument); 863*cdf0e10cSrcweir } 864*cdf0e10cSrcweir } 865*cdf0e10cSrcweir 866*cdf0e10cSrcweir public String testMulti(XMulti multi) { 867*cdf0e10cSrcweir try { 868*cdf0e10cSrcweir checkEqual(0.0, multi.getatt1()); 869*cdf0e10cSrcweir multi.setatt1(0.1); 870*cdf0e10cSrcweir checkEqual(0.1, multi.getatt1()); 871*cdf0e10cSrcweir checkEqual(11 * 1, multi.fn11(1)); 872*cdf0e10cSrcweir checkEqual("12" + "abc", multi.fn12("abc")); 873*cdf0e10cSrcweir checkEqual(21 * 2, multi.fn21(2)); 874*cdf0e10cSrcweir checkEqual("22" + "de", multi.fn22("de")); 875*cdf0e10cSrcweir checkEqual(0.0, multi.getatt3()); 876*cdf0e10cSrcweir multi.setatt3(0.3); 877*cdf0e10cSrcweir checkEqual(0.3, multi.getatt3()); 878*cdf0e10cSrcweir checkEqual(31 * 3, multi.fn31(3)); 879*cdf0e10cSrcweir checkEqual("32" + "f", multi.fn32("f")); 880*cdf0e10cSrcweir checkEqual(33, multi.fn33()); 881*cdf0e10cSrcweir checkEqual(41 * 4, multi.fn41(4)); 882*cdf0e10cSrcweir checkEqual(61 * 6, multi.fn61(6)); 883*cdf0e10cSrcweir checkEqual("62" + "", multi.fn62("")); 884*cdf0e10cSrcweir checkEqual(71 * 7, multi.fn71(7)); 885*cdf0e10cSrcweir checkEqual("72" + "g", multi.fn72("g")); 886*cdf0e10cSrcweir checkEqual(73, multi.fn73()); 887*cdf0e10cSrcweir } catch (CheckFailed f) { 888*cdf0e10cSrcweir return f.getMessage(); 889*cdf0e10cSrcweir } 890*cdf0e10cSrcweir return ""; 891*cdf0e10cSrcweir } 892*cdf0e10cSrcweir 893*cdf0e10cSrcweir // XBridgeTest 894*cdf0e10cSrcweir public TestDataElements raiseException(short nArgumentPos, String rMsg, Object xContext) 895*cdf0e10cSrcweir throws com.sun.star.lang.IllegalArgumentException, 896*cdf0e10cSrcweir com.sun.star.uno.RuntimeException 897*cdf0e10cSrcweir { 898*cdf0e10cSrcweir throw new com.sun.star.lang.IllegalArgumentException(rMsg, xContext, nArgumentPos); 899*cdf0e10cSrcweir } 900*cdf0e10cSrcweir 901*cdf0e10cSrcweir public void raiseRuntimeExceptionOneway(String rMsg, Object xContext) throws com.sun.star.uno.RuntimeException { 902*cdf0e10cSrcweir throw new com.sun.star.uno.RuntimeException(rMsg, xContext); 903*cdf0e10cSrcweir } 904*cdf0e10cSrcweir 905*cdf0e10cSrcweir private void dothrow( com.sun.star.uno.RuntimeException t ) 906*cdf0e10cSrcweir throws com.sun.star.uno.RuntimeException 907*cdf0e10cSrcweir { 908*cdf0e10cSrcweir throw t; 909*cdf0e10cSrcweir } 910*cdf0e10cSrcweir public int getRuntimeException() 911*cdf0e10cSrcweir throws com.sun.star.uno.RuntimeException 912*cdf0e10cSrcweir { 913*cdf0e10cSrcweir try 914*cdf0e10cSrcweir { 915*cdf0e10cSrcweir dothrow( new com.sun.star.uno.RuntimeException( 916*cdf0e10cSrcweir _string, _xInterface ) ); 917*cdf0e10cSrcweir return 0; // dummy 918*cdf0e10cSrcweir } 919*cdf0e10cSrcweir catch (com.sun.star.uno.RuntimeException t) 920*cdf0e10cSrcweir { 921*cdf0e10cSrcweir throw t; 922*cdf0e10cSrcweir } 923*cdf0e10cSrcweir } 924*cdf0e10cSrcweir 925*cdf0e10cSrcweir public void setRuntimeException(int _runtimeexception) throws com.sun.star.uno.RuntimeException { 926*cdf0e10cSrcweir throw new com.sun.star.uno.RuntimeException(_string, _xInterface); 927*cdf0e10cSrcweir } 928*cdf0e10cSrcweir 929*cdf0e10cSrcweir 930*cdf0e10cSrcweir 931*cdf0e10cSrcweir // XServiceInfo 932*cdf0e10cSrcweir public String getImplementationName() throws com.sun.star.uno.RuntimeException { 933*cdf0e10cSrcweir return __serviceName; 934*cdf0e10cSrcweir } 935*cdf0e10cSrcweir 936*cdf0e10cSrcweir public boolean supportsService(String rServiceName) throws com.sun.star.uno.RuntimeException { 937*cdf0e10cSrcweir String rSNL[] = getSupportedServiceNames(); 938*cdf0e10cSrcweir 939*cdf0e10cSrcweir for(int nPos = rSNL.length; (nPos--) != 0;) { 940*cdf0e10cSrcweir if (rSNL[nPos].equals(rServiceName)) 941*cdf0e10cSrcweir return true; 942*cdf0e10cSrcweir } 943*cdf0e10cSrcweir 944*cdf0e10cSrcweir return false; 945*cdf0e10cSrcweir } 946*cdf0e10cSrcweir 947*cdf0e10cSrcweir public String [] getSupportedServiceNames() throws com.sun.star.uno.RuntimeException { 948*cdf0e10cSrcweir return new String[]{__serviceName}; 949*cdf0e10cSrcweir } 950*cdf0e10cSrcweir 951*cdf0e10cSrcweir // XTypeProvider 952*cdf0e10cSrcweir public Type[] getTypes() throws com.sun.star.uno.RuntimeException { 953*cdf0e10cSrcweir try { 954*cdf0e10cSrcweir return new Type[]{new Type(XBridgeTest.class), new Type(XRecursiveCall.class), new Type(XServiceInfo.class), new Type(XTypeProvider.class)}; 955*cdf0e10cSrcweir } 956*cdf0e10cSrcweir catch(Exception exception) { 957*cdf0e10cSrcweir throw new com.sun.star.uno.RuntimeException(exception.getMessage()); 958*cdf0e10cSrcweir } 959*cdf0e10cSrcweir } 960*cdf0e10cSrcweir 961*cdf0e10cSrcweir public byte[] getImplementationId() throws com.sun.star.uno.RuntimeException { 962*cdf0e10cSrcweir return toString().getBytes(); 963*cdf0e10cSrcweir } 964*cdf0e10cSrcweir 965*cdf0e10cSrcweir //XBridgeTest2 966*cdf0e10cSrcweir public boolean[] setSequenceBool( /*IN*/boolean[] aSeq ) 967*cdf0e10cSrcweir { 968*cdf0e10cSrcweir arBool = aSeq; 969*cdf0e10cSrcweir return aSeq; 970*cdf0e10cSrcweir } 971*cdf0e10cSrcweir public char[] setSequenceChar( /*IN*/char[] aSeq ) 972*cdf0e10cSrcweir { 973*cdf0e10cSrcweir arChar = aSeq; 974*cdf0e10cSrcweir return aSeq; 975*cdf0e10cSrcweir } 976*cdf0e10cSrcweir public byte[] setSequenceByte( /*IN*/byte[] aSeq ) 977*cdf0e10cSrcweir { 978*cdf0e10cSrcweir arByte = aSeq; 979*cdf0e10cSrcweir return aSeq; 980*cdf0e10cSrcweir } 981*cdf0e10cSrcweir public short[] setSequenceShort( /*IN*/short[] aSeq ) 982*cdf0e10cSrcweir { 983*cdf0e10cSrcweir arShort = aSeq; 984*cdf0e10cSrcweir return aSeq; 985*cdf0e10cSrcweir } 986*cdf0e10cSrcweir public short[] setSequenceUShort( /*IN*/short[] aSeq ) 987*cdf0e10cSrcweir { 988*cdf0e10cSrcweir arUShort = aSeq; 989*cdf0e10cSrcweir return aSeq; 990*cdf0e10cSrcweir } 991*cdf0e10cSrcweir public int[] setSequenceLong( /*IN*/int[] aSeq ) 992*cdf0e10cSrcweir { 993*cdf0e10cSrcweir arLong = aSeq; 994*cdf0e10cSrcweir return aSeq; 995*cdf0e10cSrcweir } 996*cdf0e10cSrcweir public int[] setSequenceULong( /*IN*/int[] aSeq ) 997*cdf0e10cSrcweir { 998*cdf0e10cSrcweir arULong = aSeq; 999*cdf0e10cSrcweir return aSeq; 1000*cdf0e10cSrcweir } 1001*cdf0e10cSrcweir public long[] setSequenceHyper( /*IN*/long[] aSeq ) 1002*cdf0e10cSrcweir { 1003*cdf0e10cSrcweir arHyper = aSeq; 1004*cdf0e10cSrcweir return aSeq; 1005*cdf0e10cSrcweir } 1006*cdf0e10cSrcweir public long[] setSequenceUHyper( /*IN*/long[] aSeq ) 1007*cdf0e10cSrcweir { 1008*cdf0e10cSrcweir arUHyper = aSeq; 1009*cdf0e10cSrcweir return aSeq; 1010*cdf0e10cSrcweir } 1011*cdf0e10cSrcweir public float[] setSequenceFloat( /*IN*/float[] aSeq ) 1012*cdf0e10cSrcweir { 1013*cdf0e10cSrcweir arFloat = aSeq; 1014*cdf0e10cSrcweir return aSeq; 1015*cdf0e10cSrcweir } 1016*cdf0e10cSrcweir public double[] setSequenceDouble( /*IN*/double[] aSeq ) 1017*cdf0e10cSrcweir { 1018*cdf0e10cSrcweir arDouble = aSeq; 1019*cdf0e10cSrcweir return aSeq; 1020*cdf0e10cSrcweir } 1021*cdf0e10cSrcweir public TestEnum[] setSequenceEnum( /*IN*/TestEnum[] aSeq ) 1022*cdf0e10cSrcweir { 1023*cdf0e10cSrcweir arEnum = aSeq; 1024*cdf0e10cSrcweir return aSeq; 1025*cdf0e10cSrcweir } 1026*cdf0e10cSrcweir public String[] setSequenceString( /*IN*/String[] aSeq ) 1027*cdf0e10cSrcweir { 1028*cdf0e10cSrcweir arString = aSeq; 1029*cdf0e10cSrcweir return aSeq; 1030*cdf0e10cSrcweir } 1031*cdf0e10cSrcweir public java.lang.Object[] setSequenceXInterface( /*IN*/java.lang.Object[] aSeq ) 1032*cdf0e10cSrcweir { 1033*cdf0e10cSrcweir arObject = aSeq; 1034*cdf0e10cSrcweir return aSeq; 1035*cdf0e10cSrcweir } 1036*cdf0e10cSrcweir public java.lang.Object[] setSequenceAny( /*IN*/java.lang.Object[] aSeq ) 1037*cdf0e10cSrcweir { 1038*cdf0e10cSrcweir arAny = aSeq; 1039*cdf0e10cSrcweir return aSeq; 1040*cdf0e10cSrcweir } 1041*cdf0e10cSrcweir public TestElement[] setSequenceStruct( /*IN*/TestElement[] aSeq ) 1042*cdf0e10cSrcweir { 1043*cdf0e10cSrcweir _testElements = aSeq; 1044*cdf0e10cSrcweir return aSeq; 1045*cdf0e10cSrcweir } 1046*cdf0e10cSrcweir public int[][] setDim2( /*IN*/int[][] aSeq ) 1047*cdf0e10cSrcweir { 1048*cdf0e10cSrcweir arLong2 = aSeq; 1049*cdf0e10cSrcweir return aSeq; 1050*cdf0e10cSrcweir } 1051*cdf0e10cSrcweir public int[][][] setDim3( /*IN*/int[][][] aSeq ) 1052*cdf0e10cSrcweir { 1053*cdf0e10cSrcweir arLong3 = aSeq; 1054*cdf0e10cSrcweir return aSeq; 1055*cdf0e10cSrcweir } 1056*cdf0e10cSrcweir public void setSequencesInOut( /*INOUT*/boolean[][] aSeqBoolean, 1057*cdf0e10cSrcweir /*INOUT*/char[][] aSeqChar, /*INOUT*/byte[][] aSeqByte, 1058*cdf0e10cSrcweir /*INOUT*/short[][] aSeqShort, /*INOUT*/short[][] aSeqUShort, 1059*cdf0e10cSrcweir /*INOUT*/int[][] aSeqLong, /*INOUT*/int[][] aSeqULong, 1060*cdf0e10cSrcweir /*INOUT*/long[][] aSeqHyper, /*INOUT*/long[][] aSeqUHyper, 1061*cdf0e10cSrcweir /*INOUT*/float[][] aSeqFloat, /*INOUT*/double[][] aSeqDouble, 1062*cdf0e10cSrcweir /*INOUT*/TestEnum[][] aSeqEnum, /*INOUT*/String[][] aSeqString, 1063*cdf0e10cSrcweir /*INOUT*/java.lang.Object[][] aSeqXInterface, 1064*cdf0e10cSrcweir /*INOUT*/java.lang.Object[][] aSeqAny, 1065*cdf0e10cSrcweir /*INOUT*/int[][][] aSeqDim2, /*INOUT*/int[][][][] aSeqDim3 ) 1066*cdf0e10cSrcweir { 1067*cdf0e10cSrcweir arBool = aSeqBoolean[0]; 1068*cdf0e10cSrcweir arChar = aSeqChar[0]; 1069*cdf0e10cSrcweir arByte = aSeqByte[0]; 1070*cdf0e10cSrcweir arShort = aSeqShort[0]; 1071*cdf0e10cSrcweir arUShort = aSeqUShort[0]; 1072*cdf0e10cSrcweir arLong = aSeqLong[0]; 1073*cdf0e10cSrcweir arULong = aSeqULong[0]; 1074*cdf0e10cSrcweir arFloat = aSeqFloat[0]; 1075*cdf0e10cSrcweir arDouble = aSeqDouble[0]; 1076*cdf0e10cSrcweir arEnum = aSeqEnum[0]; 1077*cdf0e10cSrcweir arString = aSeqString[0]; 1078*cdf0e10cSrcweir arObject = aSeqXInterface[0]; 1079*cdf0e10cSrcweir arAny = aSeqAny[0]; 1080*cdf0e10cSrcweir arLong2 = aSeqDim2[0]; 1081*cdf0e10cSrcweir arLong3 = aSeqDim3[0]; 1082*cdf0e10cSrcweir } 1083*cdf0e10cSrcweir public void setSequencesOut( /*OUT*/boolean[][] aSeqBoolean, /*OUT*/char[][] aSeqChar, 1084*cdf0e10cSrcweir /*OUT*/byte[][] aSeqByte, /*OUT*/short[][] aSeqShort, 1085*cdf0e10cSrcweir /*OUT*/short[][] aSeqUShort, /*OUT*/int[][] aSeqLong, 1086*cdf0e10cSrcweir /*OUT*/int[][] aSeqULong, /*OUT*/long[][] aSeqHyper, 1087*cdf0e10cSrcweir /*OUT*/long[][] aSeqUHyper, /*OUT*/float[][] aSeqFloat, 1088*cdf0e10cSrcweir /*OUT*/double[][] aSeqDouble, /*OUT*/TestEnum[][] aSeqEnum, 1089*cdf0e10cSrcweir /*OUT*/String[][] aSeqString, 1090*cdf0e10cSrcweir /*OUT*/java.lang.Object[][] aSeqXInterface, 1091*cdf0e10cSrcweir /*OUT*/java.lang.Object[][] aSeqAny, /*OUT*/int[][][] aSeqDim2, 1092*cdf0e10cSrcweir /*OUT*/int[][][][] aSeqDim3 ) 1093*cdf0e10cSrcweir { 1094*cdf0e10cSrcweir aSeqBoolean[0] = arBool; 1095*cdf0e10cSrcweir aSeqChar[0] = arChar; 1096*cdf0e10cSrcweir aSeqByte[0] = arByte; 1097*cdf0e10cSrcweir aSeqShort[0] = arShort; 1098*cdf0e10cSrcweir aSeqUShort[0] = arUShort; 1099*cdf0e10cSrcweir aSeqLong[0] = arLong; 1100*cdf0e10cSrcweir aSeqULong[0] = arULong; 1101*cdf0e10cSrcweir aSeqHyper[0] = arHyper; 1102*cdf0e10cSrcweir aSeqUHyper[0] = arUHyper; 1103*cdf0e10cSrcweir aSeqFloat[0] = arFloat; 1104*cdf0e10cSrcweir aSeqDouble[0] = arDouble; 1105*cdf0e10cSrcweir aSeqEnum[0] = arEnum; 1106*cdf0e10cSrcweir aSeqString[0] = arString; 1107*cdf0e10cSrcweir aSeqXInterface[0] = arObject; 1108*cdf0e10cSrcweir aSeqAny[0] = arAny; 1109*cdf0e10cSrcweir aSeqDim2[0] = arLong2; 1110*cdf0e10cSrcweir aSeqDim3[0] = arLong3; 1111*cdf0e10cSrcweir } 1112*cdf0e10cSrcweir 1113*cdf0e10cSrcweir public void testConstructorsService(XComponentContext context) 1114*cdf0e10cSrcweir throws BadConstructorArguments 1115*cdf0e10cSrcweir { 1116*cdf0e10cSrcweir Constructors.create1(context, 1117*cdf0e10cSrcweir true, 1118*cdf0e10cSrcweir Byte.MIN_VALUE, 1119*cdf0e10cSrcweir Short.MIN_VALUE, 1120*cdf0e10cSrcweir (short) -1, 1121*cdf0e10cSrcweir Integer.MIN_VALUE, 1122*cdf0e10cSrcweir -1, 1123*cdf0e10cSrcweir Long.MIN_VALUE, 1124*cdf0e10cSrcweir -1L, 1125*cdf0e10cSrcweir 0.123f, 1126*cdf0e10cSrcweir 0.456, 1127*cdf0e10cSrcweir 'X', 1128*cdf0e10cSrcweir "test", 1129*cdf0e10cSrcweir Type.ANY, 1130*cdf0e10cSrcweir new Any(Type.BOOLEAN, Boolean.TRUE), 1131*cdf0e10cSrcweir new boolean[] { true }, 1132*cdf0e10cSrcweir new byte[] { Byte.MIN_VALUE }, 1133*cdf0e10cSrcweir new short[] { Short.MIN_VALUE }, 1134*cdf0e10cSrcweir new short[] { (short) -1 }, 1135*cdf0e10cSrcweir new int[] { Integer.MIN_VALUE }, 1136*cdf0e10cSrcweir new int[] { -1 }, 1137*cdf0e10cSrcweir new long[] { Long.MIN_VALUE }, 1138*cdf0e10cSrcweir new long[] { -1L }, 1139*cdf0e10cSrcweir new float[] { 0.123f }, 1140*cdf0e10cSrcweir new double[] { 0.456 }, 1141*cdf0e10cSrcweir new char[] { 'X' }, 1142*cdf0e10cSrcweir new String[] { "test" }, 1143*cdf0e10cSrcweir new Type[] { Type.ANY }, 1144*cdf0e10cSrcweir new Boolean[] { Boolean.TRUE }, 1145*cdf0e10cSrcweir new boolean[][] { new boolean[] { true } }, 1146*cdf0e10cSrcweir new Object[][] { 1147*cdf0e10cSrcweir new Object[] { new Any(Type.BOOLEAN, Boolean.TRUE) } }, 1148*cdf0e10cSrcweir new TestEnum[] { TestEnum.TWO }, 1149*cdf0e10cSrcweir new TestStruct[] { new TestStruct(10) }, 1150*cdf0e10cSrcweir new TestPolyStruct[] { new TestPolyStruct(Boolean.TRUE) }, 1151*cdf0e10cSrcweir new TestPolyStruct[] { 1152*cdf0e10cSrcweir new TestPolyStruct(new Any(Type.BOOLEAN, Boolean.TRUE)) }, 1153*cdf0e10cSrcweir new Object[] { null }, 1154*cdf0e10cSrcweir TestEnum.TWO, 1155*cdf0e10cSrcweir new TestStruct(10), 1156*cdf0e10cSrcweir new TestPolyStruct(Boolean.TRUE), 1157*cdf0e10cSrcweir new TestPolyStruct(new Any(Type.BOOLEAN, Boolean.TRUE)), 1158*cdf0e10cSrcweir null); 1159*cdf0e10cSrcweir Constructors.create2(context, new Object[] { 1160*cdf0e10cSrcweir Boolean.TRUE, 1161*cdf0e10cSrcweir new Byte(Byte.MIN_VALUE), 1162*cdf0e10cSrcweir new Short(Short.MIN_VALUE), 1163*cdf0e10cSrcweir new Any(Type.UNSIGNED_SHORT, new Short((short) -1)), 1164*cdf0e10cSrcweir new Integer(Integer.MIN_VALUE), 1165*cdf0e10cSrcweir new Any(Type.UNSIGNED_LONG, new Integer(-1)), 1166*cdf0e10cSrcweir new Long(Long.MIN_VALUE), 1167*cdf0e10cSrcweir new Any(Type.UNSIGNED_HYPER, new Long(-1L)), 1168*cdf0e10cSrcweir new Float(0.123f), 1169*cdf0e10cSrcweir new Double(0.456), 1170*cdf0e10cSrcweir new Character('X'), 1171*cdf0e10cSrcweir "test", 1172*cdf0e10cSrcweir Type.ANY, 1173*cdf0e10cSrcweir new Any(Type.BOOLEAN, Boolean.TRUE), 1174*cdf0e10cSrcweir new boolean[] { true }, 1175*cdf0e10cSrcweir new byte[] { Byte.MIN_VALUE }, 1176*cdf0e10cSrcweir new short[] { Short.MIN_VALUE }, 1177*cdf0e10cSrcweir new Any( 1178*cdf0e10cSrcweir new Type("[]unsigned short"), new short[] { (short) -1 }), 1179*cdf0e10cSrcweir new int[] { Integer.MIN_VALUE }, 1180*cdf0e10cSrcweir new Any(new Type("[]unsigned long"), new int[] { -1 }), 1181*cdf0e10cSrcweir new long[] { Long.MIN_VALUE }, 1182*cdf0e10cSrcweir new Any(new Type("[]unsigned hyper"), new long[] { -1L }), 1183*cdf0e10cSrcweir new float[] { 0.123f }, 1184*cdf0e10cSrcweir new double[] { 0.456 }, 1185*cdf0e10cSrcweir new char[] { 'X' }, 1186*cdf0e10cSrcweir new String[] { "test" }, 1187*cdf0e10cSrcweir new Type[] { Type.ANY }, 1188*cdf0e10cSrcweir new Any(new Type("[]any"), new Boolean[] { Boolean.TRUE }), 1189*cdf0e10cSrcweir new boolean[][] { new boolean[] { true } }, 1190*cdf0e10cSrcweir new Object[][] { 1191*cdf0e10cSrcweir new Object[] { new Any(Type.BOOLEAN, Boolean.TRUE) } }, 1192*cdf0e10cSrcweir new TestEnum[] { TestEnum.TWO }, 1193*cdf0e10cSrcweir new TestStruct[] { new TestStruct(10) }, 1194*cdf0e10cSrcweir new Any( 1195*cdf0e10cSrcweir new Type( 1196*cdf0e10cSrcweir "[]test.testtools.bridgetest.TestPolyStruct<boolean>"), 1197*cdf0e10cSrcweir new TestPolyStruct[] { new TestPolyStruct(Boolean.TRUE) }), 1198*cdf0e10cSrcweir new Any( 1199*cdf0e10cSrcweir new Type("[]test.testtools.bridgetest.TestPolyStruct<any>"), 1200*cdf0e10cSrcweir new TestPolyStruct[] { 1201*cdf0e10cSrcweir new TestPolyStruct(new Any(Type.BOOLEAN, Boolean.TRUE)) 1202*cdf0e10cSrcweir }), 1203*cdf0e10cSrcweir new XInterface[] { null }, 1204*cdf0e10cSrcweir TestEnum.TWO, 1205*cdf0e10cSrcweir new TestStruct(10), 1206*cdf0e10cSrcweir new Any( 1207*cdf0e10cSrcweir new Type( 1208*cdf0e10cSrcweir "test.testtools.bridgetest.TestPolyStruct<boolean>"), 1209*cdf0e10cSrcweir new TestPolyStruct(Boolean.TRUE)), 1210*cdf0e10cSrcweir new Any( 1211*cdf0e10cSrcweir new Type("test.testtools.bridgetest.TestPolyStruct<any>"), 1212*cdf0e10cSrcweir new TestPolyStruct(new Any(Type.BOOLEAN, Boolean.TRUE))), 1213*cdf0e10cSrcweir null }); 1214*cdf0e10cSrcweir Constructors2.create1( 1215*cdf0e10cSrcweir context, 1216*cdf0e10cSrcweir new TestPolyStruct(Type.LONG), 1217*cdf0e10cSrcweir new TestPolyStruct(new Any(Type.BOOLEAN, Boolean.TRUE)), 1218*cdf0e10cSrcweir new TestPolyStruct(new Boolean(true)), 1219*cdf0e10cSrcweir new TestPolyStruct(new Byte(Byte.MIN_VALUE)), 1220*cdf0e10cSrcweir new TestPolyStruct(new Short(Short.MIN_VALUE)), 1221*cdf0e10cSrcweir new TestPolyStruct(new Integer(Integer.MIN_VALUE)), 1222*cdf0e10cSrcweir new TestPolyStruct(new Long(Long.MIN_VALUE)), 1223*cdf0e10cSrcweir new TestPolyStruct(new Character('X')), 1224*cdf0e10cSrcweir new TestPolyStruct("test"), 1225*cdf0e10cSrcweir new TestPolyStruct(new Float(0.123f)), 1226*cdf0e10cSrcweir new TestPolyStruct(new Double(0.456)), 1227*cdf0e10cSrcweir new TestPolyStruct(new com.sun.star.lib.uno.helper.ComponentBase()), 1228*cdf0e10cSrcweir new TestPolyStruct(new com.sun.star.lib.uno.helper.ComponentBase()), 1229*cdf0e10cSrcweir new TestPolyStruct(TestEnum.TWO), 1230*cdf0e10cSrcweir new TestPolyStruct(new TestPolyStruct2(new Character('X'), 1231*cdf0e10cSrcweir new Any(Type.BOOLEAN, Boolean.TRUE))), 1232*cdf0e10cSrcweir new TestPolyStruct(new TestPolyStruct2(new TestPolyStruct2( 1233*cdf0e10cSrcweir new Character('X'), new Any(Type.BOOLEAN, Boolean.TRUE)), "test")), 1234*cdf0e10cSrcweir new TestPolyStruct2("test", new TestPolyStruct2(new Character('X'), 1235*cdf0e10cSrcweir new TestPolyStruct(new Any(Type.BOOLEAN, Boolean.TRUE)))), 1236*cdf0e10cSrcweir new TestPolyStruct2( new TestPolyStruct2(new Character('X'), 1237*cdf0e10cSrcweir new Any(Type.BOOLEAN, Boolean.TRUE)), new TestPolyStruct(new Character('X'))), 1238*cdf0e10cSrcweir new TestPolyStruct(new Type[] { Type.LONG}), 1239*cdf0e10cSrcweir new TestPolyStruct(new Any[] { new Any(Type.BOOLEAN, Boolean.TRUE) }), 1240*cdf0e10cSrcweir new TestPolyStruct(new boolean[] {true}), 1241*cdf0e10cSrcweir new TestPolyStruct(new byte[] {Byte.MIN_VALUE}), 1242*cdf0e10cSrcweir new TestPolyStruct(new short[] {Short.MIN_VALUE}), 1243*cdf0e10cSrcweir new TestPolyStruct(new int[] {Integer.MIN_VALUE}), 1244*cdf0e10cSrcweir new TestPolyStruct(new long[] {Long.MIN_VALUE}), 1245*cdf0e10cSrcweir new TestPolyStruct(new char[] {'X'}), 1246*cdf0e10cSrcweir new TestPolyStruct(new String[] {"test"}), 1247*cdf0e10cSrcweir new TestPolyStruct(new float[] {0.123f}), 1248*cdf0e10cSrcweir new TestPolyStruct(new double[] {0.456d}), 1249*cdf0e10cSrcweir new TestPolyStruct(new Object[] {new com.sun.star.lib.uno.helper.ComponentBase()}), 1250*cdf0e10cSrcweir new TestPolyStruct(new com.sun.star.lang.XComponent[] {new com.sun.star.lib.uno.helper.ComponentBase()}), 1251*cdf0e10cSrcweir new TestPolyStruct(new TestEnum[] {TestEnum.TWO}), 1252*cdf0e10cSrcweir new TestPolyStruct(new TestPolyStruct2[] {new TestPolyStruct2( 1253*cdf0e10cSrcweir new Character('X'), new Any[] {new Any(Type.BOOLEAN, Boolean.TRUE)})}), 1254*cdf0e10cSrcweir new TestPolyStruct(new TestPolyStruct2[] {new TestPolyStruct2( 1255*cdf0e10cSrcweir new TestPolyStruct(new Character('X')), new Any[] {new Any(Type.BOOLEAN, Boolean.TRUE)})}), 1256*cdf0e10cSrcweir new TestPolyStruct(new int[][] { new int[] {Integer.MIN_VALUE} }), 1257*cdf0e10cSrcweir new TestPolyStruct[]{ new TestPolyStruct(new Integer(Integer.MIN_VALUE))}, 1258*cdf0e10cSrcweir new TestPolyStruct[]{new TestPolyStruct(new TestPolyStruct2( 1259*cdf0e10cSrcweir new Character('X'), new Any(Type.BOOLEAN, Boolean.TRUE)))}, 1260*cdf0e10cSrcweir new TestPolyStruct[]{new TestPolyStruct(new TestPolyStruct2( 1261*cdf0e10cSrcweir new TestPolyStruct2(new Character('X'), new Any(Type.BOOLEAN, Boolean.TRUE)), "test"))}, 1262*cdf0e10cSrcweir new TestPolyStruct2[]{new TestPolyStruct2("test", new TestPolyStruct2( 1263*cdf0e10cSrcweir new Character('X'), new TestPolyStruct(new Any(Type.BOOLEAN, Boolean.TRUE))))}, 1264*cdf0e10cSrcweir new TestPolyStruct2[]{new TestPolyStruct2(new TestPolyStruct2(new Character('X'), new Any( 1265*cdf0e10cSrcweir Type.BOOLEAN, Boolean.TRUE)),new TestPolyStruct(new Character('X')))}, 1266*cdf0e10cSrcweir new TestPolyStruct[][]{new TestPolyStruct[]{new TestPolyStruct(new Character('X'))}}, 1267*cdf0e10cSrcweir new TestPolyStruct[][]{new TestPolyStruct[]{ 1268*cdf0e10cSrcweir new TestPolyStruct(new TestPolyStruct2(new Character('X'), new Any(Type.BOOLEAN, Boolean.TRUE)))}}, 1269*cdf0e10cSrcweir new TestPolyStruct[][]{new TestPolyStruct[] {new TestPolyStruct(new TestPolyStruct2( 1270*cdf0e10cSrcweir new TestPolyStruct2(new Character('X'),new Any(Type.BOOLEAN, Boolean.TRUE)), "test"))}}, 1271*cdf0e10cSrcweir new TestPolyStruct2[][]{new TestPolyStruct2[]{new TestPolyStruct2( 1272*cdf0e10cSrcweir "test", new TestPolyStruct2(new Character('X'),new TestPolyStruct(new Any(Type.BOOLEAN, Boolean.TRUE))))}}, 1273*cdf0e10cSrcweir new TestPolyStruct2[][]{new TestPolyStruct2[]{new TestPolyStruct2( 1274*cdf0e10cSrcweir new TestPolyStruct2(new Character('X'),new Any(Type.BOOLEAN, Boolean.TRUE)), 1275*cdf0e10cSrcweir new TestPolyStruct(new Character('X')))}}); 1276*cdf0e10cSrcweir } 1277*cdf0e10cSrcweir 1278*cdf0e10cSrcweir public XCurrentContextChecker getCurrentContextChecker() { 1279*cdf0e10cSrcweir return new CurrentContextChecker(); 1280*cdf0e10cSrcweir } 1281*cdf0e10cSrcweir } 1282*cdf0e10cSrcweir 1283*cdf0e10cSrcweir /** 1284*cdf0e10cSrcweir * Gives a factory for creating the service. 1285*cdf0e10cSrcweir * This method is called by the <code>JavaLoader</code> 1286*cdf0e10cSrcweir * <p> 1287*cdf0e10cSrcweir * @return returns a <code>XSingleServiceFactory</code> for creating the component 1288*cdf0e10cSrcweir * @param implName the name of the implementation for which a service is desired 1289*cdf0e10cSrcweir * @param multiFactory the service manager to be uses if needed 1290*cdf0e10cSrcweir * @param regKey the registryKey 1291*cdf0e10cSrcweir * @see com.sun.star.comp.loader.JavaLoader 1292*cdf0e10cSrcweir */ 1293*cdf0e10cSrcweir public static XSingleServiceFactory __getServiceFactory(String implName, 1294*cdf0e10cSrcweir XMultiServiceFactory multiFactory, 1295*cdf0e10cSrcweir XRegistryKey regKey) 1296*cdf0e10cSrcweir { 1297*cdf0e10cSrcweir XSingleServiceFactory xSingleServiceFactory = null; 1298*cdf0e10cSrcweir 1299*cdf0e10cSrcweir if(implName.equals(_TestObject.class.getName())) 1300*cdf0e10cSrcweir xSingleServiceFactory = FactoryHelper.getServiceFactory(_TestObject.class, 1301*cdf0e10cSrcweir _TestObject.__serviceName, 1302*cdf0e10cSrcweir multiFactory, 1303*cdf0e10cSrcweir regKey); 1304*cdf0e10cSrcweir 1305*cdf0e10cSrcweir else if(implName.equals(_PerformancTestObject.class.getName())) 1306*cdf0e10cSrcweir xSingleServiceFactory = FactoryHelper.getServiceFactory(_PerformancTestObject.class, 1307*cdf0e10cSrcweir _PerformancTestObject.__serviceName, 1308*cdf0e10cSrcweir multiFactory, 1309*cdf0e10cSrcweir regKey); 1310*cdf0e10cSrcweir 1311*cdf0e10cSrcweir return xSingleServiceFactory; 1312*cdf0e10cSrcweir } 1313*cdf0e10cSrcweir } 1314