BridgedObject_Test.java (2be43276) BridgedObject_Test.java (9cbd97ce)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 12 unchanged lines hidden (view full) ---

21
22
23
24package com.sun.star.lib.uno.bridges.java_remote;
25
26import com.sun.star.bridge.XBridge;
27import com.sun.star.uno.Type;
28import com.sun.star.uno.XInterface;
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 12 unchanged lines hidden (view full) ---

21
22
23
24package com.sun.star.lib.uno.bridges.java_remote;
25
26import com.sun.star.bridge.XBridge;
27import com.sun.star.uno.Type;
28import com.sun.star.uno.XInterface;
29import complexlib.ComplexTestCase;
30
29
31public final class BridgedObject_Test extends ComplexTestCase {
32 public String[] getTestMethodNames() {
33 return new String[] { "test" };
34 }
30import org.junit.Test;
31import static org.junit.Assert.*;
35
32
33public final class BridgedObject_Test {
34 @Test
36 public void test() {
37 RequestHandler handler = new RequestHandler() {
38 public Object sendRequest(
39 String oid, Type type, String operation, Object[] args)
40 {
41 return null;
42 }
43 };
44 XBridge bridge1 = new TestBridge();
45 ProxyFactory factory1 = new ProxyFactory(handler, bridge1);
46 XBridge bridge2 = new TestBridge();
47 ProxyFactory factory2 = new ProxyFactory(handler, bridge2);
48 Object object0 = new Object();
49 Object object1 = factory1.create("", new Type(XInterface.class));
50 Object object2 = factory2.create("", new Type(XInterface.class));
35 public void test() {
36 RequestHandler handler = new RequestHandler() {
37 public Object sendRequest(
38 String oid, Type type, String operation, Object[] args)
39 {
40 return null;
41 }
42 };
43 XBridge bridge1 = new TestBridge();
44 ProxyFactory factory1 = new ProxyFactory(handler, bridge1);
45 XBridge bridge2 = new TestBridge();
46 ProxyFactory factory2 = new ProxyFactory(handler, bridge2);
47 Object object0 = new Object();
48 Object object1 = factory1.create("", new Type(XInterface.class));
49 Object object2 = factory2.create("", new Type(XInterface.class));
51 assure(BridgedObject.getBridge(object0) == null);
52 assure(BridgedObject.getBridge(object1) == bridge1);
53 assure(BridgedObject.getBridge(object2) == bridge2);
50 assertTrue(BridgedObject.getBridge(object0) == null);
51 assertTrue(BridgedObject.getBridge(object1) == bridge1);
52 assertTrue(BridgedObject.getBridge(object2) == bridge2);
54 }
55
56 private static final class TestBridge implements XBridge {
57 public Object getInstance(String instanceName) {
58 return null;
59 }
60
61 public String getName() {
62 return null;
63 }
64
65 public String getDescription() {
66 return null;
67 }
68 }
69}
53 }
54
55 private static final class TestBridge implements XBridge {
56 public Object getInstance(String instanceName) {
57 return null;
58 }
59
60 public String getName() {
61 return null;
62 }
63
64 public String getDescription() {
65 return null;
66 }
67 }
68}