< prev index next >

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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2005, 2012, 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) 2005, 2016, 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.
*** 42,63 **** import java.rmi.Remote; import java.rmi.server.UnicastRemoteObject; public class RapidExportUnexport { - private static final int PORT = TestLibrary.getUnusedRandomPort(); private static final int REPS = 100; private static final long TIMEOUT = 60000; public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6275081\n"); Remote impl = new Remote() { }; long start = System.currentTimeMillis(); for (int i = 0; i < REPS; i++) { System.err.println(i); ! UnicastRemoteObject.exportObject(impl, PORT); UnicastRemoteObject.unexportObject(impl, true); Thread.sleep(1); // work around BindException (bug?) } long delta = System.currentTimeMillis() - start; System.err.println(REPS + " export/unexport operations took " + --- 42,62 ---- import java.rmi.Remote; import java.rmi.server.UnicastRemoteObject; public class RapidExportUnexport { private static final int REPS = 100; private static final long TIMEOUT = 60000; public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6275081\n"); Remote impl = new Remote() { }; long start = System.currentTimeMillis(); for (int i = 0; i < REPS; i++) { System.err.println(i); ! UnicastRemoteObject.exportObject(impl, 0); UnicastRemoteObject.unexportObject(impl, true); Thread.sleep(1); // work around BindException (bug?) } long delta = System.currentTimeMillis() - start; System.err.println(REPS + " export/unexport operations took " +
< prev index next >