diff options
author | Kurt Zenker <kz@openoffice.org> | 2010-01-15 14:01:24 +0100 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2010-01-15 14:01:24 +0100 |
commit | f438e048e8416950cb10f916d0c3ea31554c24b6 (patch) | |
tree | 3ba78465a9086c12ad3cc606682366881ec4b1b3 /dbaccess/qa/complex/dbaccess/TestCase.java | |
parent | 66a220af39ab5493dfc660a846c3da78d60839bf (diff) | |
parent | b84930a93b3a360f46ad16ae0ddd6555b3fc6274 (diff) |
CWS-TOOLING: integrate CWS dba33b
Diffstat (limited to 'dbaccess/qa/complex/dbaccess/TestCase.java')
-rw-r--r-- | dbaccess/qa/complex/dbaccess/TestCase.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/dbaccess/qa/complex/dbaccess/TestCase.java b/dbaccess/qa/complex/dbaccess/TestCase.java index 40370d9aeebd..e331ccc33e7c 100644 --- a/dbaccess/qa/complex/dbaccess/TestCase.java +++ b/dbaccess/qa/complex/dbaccess/TestCase.java @@ -29,8 +29,12 @@ ************************************************************************/ package complex.dbaccess; +import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; +import com.sun.star.frame.XComponentLoader; +import com.sun.star.frame.XModel; import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import helper.FileTools; @@ -38,8 +42,6 @@ import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; -import java.net.URI; -import java.net.URISyntaxException; public abstract class TestCase extends complexlib.ComplexTestCase { @@ -55,8 +57,8 @@ public abstract class TestCase extends complexlib.ComplexTestCase XComponentContext context = null; try { - final XPropertySet orbProps = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, getORB() ); - context = (XComponentContext)UnoRuntime.queryInterface( XComponentContext.class, + final XPropertySet orbProps = UnoRuntime.queryInterface( XPropertySet.class, getORB() ); + context = UnoRuntime.queryInterface( XComponentContext.class, orbProps.getPropertyValue( "DefaultContext" ) ); } catch ( Exception ex ) @@ -109,6 +111,15 @@ public abstract class TestCase extends complexlib.ComplexTestCase } // -------------------------------------------------------------------------------------------------------- + protected final XModel loadDocument( final String _docURL ) throws Exception + { + final XComponentLoader loader = UnoRuntime.queryInterface( XComponentLoader.class, + getORB().createInstance( "com.sun.star.frame.Desktop" ) ); + return UnoRuntime.queryInterface( XModel.class, + loader.loadComponentFromURL( _docURL, "_blank", 0, new PropertyValue[] {} ) ); + } + + // -------------------------------------------------------------------------------------------------------- protected void assureException( Object _object, Class _unoInterfaceClass, String _methodName, Object[] _methodArgs, Class _expectedExceptionClass ) { |