manager.createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", context));
if (factory == null) {
throw new NullPointerException("no bridge factory");
}
UnoUrl url = UnoUrl.parseUnoUrl(arguments[0]);
XBridge bridge = factory.createBridge(
"", url.getProtocolAndParametersAsString(),
Connector.create(context).connect(
url.getConnectionAndParametersAsString()),
null);
Data d = UnoRuntime.queryInterface(
XServer.class, bridge.getInstance(url.getRootOid())).getData();
UnoRuntime.queryInterface(XComponent.class, bridge).dispose();
if (!d.m1.equals("Hello") || d.m2 != 42) {
throw new RuntimeException("Data object contains bad values");
}
}