test/sun/rmi/runtime/Log/checkLogging/CheckLogging.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2001, 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) 2001, 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.
*** 75,86 ****
*
* 3. Print directly to return value of RemoteServer.getLog(), verify
* logger output is non-null.
*/
public class CheckLogging {
! private static final String LOCATION =
! "rmi://localhost:" + TestLibrary.REGISTRY_PORT + "/";
private static final ByteArrayOutputStream clientCallOut =
new ByteArrayOutputStream();
private static final boolean usingOld =
Boolean.getBoolean("sun.rmi.log.useOld");
--- 75,87 ----
*
* 3. Print directly to return value of RemoteServer.getLog(), verify
* logger output is non-null.
*/
public class CheckLogging {
! private static int REGISTRY_PORT = -1;
! private static String LOCATION;
!
private static final ByteArrayOutputStream clientCallOut =
new ByteArrayOutputStream();
private static final boolean usingOld =
Boolean.getBoolean("sun.rmi.log.useOld");
*** 98,108 ****
/* use registry to generate client & server call log info */
private static Registry registry;
static {
try {
! registry = LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
} catch (Exception e) {
TestLibrary.bomb("could not create registry");
}
}
--- 99,111 ----
/* use registry to generate client & server call log info */
private static Registry registry;
static {
try {
! registry = TestLibrary.createRegistryOnUnusedPort();
! REGISTRY_PORT = TestLibrary.getRegistryPort(registry);
! LOCATION = "rmi://localhost:" + REGISTRY_PORT + "/";
} catch (Exception e) {
TestLibrary.bomb("could not create registry");
}
}