< prev index next >
test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/StateTest.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 40,49 ****
--- 40,51 ----
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
+ import jdk.test.lib.Utils;
+
public class StateTest {
private static int failures = 0;
private static String TEST_SERVICE = "StateTestService";
*** 64,74 ****
/*
* Wait for service to connect
*/
ssc.configureBlocking(false);
sk = ssc.register(sel, SelectionKey.OP_ACCEPT);
! long to = 15*1000;
sc = null;
for (;;) {
long st = System.currentTimeMillis();
sel.select(to);
if (sk.isAcceptable() && ((sc = ssc.accept()) != null)) {
--- 66,76 ----
/*
* Wait for service to connect
*/
ssc.configureBlocking(false);
sk = ssc.register(sel, SelectionKey.OP_ACCEPT);
! long to = Utils.adjustTimeout(15*1000);
sc = null;
for (;;) {
long st = System.currentTimeMillis();
sel.select(to);
if (sk.isAcceptable() && ((sc = ssc.accept()) != null)) {
*** 87,97 ****
/*
* Wait for service to report test result
*/
sc.configureBlocking(false);
sk = sc.register(sel, SelectionKey.OP_READ);
! to = 5000;
ByteBuffer bb = ByteBuffer.allocateDirect(20);
for (;;) {
long st = System.currentTimeMillis();
sel.select(to);
if (sk.isReadable()) {
--- 89,99 ----
/*
* Wait for service to report test result
*/
sc.configureBlocking(false);
sk = sc.register(sel, SelectionKey.OP_READ);
! to = Utils.adjustTimeout(5000);
ByteBuffer bb = ByteBuffer.allocateDirect(20);
for (;;) {
long st = System.currentTimeMillis();
sel.select(to);
if (sk.isReadable()) {
< prev index next >