Tag: cws_dev300_odbmacros3
User: fs      
Date: 2008-07-30 08:48:44+0000
Modified:
   dba/dbaccess/qa/complex/dbaccess/CRMBasedTestCase.java

Log:
 #i76128# +getComponentContext

File Changes:

Directory: /dba/dbaccess/qa/complex/dbaccess/
=============================================

File [changed]: CRMBasedTestCase.java
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/qa/complex/dbaccess/CRMBasedTestCase.java?r1=1.1.6.3&r2=1.1.6.4
Delta lines:  +22 -1
--------------------
--- CRMBasedTestCase.java       2008-07-24 05:36:29+0000        1.1.6.3
+++ CRMBasedTestCase.java       2008-07-30 08:48:41+0000        1.1.6.4
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: CRMBasedTestCase.java,v $
- * $Revision: 1.1.6.3 $
+ * $Revision: 1.1.6.4 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -29,9 +29,13 @@
  ************************************************************************/
 package complex.dbaccess;
 
+import com.sun.star.beans.UnknownPropertyException;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.WrappedTargetException;
 import com.sun.star.lang.XMultiServiceFactory;
 import com.sun.star.sdb.XSingleSelectQueryComposer;
 import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.logging.Level;
@@ -48,6 +52,23 @@
     }
 
     // 
--------------------------------------------------------------------------------------------------------
+    protected final XComponentContext getComponentContext()
+    {
+        XComponentContext context = null;
+        try
+        {
+            XPropertySet orbProps = (XPropertySet) UnoRuntime.queryInterface( 
XPropertySet.class, getORB() );
+            context = (XComponentContext)UnoRuntime.queryInterface( 
XComponentContext.class,
+                orbProps.getPropertyValue( "DefaultContext" ) );
+        }
+        catch ( Exception ex )
+        {
+            failed( "could not retrieve the ComponentContext" );
+        }
+        return context;
+    }
+
+    // 
--------------------------------------------------------------------------------------------------------
     protected void createTestCase()
     {
         try




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to