3261N/A * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 1096N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1096N/A * This code is free software; you can redistribute it and/or modify it 1096N/A * under the terms of the GNU General Public License version 2 only, as 1096N/A * published by the Free Software Foundation. 1096N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1096N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1096N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1096N/A * version 2 for more details (a copy is included in the LICENSE file that 1096N/A * You should have received a copy of the GNU General Public License version 1096N/A * 2 along with this work; if not, write to the Free Software Foundation, 1096N/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 1096N/A * @summary Tests the SCTP protocol implementation 1096N/A /* Latches used to synchronize between the client and server so that 1096N/A * connections without any IO may not be closed without being accepted */ 1096N/A /* requested to connecct to a specific address */ 1096N/A /* start server on local machine, default */ 1096N/A /* TEST 1: Verify NotYetConnectedException thrown */ 1096N/A fail(
"should have thrown NotYetConnectedException");
1096N/A /* TEST 2: send small message */ 1096N/A "buffers position should have been incremented by sent");
1096N/A /* TEST 3: send large message */ 1096N/A "buffers position should have been incremented by sent");
1096N/A /* TEST 4: InvalidStreamExcepton */ 1096N/A fail(
"should have thrown InvalidStreamExcepton");
1096N/A "remaining should not be changed");
1096N/A "buffers position should not be changed");
1096N/A /* TEST 5: Non blocking send should return zero if there is 1096N/A insufficient room in the underlying output buffer */ 1096N/A "remaining should not be changed");
1096N/A "buffers position should not be changed");
1096N/A /* TEST 6: ClosedChannelException */ 1096N/A fail(
"should have thrown ClosedChannelException");
1096N/A /* TEST 7: send without previous receive. 1096N/A * Verify that send can still throw InvalidStreamExcepton */ 1096N/A fail(
"should have thrown InvalidStreamExcepton");
1096N/A "remaining should not be changed");
1096N/A "buffers position should not be changed");
1096N/A /* TEST 8: Send to an invalid preferred SocketAddress */ 1096N/A fail(
"Invalid address should have thrown an Exception.");
2092N/A /* TEST 9: Send from heap buffer to force implementation to 2092N/A * substitute with a native buffer, then check that its position 2092N/A "buffers position should have been incremented by sent");
1096N/A /* receive a small message */ 1096N/A "message not sent on the correct stream");
1096N/A "received message not the same as sent message");
1096N/A /* receive a large message */ 1096N/A "message not sent on the correct stream");
1096N/A "received message not the same as sent message");
2092N/A "bytes received not equal to message length");
2092N/A "received message not the same as sent message");
1096N/A //--------------------- Infrastructure ---------------------------