summaryrefslogtreecommitdiff
path: root/extensions/test
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-09-07 09:24:10 +0200
committerMichael Stahl <mstahl@redhat.com>2012-09-10 23:43:37 +0200
commite3d9ff3fd0b753a6712e86703e5f69392d241508 (patch)
tree1408b6a2f67c825bc822aa8774e5ed7cbdf92d4e /extensions/test
parent4409280278ce539d488926cad6fa343a971c3b29 (diff)
Java cleanup, fixup the TestPGP code to compile again.
Change-Id: I7b77f1a21936ff63b64d005fff3343df30b90b38
Diffstat (limited to 'extensions/test')
-rw-r--r--extensions/test/pgp/TestPGP.java50
1 files changed, 10 insertions, 40 deletions
diff --git a/extensions/test/pgp/TestPGP.java b/extensions/test/pgp/TestPGP.java
index 2fcffccf6d5c..9559f1c18480 100644
--- a/extensions/test/pgp/TestPGP.java
+++ b/extensions/test/pgp/TestPGP.java
@@ -19,43 +19,21 @@
import java.io.IOException;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.beans.PropertyState;
-
-import com.sun.star.bridge.XBridge;
-
-// import com.sun.star.comp.bootstrap.Bootstrap;
-
-import com.sun.star.connection.XConnector;
+import com.sun.star.bridge.UnoUrlResolver;
+import com.sun.star.bridge.XUnoUrlResolver;
+import com.sun.star.comp.helper.Bootstrap;
import com.sun.star.connection.XConnection;
-
-import com.sun.star.io.BufferSizeExceededException;
-import com.sun.star.io.NotConnectedException;
-import com.sun.star.io.XInputStream;
-import com.sun.star.io.XOutputStream;
-
-import com.sun.star.frame.XComponentLoader;
-
-import com.sun.star.lang.XComponent;
+import com.sun.star.connection.XConnector;
+import com.sun.star.container.XSet;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XServiceInfo;
-
-import com.sun.star.text.XSimpleText;
-import com.sun.star.text.XText;
-import com.sun.star.text.XTextCursor;
-import com.sun.star.text.XTextDocument;
-import com.sun.star.text.XTextRange;
-
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.pgp.SimplePGPMailerFactoryReg;
import com.sun.star.uno.IBridge;
import com.sun.star.uno.Type;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XCurrentContext;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.XNamingService;
-import com.sun.star.container.*;
-import com.sun.star.lang.*;
-
-import com.sun.star.pgp.*;
+// import com.sun.star.comp.bootstrap.Bootstrap;
@@ -100,13 +78,6 @@ public class TestPGP {
- static String neededServices[] = new String[] {
- "com.sun.star.comp.servicemanager.ServiceManager",
- "com.sun.star.comp.loader.JavaLoader",
- "com.sun.star.comp.connections.Connector",
- "com.sun.star.comp.connections.Acceptor"
- };
-
public static void main(String argv[]) throws Exception {
if(argv.length != 1) {
System.err.println("usage : testoffice protocol:host:port");
@@ -114,10 +85,9 @@ public class TestPGP {
}
// try {
- com.sun.star.comp.servicemanager.ServiceManager smgr = new com.sun.star.comp.servicemanager.ServiceManager();
- smgr.addFactories(neededServices, null);
+ XUnoUrlResolver resolver = UnoUrlResolver.create(Bootstrap.createInitialComponentContext(null));
- XConnector xConnector = (XConnector)smgr.createInstance("com.sun.star.connection.Connector");
+ XConnector xConnector = UnoRuntime.queryInterface(XConnector.class, resolver.resolve("com.sun.star.connection.Connector"));
XConnection xConnection = xConnector.connect(argv[0]);
String rootOid = "classic_uno";