2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 1427N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1427N/A * This code is free software; you can redistribute it and/or modify it 1427N/A * under the terms of the GNU General Public License version 2 only, as 1427N/A * published by the Free Software Foundation. 1427N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1427N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1427N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1427N/A * version 2 for more details (a copy is included in the LICENSE file that 1427N/A * You should have received a copy of the GNU General Public License version 1427N/A * 2 along with this work; if not, write to the Free Software Foundation, 1427N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 1427N/A /* requested to connecct to a specific address */ 1427N/A /* start server on local machine, default */ 1427N/A /* store the main thread so that the server can interrupt it, if necessary */ 1427N/A /* Expect two interest Ops */ 1427N/A "should only received one OP_CONNECT");
1427N/A "should not receive OP_READ before OP_CONNECT");
1427N/A "channels should be equal");
1427N/A "key should not be acceptable");
1427N/A "key should not be readable");
1427N/A "key should not be writable");
1427N/A /* now process the OP_CONNECT */ 1427N/A "selection key interest ops should contain OP_CONNECT");
1427N/A "selection key interest ops should not contain OP_CONNECT");
1427N/A "finishConnect should return true");
1427N/A "should receive one OP_CONNECT before OP_READ");
1427N/A "should not receive OP_READ before OP_CONNECT");
1427N/A "channels should be equal");
1427N/A "key should not be acceptable");
1427N/A "key should not be writable");
1427N/A "key should not be connectable");
1427N/A /* now process the OP_READ */ 1427N/A /* try with small buffer to see if native 1427N/A * implementation can handle this */ 1427N/A "Client should have received COMM_UP");
1427N/A /* dont close (or put anything on) the channel until 1427N/A * we check that the server's accepted channel also 1427N/A "channels should be equal");
1427N/A "key should not be acceptable");
1427N/A "key should not be writable");
1427N/A "key should not be connectable");
1427N/A /* block until we check if the client has received its COMM_UP*/ 1427N/A "Accepted channel should have received COMM_UP");
1427N/A //--------------------- Infrastructure ---------------------------