8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /* @test
25 * @bug 4313882 4981129
26 * @summary Unit test for datagram-socket-channel adaptors
27 * @library ..
28 */
29
30 import java.net.*;
31 import java.nio.channels.*;
32 import java.util.*;
33
34
35 public class AdaptDatagramSocket {
36
37 static java.io.PrintStream out = System.out;
38 static Random rand = new Random();
39
40 static String toString(DatagramPacket dp) {
41 return ("DatagramPacket[off=" + dp.getOffset()
42 + ", len=" + dp.getLength()
43 + "]");
44 }
45
46 static void test(DatagramSocket ds, InetSocketAddress dst,
47 boolean shouldTimeout)
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /* @test
25 * @bug 4313882 4981129
26 * @summary Unit test for datagram-socket-channel adaptors
27 * @library ..
28 * @key randomness
29 */
30
31 import java.net.*;
32 import java.nio.channels.*;
33 import java.util.*;
34
35
36 public class AdaptDatagramSocket {
37
38 static java.io.PrintStream out = System.out;
39 static Random rand = new Random();
40
41 static String toString(DatagramPacket dp) {
42 return ("DatagramPacket[off=" + dp.getOffset()
43 + ", len=" + dp.getLength()
44 + "]");
45 }
46
47 static void test(DatagramSocket ds, InetSocketAddress dst,
48 boolean shouldTimeout)
|