@Test public void testConnectThrowsNullPointerException1() throws Throwable { XMLChannel xMLChannel = new XMLChannel(); xMLChannel.setTimeout(-1); Socket socket = new Socket(Proxy.NO_PROXY); try { xMLChannel.connect(socket); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"java.net.InetAddress.getHostAddress()\" because the return value of \"java.net.Socket.getInetAddress()\" is null", ex.getMessage(), "ex.getMessage()"); } 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();  }