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 import jdk.test.lib.process.OutputAnalyzer;
25 import jdk.test.lib.process.ProcessTools;
26 import jdk.testlibrary.Utils;
27
28 import java.io.BufferedReader;
29 import java.io.BufferedWriter;
30 import java.io.IOException;
31 import java.net.BindException;
32 import java.nio.charset.Charset;
33 import java.nio.file.FileSystem;
34 import java.nio.file.FileSystems;
35 import java.nio.file.Files;
36 import java.nio.file.Path;
37 import java.util.*;
38 import java.util.regex.Pattern;
39
40 /**
41 * @test
42 * @bug 6228231
43 * @summary Test that RMI registry uses SSL.
44 * @author Luis-Miguel Alventosa, Taras Ledkov
45 *
46 * @library /lib/testlibrary
47 * @library /test/lib
48 *
49 * @build jdk.testlibrary.* RmiRegistrySslTestApp
50 * @run main/timeout=300 RmiRegistrySslTest
51 */
52 public class RmiRegistrySslTest {
53 private final String TEST_CLASS_PATH = System.getProperty("test.class.path");
54 private final String TEST_CLASSES = System.getProperty("test.classes");
55 private final String TEST_SRC = System.getProperty("test.src");
56 private final FileSystem FS = FileSystems.getDefault();
57
58 private final Path libDir = FS.getPath(TEST_CLASSES, "lib");
59 private final Path rmiRegistryTemplate = FS.getPath(TEST_SRC, "rmiregistry.properties");
60 private final Path rmiRegistrySslTemplate = FS.getPath(TEST_SRC, "rmiregistryssl.properties");
61 private final Path rmiRegistryFile = libDir.resolve("rmiregistry.properties");
62 private final Path rmiRegistrySslFile = libDir.resolve("rmiregistryssl.properties");
63 private final String className = "RmiRegistrySslTestApp";
64 private int failures = 0;
65 private int port = 4444;
66 private static int MAX_GET_FREE_PORT_TRIES = 10;
67 private Map<String, Object> model = new HashMap<>();
68
69 private RmiRegistrySslTest() {
|
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 import jdk.test.lib.process.OutputAnalyzer;
25 import jdk.test.lib.process.ProcessTools;
26 import jdk.test.lib.Utils;
27
28 import java.io.BufferedReader;
29 import java.io.BufferedWriter;
30 import java.io.IOException;
31 import java.net.BindException;
32 import java.nio.charset.Charset;
33 import java.nio.file.FileSystem;
34 import java.nio.file.FileSystems;
35 import java.nio.file.Files;
36 import java.nio.file.Path;
37 import java.util.*;
38 import java.util.regex.Pattern;
39
40 /**
41 * @test
42 * @bug 6228231
43 * @summary Test that RMI registry uses SSL.
44 * @author Luis-Miguel Alventosa, Taras Ledkov
45 *
46 * @library /test/lib
47 *
48 * @build RmiRegistrySslTestApp
49 * @run main/timeout=300 RmiRegistrySslTest
50 */
51 public class RmiRegistrySslTest {
52 private final String TEST_CLASS_PATH = System.getProperty("test.class.path");
53 private final String TEST_CLASSES = System.getProperty("test.classes");
54 private final String TEST_SRC = System.getProperty("test.src");
55 private final FileSystem FS = FileSystems.getDefault();
56
57 private final Path libDir = FS.getPath(TEST_CLASSES, "lib");
58 private final Path rmiRegistryTemplate = FS.getPath(TEST_SRC, "rmiregistry.properties");
59 private final Path rmiRegistrySslTemplate = FS.getPath(TEST_SRC, "rmiregistryssl.properties");
60 private final Path rmiRegistryFile = libDir.resolve("rmiregistry.properties");
61 private final Path rmiRegistrySslFile = libDir.resolve("rmiregistryssl.properties");
62 private final String className = "RmiRegistrySslTestApp";
63 private int failures = 0;
64 private int port = 4444;
65 private static int MAX_GET_FREE_PORT_TRIES = 10;
66 private Map<String, Object> model = new HashMap<>();
67
68 private RmiRegistrySslTest() {
|