1*620ba73aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*620ba73aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*620ba73aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*620ba73aSAndrew Rist  * distributed with this work for additional information
6*620ba73aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*620ba73aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*620ba73aSAndrew Rist  * "License"); you may not use this file except in compliance
9*620ba73aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*620ba73aSAndrew Rist  *
11*620ba73aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*620ba73aSAndrew Rist  *
13*620ba73aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*620ba73aSAndrew Rist  * software distributed under the License is distributed on an
15*620ba73aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*620ba73aSAndrew Rist  * KIND, either express or implied.  See the License for the
17*620ba73aSAndrew Rist  * specific language governing permissions and limitations
18*620ba73aSAndrew Rist  * under the License.
19*620ba73aSAndrew Rist  *
20*620ba73aSAndrew Rist  *************************************************************/
21*620ba73aSAndrew Rist 
22*620ba73aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir package test.java_uno.anytest;
25cdf0e10cSrcweir 
26cdf0e10cSrcweir import com.sun.star.bridge.XInstanceProvider;
27cdf0e10cSrcweir import com.sun.star.lib.TestBed;
28cdf0e10cSrcweir import com.sun.star.uno.UnoRuntime;
29cdf0e10cSrcweir import com.sun.star.uno.XComponentContext;
30cdf0e10cSrcweir 
31cdf0e10cSrcweir public final class TestRemote {
main(String[] args)32cdf0e10cSrcweir     public static void main(String[] args) throws Exception {
33cdf0e10cSrcweir         boolean success = new TestBed().execute(
34cdf0e10cSrcweir             new Provider(), false, Client.class, 0);
35cdf0e10cSrcweir         System.out.println("success? " + success);
36cdf0e10cSrcweir         System.exit(success ? 0 : 1);
37cdf0e10cSrcweir     }
38cdf0e10cSrcweir 
39cdf0e10cSrcweir     public static final class Client extends TestBed.Client {
main(String[] args)40cdf0e10cSrcweir         public static void main(String[] args) {
41cdf0e10cSrcweir             new Client().execute();
42cdf0e10cSrcweir         }
43cdf0e10cSrcweir 
run(XComponentContext context)44cdf0e10cSrcweir         protected boolean run(XComponentContext context) throws Throwable {
45cdf0e10cSrcweir             XTransport transport = UnoRuntime.queryInterface(
46cdf0e10cSrcweir                 XTransport.class, getBridge(context).getInstance("Transport"));
47cdf0e10cSrcweir             return TestAny.test(transport, true);
48cdf0e10cSrcweir         }
49cdf0e10cSrcweir     }
50cdf0e10cSrcweir 
51cdf0e10cSrcweir     private static final class Provider implements XInstanceProvider {
getInstance(String instanceName)52cdf0e10cSrcweir         public Object getInstance(String instanceName) {
53cdf0e10cSrcweir             return new XTransport() {
54cdf0e10cSrcweir                     public Object mapAny(Object any) {
55cdf0e10cSrcweir                         return any;
56cdf0e10cSrcweir                     }
57cdf0e10cSrcweir                 };
58cdf0e10cSrcweir         }
59cdf0e10cSrcweir     }
60cdf0e10cSrcweir }
61