summaryrefslogtreecommitdiff
path: root/jurt/test
diff options
context:
space:
mode:
authorKay Ramme <kr@openoffice.org>2001-01-17 09:13:07 +0000
committerKay Ramme <kr@openoffice.org>2001-01-17 09:13:07 +0000
commitd53d25342e5c064258f9b0e067ecefb27414ac8b (patch)
tree1ae9ee1386be060f0f6cc6433d4ae8a8cc51a127 /jurt/test
parent576397e4569e20ecce66fb182e1b7ab730683c25 (diff)
use Type and TypeDescription instead of Class
Diffstat (limited to 'jurt/test')
-rw-r--r--jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java9
-rw-r--r--jurt/test/com/sun/star/lib/uno/environments/java/java_environment_Test.java17
-rw-r--r--jurt/test/com/sun/star/lib/uno/environments/remote/JobQueue_Test.java44
-rw-r--r--jurt/test/com/sun/star/lib/uno/environments/remote/ThreadPool_Test.java9
4 files changed, 52 insertions, 27 deletions
diff --git a/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java b/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java
index 10b514473ab6..a8be5159d5cb 100644
--- a/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java
+++ b/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java
@@ -2,9 +2,9 @@
*
* $RCSfile: java_remote_bridge_Test.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: kr $ $Date: 2000-11-23 15:38:39 $
+ * last change: $Author: kr $ $Date: 2001-01-17 10:13:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,6 +78,7 @@ import com.sun.star.comp.connections.PipedConnection;
import com.sun.star.connection.XConnection;
import com.sun.star.uno.IEnvironment;
+import com.sun.star.uno.Type;
import com.sun.star.uno.XInterface;
import com.sun.star.lib.uno.environments.java.java_environment;
@@ -86,6 +87,7 @@ import com.sun.star.lib.uno.environments.java.Proxy;
import com.sun.star.lib.uno.environments.remote.IProtocol;
+
public class java_remote_bridge_Test {
static IEnvironment __java_environment_A;
static IEnvironment __java_environment_B;
@@ -106,8 +108,7 @@ public class java_remote_bridge_Test {
boolean passed = true;
// XInterface theProxy = (XInterface)__java_remote_bridge_B.mapInterfaceFrom("testinstance", XInterface.class); // map the instance back from oid world to Bs real world
- XInterface theProxy = (XInterface)Proxy.create(__java_remote_bridge_B, "testinstance", XInterface.class, true, false);
-
+ XInterface theProxy = (XInterface)Proxy.create(__java_remote_bridge_B, "testinstance", new Type(XInterface.class), true, false);
TestInterface theProxy_TestInterfaces[] = new TestInterface[objects];
diff --git a/jurt/test/com/sun/star/lib/uno/environments/java/java_environment_Test.java b/jurt/test/com/sun/star/lib/uno/environments/java/java_environment_Test.java
index 03aabb57acde..c5d1d6523054 100644
--- a/jurt/test/com/sun/star/lib/uno/environments/java/java_environment_Test.java
+++ b/jurt/test/com/sun/star/lib/uno/environments/java/java_environment_Test.java
@@ -2,9 +2,9 @@
*
* $RCSfile: java_environment_Test.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: kr $ $Date: 2000-09-28 11:34:31 $
+ * last change: $Author: kr $ $Date: 2001-01-17 10:13:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -64,6 +64,7 @@ package com.sun.star.lib.uno.environments.java;
import java.util.Vector;
+import com.sun.star.uno.Type;
import com.sun.star.uno.XInterface;
@@ -79,22 +80,22 @@ public class java_environment_Test {
String oid[] = new String[1];
System.err.println("\tregistering ordinary interface twice...");
- Object obj2 = env.registerInterface(obj, oid, XInterface.class);
- Object obj3 = env.registerInterface(obj, oid, XInterface.class);
+ Object obj2 = env.registerInterface(obj, oid, new Type(XInterface.class));
+ Object obj3 = env.registerInterface(obj, oid, new Type(XInterface.class));
passed = passed && (obj == obj2) && (obj == obj3);
// env.list();
System.err.println("\tasking for registered interface...");
- passed = passed && (obj == env.getRegisteredInterface(oid[0], XInterface.class));
+ passed = passed && (obj == env.getRegisteredInterface(oid[0], new Type(XInterface.class)));
System.err.println("\trevoking interface...");
- env.revokeInterface(oid[0], XInterface.class);
- env.revokeInterface(oid[0], XInterface.class);
+ env.revokeInterface(oid[0], new Type(XInterface.class));
+ env.revokeInterface(oid[0], new Type(XInterface.class));
- passed = passed && (null == env.getRegisteredInterface(oid[0], XInterface.class));
+ passed = passed && (null == env.getRegisteredInterface(oid[0], new Type(XInterface.class)));
System.err.println("java_environment - tests passed? " + passed);
diff --git a/jurt/test/com/sun/star/lib/uno/environments/remote/JobQueue_Test.java b/jurt/test/com/sun/star/lib/uno/environments/remote/JobQueue_Test.java
index 5f0671422f91..18349ff3f8dd 100644
--- a/jurt/test/com/sun/star/lib/uno/environments/remote/JobQueue_Test.java
+++ b/jurt/test/com/sun/star/lib/uno/environments/remote/JobQueue_Test.java
@@ -2,9 +2,9 @@
*
* $RCSfile: JobQueue_Test.java,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: kr $ $Date: 2001-01-17 10:06:35 $
+ * last change: $Author: kr $ $Date: 2001-01-17 10:13:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -64,11 +64,14 @@ package com.sun.star.lib.uno.environments.remote;
import java.util.Vector;
-
import java.io.IOException;
import java.io.OutputStream;
+
+import com.sun.star.lib.uno.typedesc.TypeDescription;
+
import com.sun.star.uno.IEnvironment;
+import com.sun.star.uno.Type;
import com.sun.star.uno.UnoRuntime;
@@ -96,7 +99,7 @@ public class JobQueue_Test {
_passed = _passed && (((Integer)param).intValue() == _received_requestId);
if(!_passed)
- throw new NullPointerException("blblbl");
+ throw new NullPointerException("blblbl: " + param + " " + _received_requestId);
++ _received_requestId;
@@ -118,7 +121,7 @@ public class JobQueue_Test {
ThreadPool.addThread(_context);
Job job = new Job(this, new MyReceiver(null), // receiver
new MyMessage(true,
- MyInterface.class,
+ TypeDescription.getTypeDescription(MyInterface.class),
UnoRuntime.generateOid(this),
JavaThreadPool.getThreadId(Thread.currentThread()),
this,
@@ -143,6 +146,7 @@ public class JobQueue_Test {
}
}
+ static Object __lock = new Object();
// this is for testing dispose
static class MyImpl2 implements MyInterface {
@@ -165,7 +169,7 @@ public class JobQueue_Test {
wait(); // wait for tester to tell us to leave
}
}
- catch(InterruptedException interruptedException) {
+ catch(InterruptedException interruptedException) {
result = true;
}
@@ -204,13 +208,13 @@ public class JobQueue_Test {
- static void sendAsyncJobs(int jobs, JobQueue jobQueue, MyReceiver myReceiver, ThreadID threadID, MyInterface myImpl, Object context) {
+ static void sendAsyncJobs(int jobs, JobQueue jobQueue, MyReceiver myReceiver, ThreadID threadID, MyInterface myImpl, Object context) throws Exception {
// sending asynchrones calls
System.err.println("\tsending " + jobs + " asynchrones calls...");
for(int i = 0; i < jobs; ++ i) {
MyMessage myMessage = new MyMessage(false,
- MyInterface.class,
+ TypeDescription.getTypeDescription(MyInterface.class),
UnoRuntime.generateOid(myImpl),
threadID,
myImpl,
@@ -229,7 +233,7 @@ public class JobQueue_Test {
for(int i = 0; i < jobs; ++ i) {
MyMessage myMessage = new MyMessage(true,
- MyInterface.class,
+ TypeDescription.getTypeDescription(MyInterface.class),
UnoRuntime.generateOid(myImpl),
threadID,
myImpl,
@@ -253,7 +257,7 @@ public class JobQueue_Test {
jobQueue.putJob(job_do, context);
myMessage = new MyMessage(true,
- MyInterface.class,
+ TypeDescription.getTypeDescription(MyInterface.class),
UnoRuntime.generateOid(myImpl),
threadID,
myImpl,
@@ -355,7 +359,10 @@ public class JobQueue_Test {
synchronized(myImpl) {
sendAsyncJobs(1, jobQueue, myReceiver, threadID, myImpl, context);
myImpl.wait();
+ myImpl.notify();
+
jobQueue.interrupt(context);
+
myImpl.notify();
myImpl.wait();
}
@@ -364,8 +371,11 @@ public class JobQueue_Test {
synchronized(myImpl) {
sendSyncJobs(1, jobQueue, myReceiver, threadID, myImpl, null, context, false);
myImpl.wait();
- jobQueue.interrupt(context);
myImpl.notify();
+
+ jobQueue.interrupt(context);
+
+ myImpl.notify();
myImpl.wait();
}
@@ -398,7 +408,17 @@ public class JobQueue_Test {
}
static public void main(String args[]) throws Exception {
- test(null);
+ if(args.length == 0)
+ test(null);
+
+ else if(args[0].equals("test_disposing"))
+ test_disposing();
+
+ else if(args[0].equals("test_without_thread"))
+ test_without_thread();
+
+ else if(args[0].equals("test_with_thread"))
+ test_with_thread();
}
}
diff --git a/jurt/test/com/sun/star/lib/uno/environments/remote/ThreadPool_Test.java b/jurt/test/com/sun/star/lib/uno/environments/remote/ThreadPool_Test.java
index 69b56f6b7639..a45f89a402b4 100644
--- a/jurt/test/com/sun/star/lib/uno/environments/remote/ThreadPool_Test.java
+++ b/jurt/test/com/sun/star/lib/uno/environments/remote/ThreadPool_Test.java
@@ -2,9 +2,9 @@
*
* $RCSfile: ThreadPool_Test.java,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: kr $ $Date: 2001-01-17 10:06:35 $
+ * last change: $Author: kr $ $Date: 2001-01-17 10:13:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,7 +69,10 @@ import java.util.Enumeration;
import java.util.Vector;
+import com.sun.star.lib.uno.typedesc.TypeDescription;
+
import com.sun.star.uno.IEnvironment;
+import com.sun.star.uno.Type;
import com.sun.star.uno.UnoRuntime;
@@ -188,7 +191,7 @@ public class ThreadPool_Test {
for(int i = 0; i < jobs; ++ i) {
MyMessage myMessage = new MyMessage(synchron,
- MyInterface.class,
+ TypeDescription.getTypeDescription(MyInterface.class),
UnoRuntime.generateOid(myImpl),
threadID,
myImpl,