/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @bug 4183202
* @summary rmid and rmiregistry could allow alternate security manager
* @author Laird Dornin
*
* @library ../../testlibrary
* @build TestLibrary JavaVM RMID TestSecurityManager
*/
/**
* Ensure that a user is able to specify alternate security managers to
* be used in rmiregistry and rmid. Test specifies a security manager
* that throws a runtime exception in its checkListen method, this
* will cause rmiregistry and rmid to exit early because those
* utilities will be unable to export any remote objects; test fails
* if registry and rmid take too long to exit.
*/
private final int regPort;
// variable to hold registry and rmid children
// names of utilities
// children should exit in at least this time.
if (port <= 0) {
}
}
public void run() {
try {
" -Djava.security.manager=TestSecurityManager",
" -Djava.security.manager=TestSecurityManager",
} else {
" or " + ACTIVATION);
}
} catch (Exception e) {
TestLibrary.bomb(e);
}
}
/**
* Wait to make sure that the registry and rmid exit after
* their security manager is set.
*/
try {
"checkListen in child process");
utilityToStart + " to die");
// dont pollute other tests; increase the likelihood
// that rmid will go away if it did not exit already.
}
" took too long to die...");
} else {
" terminated on time");
}
} finally {
}
}
try {
// make sure the registry exits early.
// make sure rmid exits early
} catch (Exception e) {
TestLibrary.bomb(e);
} finally {
}
}
}