2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 import com
.sun
.star
.lang
.NoSupportException
;
22 import com
.sun
.star
.lang
.XServiceInfo
;
23 import com
.sun
.star
.lang
.XSingleComponentFactory
;
24 /*import com.sun.star.uno.OptionalPropertyException;*/
25 /*import com.sun.star.uno.VoidPropertyException;*/
26 import com
.sun
.star
.uno
.XComponentContext
;
28 public final class TestService
implements XServiceInfo
, XSingleComponentFactory
30 public String
getImplementationName() {
31 return getClass().getName();
34 public boolean supportsService(String serviceName
) {
35 return serviceName
.equals(SERVICE_NAME
);
38 public String
[] getSupportedServiceNames() {
39 return new String
[] { SERVICE_NAME
};
42 public Object
createInstanceWithContext(XComponentContext context
)
43 throws com
.sun
.star
.uno
.Exception
48 public Object
createInstanceWithArgumentsAndContext(
49 Object
[] arguments
, XComponentContext context
)
50 throws com
.sun
.star
.uno
.Exception
52 throw new NoSupportException(
53 "createInstanceWithArgumentsAndContext", this);
56 private static final class Service
implements TestService2
, XTestService3
{
61 public int getProp1() {
65 public void setProp1(int value
) {
69 public int getProp2() {
73 public int getProp3Long(){
76 public int getProp4Long(){
80 public int getProp5Long()
85 public int getProp6() {
86 return prop6
.intValue();
89 public void setProp6(int value
) {
90 prop6
= Integer
.valueOf(value
);
95 return prop7
.intValue();
98 public void setProp7(int value
) {
99 prop7
= Integer
.valueOf(value
);
102 public int getProp8Long() {
106 public void setProp8Long(int value
)
119 private int prop1
= 1;
120 private Integer prop6
= Integer
.valueOf(6);
121 private Integer prop7
= Integer
.valueOf(7);
122 private int prop8
= 8;
125 private static final String SERVICE_NAME
126 = "testtools.servicetests.TestService2";