Browse Source

- Dirty exception handling for now.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271037 13f79535-47bb-0310-9956-ffa450edef68
master
Stephane Bailliez 23 years ago
parent
commit
75ecbdd337
2 changed files with 12 additions and 6 deletions
  1. +1
    -1
      proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/remote/Messenger.java
  2. +11
    -5
      proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/remote/Server.java

+ 1
- 1
proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/remote/Messenger.java View File

@@ -90,7 +90,7 @@ public class Messenger {
}
}

public TestRunEvent read() throws IOException {
public TestRunEvent read() throws Exception {
return (TestRunEvent)((ObjectInputStream)in).readObject();
}



+ 11
- 5
proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/remote/Server.java View File

@@ -125,15 +125,21 @@ public class Server {
public void cancel() {
if (isRunning()) {
TestRunEvent evt = new TestRunEvent(new Integer(-1), TestRunEvent.RUN_STOP);
messenger.writeEvent(evt);
try {
messenger.writeEvent(evt);
} catch (IOException e){
}
}
}

/** shutdown the server and any running client */
public void shutdown() {
if (messenger != null) {
messenger.close();
messenger = null;
try {
if (messenger != null) {
messenger.close();
messenger = null;
}
} catch (IOException e){
}
try {
if (client != null) {
@@ -165,7 +171,7 @@ public class Server {
while ( (evt = messenger.read()) != null ) {
dispatcher.dispatchEvent(evt);
}
} catch (IOException e) {
} catch (Exception e) {
//@fixme this stacktrace might be normal when closing
// the socket. So decompose the above in distinct steps
e.printStackTrace();


Loading…
Cancel
Save