KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > drftpd > tests > DummySocket


1 /*
2  * This file is part of DrFTPD, Distributed FTP Daemon.
3  *
4  * DrFTPD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * DrFTPD is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with DrFTPD; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package org.drftpd.tests;
19
20 import java.io.ByteArrayOutputStream JavaDoc;
21 import java.io.IOException JavaDoc;
22 import java.io.InputStream JavaDoc;
23 import java.io.OutputStream JavaDoc;
24 import java.net.InetAddress JavaDoc;
25 import java.net.Socket JavaDoc;
26 import java.net.SocketAddress JavaDoc;
27 import java.net.SocketException JavaDoc;
28 import java.net.SocketImpl JavaDoc;
29 import java.net.UnknownHostException JavaDoc;
30 import java.nio.channels.SocketChannel JavaDoc;
31
32 /**
33  * @author mog
34  * @version $Id: DummySocket.java,v 1.1 2004/05/16 18:07:31 mog Exp $
35  */

36 public class DummySocket extends Socket JavaDoc {
37
38     private ByteArrayOutputStream JavaDoc _out = new ByteArrayOutputStream JavaDoc();
39     public ByteArrayOutputStream JavaDoc getByteArrayOutputStream() {
40         return _out;
41     }
42     public DummySocket() {
43     }
44
45     public DummySocket(SocketImpl JavaDoc impl) throws SocketException JavaDoc {
46         throw new UnsupportedOperationException JavaDoc();
47     }
48
49     public DummySocket(String JavaDoc host, int port)
50         throws UnknownHostException JavaDoc, IOException JavaDoc {
51             throw new UnsupportedOperationException JavaDoc();
52     }
53
54     public DummySocket(InetAddress JavaDoc address, int port) throws IOException JavaDoc {
55         throw new UnsupportedOperationException JavaDoc();
56     }
57
58     public DummySocket(
59         String JavaDoc host,
60         int port,
61         InetAddress JavaDoc localAddr,
62         int localPort)
63         throws IOException JavaDoc {
64             throw new UnsupportedOperationException JavaDoc();
65     }
66
67     public DummySocket(
68         InetAddress JavaDoc address,
69         int port,
70         InetAddress JavaDoc localAddr,
71         int localPort)
72         throws IOException JavaDoc {
73             throw new UnsupportedOperationException JavaDoc();
74     }
75
76     public DummySocket(String JavaDoc host, int port, boolean stream)
77         throws IOException JavaDoc {
78             throw new UnsupportedOperationException JavaDoc();
79     }
80
81     public DummySocket(InetAddress JavaDoc host, int port, boolean stream)
82         throws IOException JavaDoc {
83             throw new UnsupportedOperationException JavaDoc();
84     }
85
86     /**
87      *
88      */

89
90     public void bind(SocketAddress JavaDoc bindpoint) throws IOException JavaDoc {
91         throw new UnsupportedOperationException JavaDoc();
92             }
93
94     public synchronized void close() throws IOException JavaDoc {
95             }
96
97     /**
98      *
99      */

100
101     public void connect(SocketAddress JavaDoc endpoint, int timeout)
102         throws IOException JavaDoc {
103         throw new UnsupportedOperationException JavaDoc();
104             }
105
106     public void connect(SocketAddress JavaDoc endpoint) throws IOException JavaDoc {
107             }
108
109     /**
110      *
111      */

112
113     public SocketChannel JavaDoc getChannel() {
114         throw new UnsupportedOperationException JavaDoc();
115             }
116
117
118     /**
119      *
120      */

121
122     public InetAddress JavaDoc getInetAddress() {
123         return getLocalAddress();
124             }
125
126     /**
127      *
128      */

129
130     public InputStream JavaDoc getInputStream() throws IOException JavaDoc {
131         throw new UnsupportedOperationException JavaDoc();
132             }
133
134     /**
135      *
136      */

137
138     public boolean getKeepAlive() throws SocketException JavaDoc {
139         throw new UnsupportedOperationException JavaDoc();
140             }
141
142     public InetAddress JavaDoc getLocalAddress() {
143             try {
144                 return InetAddress.getByName("127.0.0.1");
145             } catch (UnknownHostException JavaDoc e) {
146                 throw new RuntimeException JavaDoc(e);
147             }
148     }
149
150     /**
151      *
152      */

153
154     public int getLocalPort() {
155         throw new UnsupportedOperationException JavaDoc();
156             }
157
158     /**
159      *
160      */

161
162     public SocketAddress JavaDoc getLocalSocketAddress() {
163         throw new UnsupportedOperationException JavaDoc();
164             }
165
166     /**
167      *
168      */

169
170     public boolean getOOBInline() throws SocketException JavaDoc {
171         throw new UnsupportedOperationException JavaDoc();
172             }
173
174     /**
175      *
176      */

177
178     public OutputStream JavaDoc getOutputStream() throws IOException JavaDoc {
179         return _out;
180             }
181
182     /**
183      *
184      */

185
186     public int getPort() {
187         throw new UnsupportedOperationException JavaDoc();
188             }
189
190     /**
191      *
192      */

193
194     public synchronized int getReceiveBufferSize() throws SocketException JavaDoc {
195         throw new UnsupportedOperationException JavaDoc();
196         }
197
198     /**
199      *
200      */

201
202     public SocketAddress JavaDoc getRemoteSocketAddress() {
203         throw new UnsupportedOperationException JavaDoc();
204         }
205
206     /**
207      *
208      */

209
210     public boolean getReuseAddress() throws SocketException JavaDoc {
211         throw new UnsupportedOperationException JavaDoc();
212         }
213
214     /**
215      *
216      */

217
218     public synchronized int getSendBufferSize() throws SocketException JavaDoc {
219         throw new UnsupportedOperationException JavaDoc();
220             }
221
222     /**
223      *
224      */

225
226     public int getSoLinger() throws SocketException JavaDoc {
227         throw new UnsupportedOperationException JavaDoc();
228         }
229
230     /**
231      *
232      */

233
234     public synchronized int getSoTimeout() throws SocketException JavaDoc {
235         throw new UnsupportedOperationException JavaDoc();
236             }
237
238     /**
239      *
240      */

241
242     public boolean getTcpNoDelay() throws SocketException JavaDoc {
243         throw new UnsupportedOperationException JavaDoc();
244         }
245
246     /**
247      *
248      */

249
250     public int getTrafficClass() throws SocketException JavaDoc {
251         throw new UnsupportedOperationException JavaDoc();
252             }
253
254     /**
255      *
256      */

257
258     public boolean isBound() {
259         throw new UnsupportedOperationException JavaDoc();
260             }
261
262     /**
263      *
264      */

265
266     public boolean isClosed() {
267         throw new UnsupportedOperationException JavaDoc();
268             }
269
270     /**
271      *
272      */

273
274     public boolean isConnected() {
275         throw new UnsupportedOperationException JavaDoc();
276             }
277
278     /**
279      *
280      */

281
282     public boolean isInputShutdown() {
283         throw new UnsupportedOperationException JavaDoc();
284             }
285
286     /**
287      *
288      */

289
290     public boolean isOutputShutdown() {
291         throw new UnsupportedOperationException JavaDoc();
292             }
293
294     /**
295      *
296      */

297
298     public void sendUrgentData(int data) throws IOException JavaDoc {
299         throw new UnsupportedOperationException JavaDoc();
300             }
301
302
303     /**
304      *
305      */

306
307     public void setKeepAlive(boolean on) throws SocketException JavaDoc {
308         throw new UnsupportedOperationException JavaDoc();
309             }
310
311     /**
312      *
313      */

314
315     public void setOOBInline(boolean on) throws SocketException JavaDoc {
316         throw new UnsupportedOperationException JavaDoc();
317             }
318
319     /**
320      *
321      */

322
323     public synchronized void setReceiveBufferSize(int size)
324         throws SocketException JavaDoc {
325         throw new UnsupportedOperationException JavaDoc();
326             }
327
328     /**
329      *
330      */

331
332     public void setReuseAddress(boolean on) throws SocketException JavaDoc {
333         throw new UnsupportedOperationException JavaDoc();
334             }
335
336     /**
337      *
338      */

339
340     public synchronized void setSendBufferSize(int size)
341         throws SocketException JavaDoc {
342         throw new UnsupportedOperationException JavaDoc();
343             }
344
345     /**
346      *
347      */

348
349     public void setSoLinger(boolean on, int linger) throws SocketException JavaDoc {
350         throw new UnsupportedOperationException JavaDoc();
351             }
352
353     /**
354      *
355      */

356
357     public synchronized void setSoTimeout(int timeout) throws SocketException JavaDoc {
358             }
359
360     /**
361      *
362      */

363
364     public void setTcpNoDelay(boolean on) throws SocketException JavaDoc {
365         throw new UnsupportedOperationException JavaDoc();
366             }
367
368     /**
369      *
370      */

371
372     public void setTrafficClass(int tc) throws SocketException JavaDoc {
373         throw new UnsupportedOperationException JavaDoc();
374             }
375
376     /**
377      *
378      */

379
380     public void shutdownInput() throws IOException JavaDoc {
381         throw new UnsupportedOperationException JavaDoc();
382             }
383
384     /**
385      *
386      */

387
388     public void shutdownOutput() throws IOException JavaDoc {
389         throw new UnsupportedOperationException JavaDoc();
390             }
391
392 }
393
Popular Tags