summaryrefslogtreecommitdiff
path: root/testtools
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-09-16 14:37:52 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-09-16 14:37:52 +0000
commita4a53cdd24cad42e1b6295d6d106e35becb5a917 (patch)
tree301281a1ee0d9cd74be42ae191448605be9424b4 /testtools
parent46c6fa84d275a81f9b1eb0d953baec342ea7f052 (diff)
CWS-TOOLING: integrate CWS sb113
2009-09-01 sb #i76393# second attempt at properly #ifdef-ing previous HG commit d598efdbf012 2009-08-28 sb #i102469# change back <T extends XInterface> to just <T> on queryInterface, to avoid binary incompatibility (method changing its signature from (Ljava/lang/Class;Ljava/lang/Object;)Ljava/lang/Object; to (Ljava/lang/Class;Ljava/lang/Object;)Lcom/sun/star/uno/XInterface;) 2009-08-28 sb #i76393# properly #ifdef previous HG commit d598efdbf012 2009-08-27 sb #i94421# work around compiler error (based on a patch supplied by cloph) 2009-08-26 sb merged in DEV300_m56 2009-08-26 sb #i76393# on Linux, include dynamic section offset in crash report so as to be able to map "prelinked" callstacks back to original (patch by cmc) 2009-08-26 sb #i88162# remove unnecessary whitespace lines from per-locale xcu files (patch by tora) 2009-08-17 Juergen Schmidt #i104292# set context classloader after create new custom UNO loader 2009-08-17 Juergen Schmidt #i103749# integrate patch 2009-08-14 sb #i103269# cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r 5124ebd5edd1 ("#i101955# changed encoding of XML file content from erroneous ISO-8859-1 to UTF-8") 2009-08-12 sb #i102469# fixed mis-applications of UnoRuntime.queryInterface (detected via the simplified UnoRuntime.queryInterface, the HG changeset 29de35fc9554) to use AnyConverter instead; changed qadevOOo's lib.MultiMethodTest.before to allow throwing arbitrary exceptions, to cater for IllegalArgumentException thrown by AnyConverter 2009-08-12 sb #i104178# drop extra libxml2-config script from libxmlsec 2009-08-10 sb #i101754# simplified osl_getProcessInfo for LINUX (patch by cmc) 2009-08-10 sb #i95018# avoid closing -1 fds (patch supplied by cmc) 2009-08-10 sb #i103585# removed (apparently unnecessary) zlib support from libxml2; in turn, removed zlib dependencies from libxmlsec, libxslt, and redland (assuming those were transitive dependencies brought in by direct dependencies on libxml2) 2009-08-10 sb #i102469# simplified UnoRuntime.queryInterface using Java 5 generics; adapted URE-related modules accordingly 2009-08-10 sb #i101213# adapted setsolar env (solenv/config/) to set PYTHONPATH (and not set PYTHONHOME) in accordance with configure env (set_soenv.in); fixed testtools/source/bridgetest/pyuno (which now should work everywhere out of the box, thanks to the fixed setsolar PYTHONPATH) 2009-08-10 sb cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r ea8de6d9396b ("#i101955# work in progress for a .hgignore file, continued")
Diffstat (limited to 'testtools')
-rw-r--r--testtools/com/sun/star/comp/bridge/TestComponentMain.java10
-rw-r--r--testtools/source/bridgetest/pyuno/main.py3
-rw-r--r--testtools/source/bridgetest/pyuno/makefile.mk7
-rw-r--r--testtools/source/servicetests/LocalServiceTest.java4
-rw-r--r--testtools/source/servicetests/RemoteServiceTest.java4
-rw-r--r--testtools/source/servicetests/TestBase.java8
6 files changed, 17 insertions, 19 deletions
diff --git a/testtools/com/sun/star/comp/bridge/TestComponentMain.java b/testtools/com/sun/star/comp/bridge/TestComponentMain.java
index a57b512e1ee8..d061a425306a 100644
--- a/testtools/com/sun/star/comp/bridge/TestComponentMain.java
+++ b/testtools/com/sun/star/comp/bridge/TestComponentMain.java
@@ -104,11 +104,11 @@ public class TestComponentMain
XComponentContext ctx = com.sun.star.comp.helper.Bootstrap.createInitialComponentContext( null );
XMultiComponentFactory smgr = ctx.getServiceManager();
- XMultiServiceFactory oldsmgr = (XMultiServiceFactory)
+ XMultiServiceFactory oldsmgr =
UnoRuntime.queryInterface( XMultiServiceFactory.class, smgr );
// prepare servicemanager
- XSet set = (XSet) UnoRuntime.queryInterface(XSet.class, smgr);
+ XSet set = UnoRuntime.queryInterface(XSet.class, smgr);
Object o = com.sun.star.comp.bridge.TestComponent.__getServiceFactory(
"com.sun.star.comp.bridge.TestComponent$_TestObject", oldsmgr,null );
set.insert(o);
@@ -121,7 +121,7 @@ public class TestComponentMain
XConnection xConnection = xAcceptor.accept(conDcp);
- XBridgeFactory xBridgeFactory = (XBridgeFactory)UnoRuntime.queryInterface(
+ XBridgeFactory xBridgeFactory = UnoRuntime.queryInterface(
XBridgeFactory.class,
smgr.createInstanceWithContext("com.sun.star.bridge.BridgeFactory",ctx));
@@ -130,8 +130,8 @@ public class TestComponentMain
if (singleaccept) {
Listener listener = new Listener();
- ((XComponent) UnoRuntime.queryInterface(
- XComponent.class, xBridge)).addEventListener(listener);
+ UnoRuntime.queryInterface(XComponent.class, xBridge).
+ addEventListener(listener);
listener.await();
break;
}
diff --git a/testtools/source/bridgetest/pyuno/main.py b/testtools/source/bridgetest/pyuno/main.py
index e63e36ecffdc..df1454b87c4f 100644
--- a/testtools/source/bridgetest/pyuno/main.py
+++ b/testtools/source/bridgetest/pyuno/main.py
@@ -34,11 +34,12 @@ import importer
import unittest
import core
import impl
+import os
import sys
ctx = uno.getComponentContext()
# needed for the tests
-unohelper.addComponentsToContext(ctx,ctx,("cppobj.uno","bridgetest.uno","streams.uno","bootstrap.uno"),"com.sun.star.loader.SharedLibrary")
+unohelper.addComponentsToContext(ctx,ctx,(os.environ["FOO"]+"/cppobj.uno",os.environ["FOO"]+"/bridgetest.uno","streams.uno","bootstrap.uno"),"com.sun.star.loader.SharedLibrary")
unohelper.addComponentsToContext(ctx,ctx,("vnd.openoffice.pymodule:samplecomponent",),"com.sun.star.loader.Python")
diff --git a/testtools/source/bridgetest/pyuno/makefile.mk b/testtools/source/bridgetest/pyuno/makefile.mk
index d3be59540bd1..44b9f98603b7 100644
--- a/testtools/source/bridgetest/pyuno/makefile.mk
+++ b/testtools/source/bridgetest/pyuno/makefile.mk
@@ -51,7 +51,6 @@ DOLLAR_SIGN=$$
.ENDIF
#these are temporary
-REGCOMP=$(WRAPCMD) regcomp
PYTHON=$(WRAPCMD) python
.IF "$(GUI)"!="WNT" && "$(GUI)"!="OS2"
@@ -112,10 +111,10 @@ doc .PHONY:
@echo start test with dmake runtest
runtest : ALL
- cd $(DLLDEST) && $(TEST_ENV) && python main.py
- cd $(DLLDEST) && $(TEST_ENV) && $(REGCOMP) -register -br pyuno_regcomp.rdb -r dummy.rdb \
+ cd $(DLLDEST) && $(TEST_ENV) && python main.py
+ cd $(DLLDEST) && $(TEST_ENV) && $(WRAPCMD) $(REGCOMP) -register -br pyuno_regcomp.rdb -r dummy.rdb \
-l com.sun.star.loader.Python $(foreach,i,$(PYCOMPONENTS) -c vnd.openoffice.pymodule:$(i))
- cd $(DLLDEST) && $(TEST_ENV) && $(REGCOMP) -register -br pyuno_regcomp.rdb -r dummy2.rdb \
+ cd $(DLLDEST) && $(TEST_ENV) && $(WRAPCMD) $(REGCOMP) -register -br pyuno_regcomp.rdb -r dummy2.rdb \
-l com.sun.star.loader.Python -c vnd.sun.star.expand:$(DOLLAR_SIGN)FOO/samplecomponent.py
.ENDIF # L10N_framework
diff --git a/testtools/source/servicetests/LocalServiceTest.java b/testtools/source/servicetests/LocalServiceTest.java
index 78b2819a63d2..5b8290f58376 100644
--- a/testtools/source/servicetests/LocalServiceTest.java
+++ b/testtools/source/servicetests/LocalServiceTest.java
@@ -44,8 +44,8 @@ public final class LocalServiceTest extends TestBase {
= Bootstrap.createInitialComponentContext(null);
XMultiComponentFactory serviceManager
= context.getServiceManager();
- ((XSet) UnoRuntime.queryInterface(
- XSet.class, serviceManager)).insert(new TestService());
+ UnoRuntime.queryInterface(XSet.class, serviceManager).
+ insert(new TestService());
return serviceManager.createInstanceWithContext(
"testtools.servicetests.TestService2", context);
}
diff --git a/testtools/source/servicetests/RemoteServiceTest.java b/testtools/source/servicetests/RemoteServiceTest.java
index 50b6c1555590..b98bb9352a96 100644
--- a/testtools/source/servicetests/RemoteServiceTest.java
+++ b/testtools/source/servicetests/RemoteServiceTest.java
@@ -76,12 +76,12 @@ public final class RemoteServiceTest extends TestBase {
= Bootstrap.createInitialComponentContext(null);
XMultiComponentFactory serviceManager
= context.getServiceManager();
- ((XSet) UnoRuntime.queryInterface(XSet.class, serviceManager)).
+ UnoRuntime.queryInterface(XSet.class, serviceManager).
insert(new TestService());
final Object instance = serviceManager.createInstanceWithContext(
"testtools.servicetests.TestService2", context);
XBridgeFactory bridgeFactory
- = (XBridgeFactory) UnoRuntime.queryInterface(
+ = UnoRuntime.queryInterface(
XBridgeFactory.class,
serviceManager.createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", context));
diff --git a/testtools/source/servicetests/TestBase.java b/testtools/source/servicetests/TestBase.java
index 62d8bef83d5a..311fb99c4133 100644
--- a/testtools/source/servicetests/TestBase.java
+++ b/testtools/source/servicetests/TestBase.java
@@ -41,7 +41,7 @@ public abstract class TestBase extends ComplexTestCase {
public final void test() throws Exception {
TestServiceFactory factory = getTestServiceFactory();
- TestService2 t = (TestService2) UnoRuntime.queryInterface(
+ TestService2 t = UnoRuntime.queryInterface(
TestService2.class, factory.get());
assure(t != null);
assure(UnoRuntime.queryInterface(TestService1.class, t) == t);
@@ -122,12 +122,10 @@ public abstract class TestBase extends ComplexTestCase {
t.setProp8Long(0);
assure(t.getProp8Long() == 0);
assure(t.fn2() == 2);
- XTestService3 t3 = (XTestService3) UnoRuntime.queryInterface(
- XTestService3.class, t);
+ XTestService3 t3 = UnoRuntime.queryInterface(XTestService3.class, t);
assure(t3 != null);
assure(t3.fn3() == 3);
- XTestService4 t4 = (XTestService4) UnoRuntime.queryInterface(
- XTestService4.class, t);
+ XTestService4 t4 = UnoRuntime.queryInterface(XTestService4.class, t);
assure(t4 == null);
WaitUnreachable u = new WaitUnreachable(t);
t = null;