summaryrefslogtreecommitdiff
path: root/jurt
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-05-22 08:01:33 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-05-22 08:01:33 +0000
commit69fb441ae9bcc9e08e833f0fd997cea4e9d22c86 (patch)
tree757b644d38dba5b7917a4df6702599bfd52c5a1c /jurt
parent6a3f7e542b30048c6e0b8541f5aee219e88d2de7 (diff)
INTEGRATION: CWS uno4 (1.2.66); FILE MERGED
2003/05/07 12:37:11 sb 1.2.66.1: #108642# Cleaned up tests.
Diffstat (limited to 'jurt')
-rw-r--r--jurt/test/com/sun/star/comp/connections/PipedConnection_Test.java70
1 files changed, 32 insertions, 38 deletions
diff --git a/jurt/test/com/sun/star/comp/connections/PipedConnection_Test.java b/jurt/test/com/sun/star/comp/connections/PipedConnection_Test.java
index 69c9a683800d..24b76ffa6501 100644
--- a/jurt/test/com/sun/star/comp/connections/PipedConnection_Test.java
+++ b/jurt/test/com/sun/star/comp/connections/PipedConnection_Test.java
@@ -2,9 +2,9 @@
*
* $RCSfile: PipedConnection_Test.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: kr $ $Date: 2001-01-17 09:35:10 $
+ * last change: $Author: vg $ $Date: 2003-05-22 09:01:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,11 +61,39 @@
package com.sun.star.comp.connections;
+import complexlib.ComplexTestCase;
-import java.util.Vector;
+public final class PipedConnection_Test extends ComplexTestCase {
+ public String getTestObjectName() {
+ return getClass().getName();
+ }
+
+ public String[] getTestMethodNames() {
+ return new String[] { "test" };
+ }
+
+ public void test() throws Exception {
+ PipedConnection rightSide = new PipedConnection(new Object[0]);
+ PipedConnection leftSide = new PipedConnection(new Object[]{rightSide});
+
+ byte theByte[] = new byte[1];
+
+ Reader reader = new Reader(rightSide, theByte);
+ Writer writer = new Writer(leftSide, theByte, reader);
+
+ reader.start();
+ writer.start();
+
+ Thread.sleep(2000);
+
+ writer.term();
+ writer.join();
+
+ reader.join();
+ assure("", writer._state && reader._state);
+ }
-public class PipedConnection_Test {
static class Reader extends Thread {
PipedConnection _pipedConnection;
byte _theByte[];
@@ -150,38 +178,4 @@ public class PipedConnection_Test {
_quit = true;
}
}
-
- static public boolean test(Vector notpassed) throws Exception {
- System.err.println("Testing PipedConnection...");
-
- PipedConnection rightSide = new PipedConnection(new Object[0]);
- PipedConnection leftSide = new PipedConnection(new Object[]{rightSide});
-
- byte theByte[] = new byte[1];
-
- Reader reader = new Reader(rightSide, theByte);
- Writer writer = new Writer(leftSide, theByte, reader);
-
- reader.start();
- writer.start();
-
- Thread.sleep(2000);
-
- writer.term();
- writer.join();
-
- reader.join();
-
- boolean passed = writer._state && reader._state;
-
- System.err.println("PipedConnection - passed? " + passed + " transmitted:" + theByte[0]);
- if(!passed)
- notpassed.addElement("PipedConnection - passed? " + passed + " transmitted:" + theByte[0]);
-
- return passed;
- }
-
- static public void main(String argv[]) throws Exception {
- test(null);
- }
}