< prev index next >

test/java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java

Print this page




  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 6275081
  26  * @summary Rapidly alternating the number of remote objects exported
  27  * on an explicit port between zero and greater than zero (thus
  28  * causing the associated server socket to be created and closed
  29  * repeatedly) should not encounter substantial synchronous delays
  30  * because of the server socket accept loop's failure throttling
  31  * procedure (which sleeps 10 seconds after 10 rapid failures).
  32  * @author Peter Jones
  33  *
  34  * @library ../../testlibrary




  35  * @build TestLibrary
  36  * @run main/othervm RapidExportUnexport
  37  */
  38 
  39 import java.rmi.Remote;
  40 import java.rmi.server.UnicastRemoteObject;
  41 
  42 public class RapidExportUnexport {
  43     private static final int PORT = TestLibrary.getUnusedRandomPort();
  44     private static final int REPS = 100;
  45     private static final long TIMEOUT = 60000;
  46 
  47     public static void main(String[] args) throws Exception {
  48         System.err.println("\nRegression test for bug 6275081\n");
  49 
  50         Remote impl = new Remote() { };
  51         long start = System.currentTimeMillis();
  52         for (int i = 0; i < REPS; i++) {
  53             System.err.println(i);
  54             UnicastRemoteObject.exportObject(impl, PORT);


  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 6275081
  26  * @summary Rapidly alternating the number of remote objects exported
  27  * on an explicit port between zero and greater than zero (thus
  28  * causing the associated server socket to be created and closed
  29  * repeatedly) should not encounter substantial synchronous delays
  30  * because of the server socket accept loop's failure throttling
  31  * procedure (which sleeps 10 seconds after 10 rapid failures).
  32  * @author Peter Jones
  33  *
  34  * @library ../../testlibrary
  35  * @modules java.rmi/sun.rmi.registry
  36  *          java.rmi/sun.rmi.server
  37  *          java.rmi/sun.rmi.transport
  38  *          java.rmi/sun.rmi.transport.tcp
  39  * @build TestLibrary
  40  * @run main/othervm RapidExportUnexport
  41  */
  42 
  43 import java.rmi.Remote;
  44 import java.rmi.server.UnicastRemoteObject;
  45 
  46 public class RapidExportUnexport {
  47     private static final int PORT = TestLibrary.getUnusedRandomPort();
  48     private static final int REPS = 100;
  49     private static final long TIMEOUT = 60000;
  50 
  51     public static void main(String[] args) throws Exception {
  52         System.err.println("\nRegression test for bug 6275081\n");
  53 
  54         Remote impl = new Remote() { };
  55         long start = System.currentTimeMillis();
  56         for (int i = 0; i < REPS; i++) {
  57             System.err.println(i);
  58             UnicastRemoteObject.exportObject(impl, PORT);
< prev index next >