1 18 package org.drftpd.tests; 19 20 import java.io.IOException ; 21 import java.net.InetAddress ; 22 import java.net.Socket ; 23 import java.net.UnknownHostException ; 24 25 import javax.net.SocketFactory; 26 27 31 public class DummySocketFactory extends SocketFactory { 32 33 private DummySocket _socket = new DummySocket(); 34 35 public DummySocketFactory() { 36 } 37 38 public Socket createSocket(String arg0, int arg1) 39 throws IOException , UnknownHostException { 40 return createSocket(); } 41 42 public Socket createSocket( 43 String arg0, 44 int arg1, 45 InetAddress arg2, 46 int arg3) 47 throws IOException , UnknownHostException { 48 return createSocket(); } 49 50 public Socket createSocket(InetAddress arg0, int arg1) throws IOException { 51 return createSocket(); } 52 53 public Socket createSocket( 54 InetAddress arg0, 55 int arg1, 56 InetAddress arg2, 57 int arg3) 58 throws IOException { 59 return createSocket(); 60 } 61 62 public Socket createSocket() throws IOException { 63 return _socket; 64 } 65 66 public DummySocket getDummySocket() { 67 return _socket; 68 } 69 70 } 71 | Popular Tags |