1 /*
2 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
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 /*
25 * @test
26 * @bug 5021246
27 * @summary Check that class downloading is supported by RMI connector
28 * @author Eamonn McManus
29 * @run main RMIDownloadTest receive without
30 * @run main RMIDownloadTest send without
31 * @run main RMIDownloadTest receive with
32 * @run main RMIDownloadTest send with
33 */
34
35 /*
36 * This test checks that class downloading is supported by the RMI connector.
37 * We copy a precompiled class file into the temporary directory (which we
38 * assume is not in the classpath). We also create an instance of that
39 * class using a hardcoded ClassLoader. Then we try to get a remote attribute
40 * that returns that instance, and we try to set the remote attribute to the
41 * instance. In both cases, this will only work if the class can be downloaded
42 * based on the codebase that we have set to the temporary directory. We also
43 * test that it does *not* work when the codebase is not set, in case the test
44 * is succeeding for some other reason.
45 *
46 * We run the test four times, for each combination of (send, receive) x
47 * (with-codebase, without-codebase). Doing all four tests within the same
48 * run doesn't work, probably because RMI remembers the codebase property
|
1 /*
2 * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
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 /*
25 * @test
26 * @bug 5021246
27 * @summary Check that class downloading is supported by RMI connector
28 * @author Eamonn McManus
29 * @modules java.management
30 * @run main RMIDownloadTest receive without
31 * @run main RMIDownloadTest send without
32 * @run main RMIDownloadTest receive with
33 * @run main RMIDownloadTest send with
34 */
35
36 /*
37 * This test checks that class downloading is supported by the RMI connector.
38 * We copy a precompiled class file into the temporary directory (which we
39 * assume is not in the classpath). We also create an instance of that
40 * class using a hardcoded ClassLoader. Then we try to get a remote attribute
41 * that returns that instance, and we try to set the remote attribute to the
42 * instance. In both cases, this will only work if the class can be downloaded
43 * based on the codebase that we have set to the temporary directory. We also
44 * test that it does *not* work when the codebase is not set, in case the test
45 * is succeeding for some other reason.
46 *
47 * We run the test four times, for each combination of (send, receive) x
48 * (with-codebase, without-codebase). Doing all four tests within the same
49 * run doesn't work, probably because RMI remembers the codebase property
|