summaryrefslogtreecommitdiff
path: root/bridges/test
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-09-25 21:47:16 +0200
committerMathias Bauer <mba@openoffice.org>2009-09-25 21:47:16 +0200
commit3739e0b64036f81ee62b4842332dd74d974b6d00 (patch)
treeb9073e6fae3d3e20395d34ba1221a9812bf79ea2 /bridges/test
parenta2c915bbd6b28ca2ad39800ba768464f73981145 (diff)
parent8fb94ad47fa73514ec1854825d63d612121dd9b7 (diff)
merge commit
Diffstat (limited to 'bridges/test')
-rw-r--r--bridges/test/com/sun/star/lib/TestBed.java4
-rw-r--r--bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug107753_Test.java14
-rw-r--r--bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug108825_Test.java2
-rw-r--r--bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug110892_Test.java2
-rw-r--r--bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug111153_Test.java2
-rw-r--r--bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug51323_Test.java2
-rw-r--r--bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug92174_Test.java2
-rw-r--r--bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug97697_Test.java2
-rw-r--r--bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug98508_Test.java2
-rwxr-xr-xbridges/test/com/sun/star/lib/uno/bridges/java_remote/MethodIdTest.java2
-rw-r--r--bridges/test/com/sun/star/lib/uno/bridges/java_remote/PolyStructTest.java2
-rw-r--r--bridges/test/com/sun/star/lib/uno/bridges/java_remote/StopMessageDispatcherTest.java2
-rw-r--r--bridges/test/java_uno/acquire/TestAcquire.java4
-rw-r--r--bridges/test/java_uno/any/TestRemote.java2
-rw-r--r--bridges/test/java_uno/equals/TestEquals.java40
-rw-r--r--bridges/test/java_uno/nativethreadpool/Relay.java2
-rw-r--r--bridges/test/testclient.java4
17 files changed, 40 insertions, 50 deletions
diff --git a/bridges/test/com/sun/star/lib/TestBed.java b/bridges/test/com/sun/star/lib/TestBed.java
index 7242b56438f0..5e2c5e7859c8 100644
--- a/bridges/test/com/sun/star/lib/TestBed.java
+++ b/bridges/test/com/sun/star/lib/TestBed.java
@@ -130,7 +130,7 @@ public final class TestBed {
throws com.sun.star.uno.Exception
{
XConnector connector = Connector.create(context);
- XBridgeFactory factory = (XBridgeFactory) UnoRuntime.queryInterface(
+ XBridgeFactory factory = UnoRuntime.queryInterface(
XBridgeFactory.class,
context.getServiceManager().createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", context));
@@ -169,7 +169,7 @@ public final class TestBed {
= Bootstrap.createInitialComponentContext(null);
XAcceptor acceptor = Acceptor.create(context);
XBridgeFactory factory
- = (XBridgeFactory) UnoRuntime.queryInterface(
+ = UnoRuntime.queryInterface(
XBridgeFactory.class,
context.getServiceManager().createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", context));
diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug107753_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug107753_Test.java
index a2c4122d3017..2c7e314afc82 100644
--- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug107753_Test.java
+++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug107753_Test.java
@@ -68,22 +68,19 @@ public final class Bug107753_Test extends ComplexTestCase {
protected boolean run(XComponentContext context) throws Throwable {
boolean success = true;
- XTransport transport = (XTransport) UnoRuntime.queryInterface(
+ XTransport transport = UnoRuntime.queryInterface(
XTransport.class, getBridge(context).getInstance("Transport"));
Object obj1a = new XType1() {};
- XType1 obj1b = (XType1) UnoRuntime.queryInterface(XType1.class,
- obj1a);
+ XType1 obj1b = UnoRuntime.queryInterface(XType1.class, obj1a);
success &= test("obj1a == obj1b", obj1a == obj1b);
Object obj2a = new XType2() {};
- XType2 obj2b = (XType2) UnoRuntime.queryInterface(XType2.class,
- obj2a);
+ XType2 obj2b = UnoRuntime.queryInterface(XType2.class, obj2a);
success &= test("obj2a == obj2b", obj2a == obj2b);
Object obj3a = transport.getType1();
- XType1 obj3b = (XType1) UnoRuntime.queryInterface(XType1.class,
- obj3a);
+ XType1 obj3b = UnoRuntime.queryInterface(XType1.class, obj3a);
success &= test(
"obj3a != obj3b; only meaningful as long as different proxy"
+ " instances are used for different UNO interfaces of one UNO"
@@ -91,8 +88,7 @@ public final class Bug107753_Test extends ComplexTestCase {
obj3a != obj3b);
Object obj4a = transport.getType2();
- XType2 obj4b = (XType2) UnoRuntime.queryInterface(XType2.class,
- obj4a);
+ XType2 obj4b = UnoRuntime.queryInterface(XType2.class, obj4a);
success &= test(
"obj4a != obj4b; only meaningful as long as different proxy"
+ " instances are used for different UNO interfaces of one UNO"
diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug108825_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug108825_Test.java
index 6e9d97f7034d..0585e1c8f650 100644
--- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug108825_Test.java
+++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug108825_Test.java
@@ -68,7 +68,7 @@ public final class Bug108825_Test extends ComplexTestCase {
}
protected boolean run(XComponentContext context) throws Throwable {
- XTest test = (XTest) UnoRuntime.queryInterface(
+ XTest test = UnoRuntime.queryInterface(
XTest.class, getBridge(context).getInstance("Test"));
// Send the XObject that is held on the server side amidst two
// dummies that are not held on the server side; then wait for the
diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug110892_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug110892_Test.java
index 76bd9d37a10c..1a537895b0ed 100644
--- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug110892_Test.java
+++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug110892_Test.java
@@ -71,7 +71,7 @@ public final class Bug110892_Test extends ComplexTestCase {
}
protected boolean run(XComponentContext context) throws Throwable {
- XTest test = (XTest) UnoRuntime.queryInterface(
+ XTest test = UnoRuntime.queryInterface(
XTest.class, getBridge(context).getInstance("Test"));
test.start(new ClientObject());
synchronized (lock) {
diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug111153_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug111153_Test.java
index d1f09509d9a3..40eccdba2cc6 100644
--- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug111153_Test.java
+++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug111153_Test.java
@@ -63,7 +63,7 @@ public final class Bug111153_Test extends ComplexTestCase {
}
protected boolean run(XComponentContext context) throws Throwable {
- XTransport t = (XTransport) UnoRuntime.queryInterface(
+ XTransport t = UnoRuntime.queryInterface(
XTransport.class, getBridge(context).getInstance("Transport"));
XDerived d = new XDerived() {};
t.setDerived(d);
diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug51323_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug51323_Test.java
index 32bfe9d832a3..247bf65ba185 100644
--- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug51323_Test.java
+++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug51323_Test.java
@@ -67,7 +67,7 @@ public final class Bug51323_Test extends ComplexTestCase {
protected boolean run(XComponentContext context) throws Throwable {
XConnection connection =
Connector.create(context).connect(getConnectionDescription());
- XBridgeFactory factory = (XBridgeFactory) UnoRuntime.queryInterface(
+ XBridgeFactory factory = UnoRuntime.queryInterface(
XBridgeFactory.class,
context.getServiceManager().createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", context));
diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug92174_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug92174_Test.java
index 292dabde4758..13b61447c320 100644
--- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug92174_Test.java
+++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug92174_Test.java
@@ -55,7 +55,7 @@ public final class Bug92174_Test extends ComplexTestCase {
}
protected boolean run(XComponentContext context) throws Throwable {
- XTransport t = (XTransport) UnoRuntime.queryInterface(
+ XTransport t = UnoRuntime.queryInterface(
XTransport.class, getBridge(context).getInstance("Transport"));
t.setDerived(new XDerived() {
public void fn() {}
diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug97697_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug97697_Test.java
index f235ccfd6475..2fdd457f0dcb 100644
--- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug97697_Test.java
+++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug97697_Test.java
@@ -72,7 +72,7 @@ public final class Bug97697_Test extends ComplexTestCase {
}
protected boolean run(XComponentContext context) throws Throwable {
- XTransport transport = (XTransport) UnoRuntime.queryInterface(
+ XTransport transport = UnoRuntime.queryInterface(
XTransport.class, getBridge(context).getInstance("Transport"));
try {
transport.getAny();
diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug98508_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug98508_Test.java
index b713deaa352e..79e373014c4a 100644
--- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug98508_Test.java
+++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug98508_Test.java
@@ -76,7 +76,7 @@ public final class Bug98508_Test extends ComplexTestCase {
protected boolean run(XComponentContext context) throws Throwable {
Test98508Interface ifc
- = (Test98508Interface) UnoRuntime.queryInterface(
+ = UnoRuntime.queryInterface(
Test98508Interface.class,
getBridge(context).getInstance(""));
try {
diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/MethodIdTest.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/MethodIdTest.java
index c22811502e14..407164c66c7f 100755
--- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/MethodIdTest.java
+++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/MethodIdTest.java
@@ -64,7 +64,7 @@ public final class MethodIdTest extends ComplexTestCase {
}
protected boolean run(XComponentContext context) throws Throwable {
- XTest t = (XTest) UnoRuntime.queryInterface(
+ XTest t = UnoRuntime.queryInterface(
XTest.class, getBridge(context).getInstance("Test"));
return t.f129() == 129;
}
diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/PolyStructTest.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/PolyStructTest.java
index 2f17041a52fb..1c9e387ddb32 100644
--- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/PolyStructTest.java
+++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/PolyStructTest.java
@@ -61,7 +61,7 @@ public final class PolyStructTest extends ComplexTestCase {
}
protected boolean run(XComponentContext context) throws Throwable {
- TestTransport t = (TestTransport) UnoRuntime.queryInterface(
+ TestTransport t = UnoRuntime.queryInterface(
TestTransport.class, getBridge(context).getInstance(""));
assertEquals(
diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/StopMessageDispatcherTest.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/StopMessageDispatcherTest.java
index 7590a89fdd0e..37fb8ffee05b 100644
--- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/StopMessageDispatcherTest.java
+++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/StopMessageDispatcherTest.java
@@ -63,7 +63,7 @@ public final class StopMessageDispatcherTest extends ComplexTestCase {
}
protected boolean run(XComponentContext context) throws Throwable {
- XTest test = (XTest) UnoRuntime.queryInterface(
+ XTest test = UnoRuntime.queryInterface(
XTest.class, getBridge(context).getInstance("Test"));
Thread[] threads = new Thread[101];
int n = Thread.enumerate(threads);
diff --git a/bridges/test/java_uno/acquire/TestAcquire.java b/bridges/test/java_uno/acquire/TestAcquire.java
index 7d54c00d480d..e219b3adbf72 100644
--- a/bridges/test/java_uno/acquire/TestAcquire.java
+++ b/bridges/test/java_uno/acquire/TestAcquire.java
@@ -71,7 +71,7 @@ public final class TestAcquire {
private static void execClient(XComponentContext context, String url)
throws Exception
{
- XTest test = (XTest) UnoRuntime.queryInterface(
+ XTest test = UnoRuntime.queryInterface(
XTest.class, UnoUrlResolver.create(context).resolve(url));
WaitUnreachable u;
@@ -184,7 +184,7 @@ public final class TestAcquire {
throws Exception
{
XAcceptor acceptor = Acceptor.create(context);
- XBridgeFactory factory = (XBridgeFactory) UnoRuntime.queryInterface(
+ XBridgeFactory factory = UnoRuntime.queryInterface(
XBridgeFactory.class,
context.getServiceManager().createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", context));
diff --git a/bridges/test/java_uno/any/TestRemote.java b/bridges/test/java_uno/any/TestRemote.java
index db33efc139e9..ec533054579d 100644
--- a/bridges/test/java_uno/any/TestRemote.java
+++ b/bridges/test/java_uno/any/TestRemote.java
@@ -49,7 +49,7 @@ public final class TestRemote {
}
protected boolean run(XComponentContext context) throws Throwable {
- XTransport transport = (XTransport) UnoRuntime.queryInterface(
+ XTransport transport = UnoRuntime.queryInterface(
XTransport.class, getBridge(context).getInstance("Transport"));
return TestAny.test(transport, true);
}
diff --git a/bridges/test/java_uno/equals/TestEquals.java b/bridges/test/java_uno/equals/TestEquals.java
index 31b735473c9b..38c9500629e3 100644
--- a/bridges/test/java_uno/equals/TestEquals.java
+++ b/bridges/test/java_uno/equals/TestEquals.java
@@ -91,10 +91,10 @@ public final class TestEquals {
}
protected boolean run(XComponentContext context) throws Throwable {
- XTestFrame f = (XTestFrame) UnoRuntime.queryInterface(
+ XTestFrame f = UnoRuntime.queryInterface(
XTestFrame.class, getBridge(context).getInstance("TestFrame"));
XAcceptor acceptor = Acceptor.create(context);
- XBridgeFactory factory = (XBridgeFactory) UnoRuntime.queryInterface(
+ XBridgeFactory factory = UnoRuntime.queryInterface(
XBridgeFactory.class,
context.getServiceManager().createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", context));
@@ -160,17 +160,15 @@ public final class TestEquals {
public void run() {
try {
Object test1Aa = object1;
- XBase test1Ab = (XBase)
- UnoRuntime.queryInterface(
- XBase.class, test1Aa);
- XDerived test1Ac = (XDerived)
+ XBase test1Ab = UnoRuntime.queryInterface(
+ XBase.class, test1Aa);
+ XDerived test1Ac =
UnoRuntime.queryInterface(
XDerived.class, test1Aa);
Object test2Aa = object2;
- XBase test2Ab = (XBase)
- UnoRuntime.queryInterface(
- XBase.class, test2Aa);
- XDerived test2Ac = (XDerived)
+ XBase test2Ab = UnoRuntime.queryInterface(
+ XBase.class, test2Aa);
+ XDerived test2Ac =
UnoRuntime.queryInterface(
XDerived.class, test2Aa);
@@ -182,16 +180,14 @@ public final class TestEquals {
null, params);
XMultiComponentFactory factory
= context.getServiceManager();
- XImplementationLoader loader
- = (XImplementationLoader)
+ XImplementationLoader loader =
UnoRuntime.queryInterface(
XImplementationLoader.class,
factory.createInstanceWithContext(
"com.sun.star.loader."
+ "SharedLibrary",
context));
- XSingleComponentFactory factory2
- = (XSingleComponentFactory)
+ XSingleComponentFactory factory2 =
UnoRuntime.queryInterface(
XSingleComponentFactory.class,
loader.activate(
@@ -199,7 +195,7 @@ public final class TestEquals {
+ "testequals.impl",
"", "../lib/testequals.uno",
null));
- XTestInterface test = (XTestInterface)
+ XTestInterface test =
UnoRuntime.queryInterface(
XTestInterface.class,
factory2.createInstanceWithContext(
@@ -211,17 +207,15 @@ public final class TestEquals {
PROTOCOL_DESCRIPTION);
Object test1Ba = test.get(INSTANCE1);
- XBase test1Bb = (XBase)
- UnoRuntime.queryInterface(
- XBase.class, test1Ba);
- XDerived test1Bc = (XDerived)
+ XBase test1Bb = UnoRuntime.queryInterface(
+ XBase.class, test1Ba);
+ XDerived test1Bc =
UnoRuntime.queryInterface(
XDerived.class, test1Ba);
Object test2Ba = test.get(INSTANCE2);
- XBase test2Bb = (XBase)
- UnoRuntime.queryInterface(
- XBase.class, test2Ba);
- XDerived test2Bc = (XDerived)
+ XBase test2Bb = UnoRuntime.queryInterface(
+ XBase.class, test2Ba);
+ XDerived test2Bc =
UnoRuntime.queryInterface(
XDerived.class, test2Ba);
diff --git a/bridges/test/java_uno/nativethreadpool/Relay.java b/bridges/test/java_uno/nativethreadpool/Relay.java
index b7e304c4a3c9..03cf6795c596 100644
--- a/bridges/test/java_uno/nativethreadpool/Relay.java
+++ b/bridges/test/java_uno/nativethreadpool/Relay.java
@@ -63,7 +63,7 @@ public final class Relay implements XRelay, XSource {
final XAcceptor acceptor = Acceptor.create(context);
final XBridgeFactory factory;
try {
- factory = (XBridgeFactory) UnoRuntime.queryInterface(
+ factory = UnoRuntime.queryInterface(
XBridgeFactory.class,
context.getServiceManager().createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", context));
diff --git a/bridges/test/testclient.java b/bridges/test/testclient.java
index 244264fa8686..e1733bbc8b10 100644
--- a/bridges/test/testclient.java
+++ b/bridges/test/testclient.java
@@ -121,7 +121,7 @@ public class testclient
XConnector xConnector =
- ( XConnector ) UnoRuntime.queryInterface( XConnector.class , x );
+ UnoRuntime.queryInterface( XConnector.class , x );
XConnection xConnection = xConnector.connect(args[0]);
@@ -138,7 +138,7 @@ public class testclient
System.out.println( "after building bridge" );
// Object rInitialObject = m_bridge.mapInterfaceFrom(rootOid, XInterface.class);
-// XTestFactory rFactory = (XTestFactory )
+// XTestFactory rFactory =
// UnoRuntime.queryInterface(XTestFactory.class,rInitialObject );
// XCallMe callMerFactory->