Kaydet (Commit) 31547837 authored tarafından Oliver Bolte's avatar Oliver Bolte

INTEGRATION: CWS qadev16 (1.4.2); FILE MERGED

2004/02/11 11:42:27 sw 1.4.2.1: #i23469#
üst e3860ef2
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: SvxUnoNumberingRules.java,v $ * $RCSfile: SvxUnoNumberingRules.java,v $
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* last change:$Date: 2004-01-05 19:52:25 $ * last change:$Date: 2004-03-19 14:37:50 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -58,51 +58,72 @@ ...@@ -58,51 +58,72 @@
* *
* *
************************************************************************/ ************************************************************************/
package mod._svx; package mod._svx;
import com.sun.star.beans.Property;
import com.sun.star.container.XIndexAccess;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import java.io.PrintWriter; import java.io.PrintWriter;
import lib.StatusException; import lib.StatusException;
import lib.TestCase; import lib.TestCase;
import lib.TestEnvironment; import lib.TestEnvironment;
import lib.TestParameters; import lib.TestParameters;
import util.DrawTools; import util.DrawTools;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
public class SvxUnoNumberingRules extends TestCase { public class SvxUnoNumberingRules extends TestCase {
XComponent xDrawDoc; XComponent xDrawDoc;
protected void initialize( TestParameters tParam, PrintWriter log ) { protected void initialize(TestParameters tParam, PrintWriter log) {
log.println( "creating a drawdoc" ); log.println("creating a drawdoc");
xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF()); xDrawDoc = DrawTools.createDrawDoc(
(XMultiServiceFactory) tParam.getMSF());
} }
protected TestEnvironment createTestEnvironment(TestParameters tParam, protected TestEnvironment createTestEnvironment(TestParameters tParam,
PrintWriter log) { PrintWriter log) {
XMultiServiceFactory docMSF = (XMultiServiceFactory)UnoRuntime. XMultiServiceFactory docMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
queryInterface(XMultiServiceFactory.class, xDrawDoc); XMultiServiceFactory.class,
xDrawDoc);
XInterface oObj = null;
try { try {
XInterface xInt = (XInterface)docMSF.createInstance( oObj = (XInterface) docMSF.createInstance(
"com.sun.star.text.NumberingRules"); "com.sun.star.text.NumberingRules");
TestEnvironment tEnv = new TestEnvironment(xInt);
return tEnv;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(log); e.printStackTrace(log);
throw new StatusException("Unexpected exception", e); throw new StatusException("Unexpected exception", e);
} }
TestEnvironment tEnv = new TestEnvironment(oObj);
log.println("Implementationname: " + util.utils.getImplName(oObj));
Object NewRules=null;
try{
XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, oObj);
NewRules = xIA.getByIndex(2);
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
log.println("Couldn't get new Rules for XIndexReplace");
} catch (com.sun.star.lang.WrappedTargetException e) {
log.println("Couldn't get new Rules for XIndexReplace");
}
tEnv.addObjRelation("INSTANCE1",NewRules);
return tEnv;
} }
protected void cleanup( TestParameters tParam, PrintWriter log ) { protected void cleanup(TestParameters tParam, PrintWriter log) {
log.println( " disposing xDrawDoc " ); log.println(" disposing xDrawDoc ");
util.DesktopTools.closeDoc(xDrawDoc); util.DesktopTools.closeDoc(xDrawDoc);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment