< prev index next >

test/java/rmi/registry/reexport/Reexport.java

Print this page




   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 4120329
  26  * @summary RMI registry creation is impossible if first attempt fails.
  27  * @library ../../testlibrary




  28  * @build TestLibrary JavaVM RegistryRunner RegistryRunner_Stub
  29  * @run main/othervm Reexport
  30  */
  31 
  32 /*
  33  * If a VM could not create an RMI registry because another registry
  34  * usually in another process, was using the registry port, the next
  35  * time the VM tried to create a registry (after the other registry
  36  * was brought down) the attempt would fail.  The second try to create
  37  * a registry would fail because the registry ObjID would still be in
  38  * use when it should never have been allocated.
  39  *
  40  * The test creates this conflict using Runtime.exec and ensures that
  41  * a registry can still be created after the conflict is resolved.
  42  */
  43 
  44 import java.io.*;
  45 import java.rmi.*;
  46 import java.rmi.registry.*;
  47 import java.rmi.server.*;




   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 4120329
  26  * @summary RMI registry creation is impossible if first attempt fails.
  27  * @library ../../testlibrary
  28  * @modules java.rmi/sun.rmi.registry
  29  *          java.rmi/sun.rmi.server
  30  *          java.rmi/sun.rmi.transport
  31  *          java.rmi/sun.rmi.transport.tcp
  32  * @build TestLibrary JavaVM RegistryRunner RegistryRunner_Stub
  33  * @run main/othervm Reexport
  34  */
  35 
  36 /*
  37  * If a VM could not create an RMI registry because another registry
  38  * usually in another process, was using the registry port, the next
  39  * time the VM tried to create a registry (after the other registry
  40  * was brought down) the attempt would fail.  The second try to create
  41  * a registry would fail because the registry ObjID would still be in
  42  * use when it should never have been allocated.
  43  *
  44  * The test creates this conflict using Runtime.exec and ensures that
  45  * a registry can still be created after the conflict is resolved.
  46  */
  47 
  48 import java.io.*;
  49 import java.rmi.*;
  50 import java.rmi.registry.*;
  51 import java.rmi.server.*;


< prev index next >