@Test public void testConnectThrowsSocketException() throws Throwable { XMLChannel xMLChannel = new XMLChannel(); Socket socket = new Socket(Proxy.NO_PROXY); socket.close(); try { xMLChannel.connect(socket); fail("Expected SocketException to be thrown"); } catch (SocketException ex) { assertEquals(SocketException.class, ex.getClass(), "ex.getClass()"); assertNull(xMLChannel.getLogger(), "xMLChannel.getLogger()"); assertEquals("org.jpos.iso.channel.XMLChannel", xMLChannel.getOriginalRealm(), "xMLChannel.getOriginalRealm()"); assertNull(xMLChannel.reader, "xMLChannel.reader"); assertSame(socket, xMLChannel.getSocket(), "xMLChannel.getSocket()"); assertEquals(3, xMLChannel.getCounters().length, "xMLChannel.getCounters().length"); assertNull(xMLChannel.getRealm(), "xMLChannel.getRealm()"); assertFalse(xMLChannel.isConnected(), "xMLChannel.isConnected()"); assertNull(socket.getChannel(), "socket.getChannel()"); } }
protected void connect (Socket socket) throws IOException { super.connect (socket); reader = new BufferedReader (new InputStreamReader (serverIn)); }
XMLChannel extends BaseChannel { protected void connect (Socket socket) throws IOException { super.connect (socket); reader = new BufferedReader (new InputStreamReader (serverIn)); } }
XMLChannel extends BaseChannel { protected void connect (Socket socket) throws IOException { super.connect (socket); reader = new BufferedReader (new InputStreamReader (serverIn)); } XMLChannel();  XMLChannel(String host, int port, ISOPackager p);  XMLChannel(ISOPackager p);  XMLChannel(ISOPackager p, ServerSocket serverSocket); }
XMLChannel extends BaseChannel { protected void connect (Socket socket) throws IOException { super.connect (socket); reader = new BufferedReader (new InputStreamReader (serverIn)); } XMLChannel();  XMLChannel(String host, int port, ISOPackager p);  XMLChannel(ISOPackager p);  XMLChannel(ISOPackager p, ServerSocket serverSocket); void disconnect(); }
XMLChannel extends BaseChannel { protected void connect (Socket socket) throws IOException { super.connect (socket); reader = new BufferedReader (new InputStreamReader (serverIn)); } XMLChannel();  XMLChannel(String host, int port, ISOPackager p);  XMLChannel(ISOPackager p);  XMLChannel(ISOPackager p, ServerSocket serverSocket); void disconnect();  }