2 * MultiStratumBackend.java
4 * Created on 24. March 2004, 13:48
9 import com
.sun
.star
.lang
.XMultiServiceFactory
;
10 import com
.sun
.star
.uno
.UnoRuntime
;
11 import com
.sun
.star
.uno
.XInterface
;
12 import com
.sun
.star
.util
.XStringSubstitution
;
13 import java
.io
.PrintWriter
;
15 import lib
.TestEnvironment
;
16 import lib
.TestParameters
;
18 public class MultiStratumBackend
extends TestCase
{
20 protected TestEnvironment
createTestEnvironment(TestParameters tParam
, PrintWriter log
) {
21 XInterface oObj
= null;
23 Object
[] args
= new Object
[1];
27 XStringSubstitution sts
= createStringSubstitution(
28 (XMultiServiceFactory
) tParam
.getMSF());
29 AdminURL
= sts
.getSubstituteVariableValue("$(inst)") +
31 args
[0] = ((XMultiServiceFactory
)tParam
.getMSF())
32 .createInstance("com.sun.star.configuration.bootstrap.BootstrapContext");
33 oObj
= (XInterface
) ((XMultiServiceFactory
)tParam
.getMSF())
34 .createInstanceWithArguments("com.sun.star.comp.configuration.backend.MultiStratumBackend",args
);
36 } catch (com
.sun
.star
.uno
.Exception e
) {
39 log
.println("Implementation name: "+ util
.utils
.getImplName(oObj
));
41 TestEnvironment tEnv
= new TestEnvironment(oObj
);
43 //objRelation for XInitialization
44 tEnv
.addObjRelation("XInitialization.args", args
);
46 //objRelation for XBackendEntities
47 tEnv
.addObjRelation("NoAdmin", AdminURL
);
48 tEnv
.addObjRelation("MSB", Boolean
.TRUE
);
53 public static XStringSubstitution
createStringSubstitution(XMultiServiceFactory xMSF
) {
54 Object xPathSubst
= null;
57 xPathSubst
= xMSF
.createInstance(
58 "com.sun.star.util.PathSubstitution");
59 } catch (com
.sun
.star
.uno
.Exception e
) {
63 if (xPathSubst
!= null) {
64 return (XStringSubstitution
) UnoRuntime
.queryInterface(
65 XStringSubstitution
.class, xPathSubst
);