01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package fitnesse.testutil;
04:
05: import java.net.Socket;
06: import fitnesse.testutil.MockSocket;
07: import fitnesse.responders.run.SocketDoner;
08:
09: public class SimpleSocketDoner implements SocketDoner {
10: public Socket socket;
11:
12: public boolean finished = false;
13:
14: public SimpleSocketDoner() {
15: socket = new MockSocket("SimpleSocketDoner");
16: }
17:
18: public SimpleSocketDoner(Socket socket) {
19: this .socket = socket;
20: }
21:
22: public Socket donateSocket() {
23: return socket;
24: }
25:
26: public void finishedWithSocket() throws Exception {
27: finished = true;
28: socket.close();
29: }
30: }
|