1 /*
2 * Copyright (c) 2013, 2014, 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 */
25 import jdk.testlibrary.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 * @library /lib/testlibrary
43 * @bug 6228231
44 * @summary Test that RMI registry uses SSL.
45 * @build jdk.testlibrary.* RmiRegistrySslTestApp
46 * @run main/timeout=300 RmiRegistrySslTest
47 * @author Luis-Miguel Alventosa, Taras Ledkov
48 */
49 public class RmiRegistrySslTest {
50 private final String TEST_CLASS_PATH = System.getProperty("test.class.path");
51 private final String TEST_CLASSES = System.getProperty("test.classes");
52 private final String TEST_SRC = System.getProperty("test.src");
53 private final FileSystem FS = FileSystems.getDefault();
54
55 private final Path libDir = FS.getPath(TEST_CLASSES, "lib");
56 private final Path rmiRegistryTemplate = FS.getPath(TEST_SRC, "rmiregistry.properties");
57 private final Path rmiRegistrySslTemplate = FS.getPath(TEST_SRC, "rmiregistryssl.properties");
58 private final Path rmiRegistryFile = libDir.resolve("rmiregistry.properties");
59 private final Path rmiRegistrySslFile = libDir.resolve("rmiregistryssl.properties");
60 private final String className = "RmiRegistrySslTestApp";
61 private int failures = 0;
62 private int port = 4444;
63 private static int MAX_GET_FREE_PORT_TRIES = 10;
64 private Map<String, Object> model = new HashMap<>();
|
1 /*
2 * Copyright (c) 2013, 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 */
25 import jdk.testlibrary.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 * @library /lib/testlibrary
43 * @bug 6228231
44 * @summary Test that RMI registry uses SSL.
45 * @modules java.management
46 * @build jdk.testlibrary.* RmiRegistrySslTestApp
47 * @run main/timeout=300 RmiRegistrySslTest
48 * @author Luis-Miguel Alventosa, Taras Ledkov
49 */
50 public class RmiRegistrySslTest {
51 private final String TEST_CLASS_PATH = System.getProperty("test.class.path");
52 private final String TEST_CLASSES = System.getProperty("test.classes");
53 private final String TEST_SRC = System.getProperty("test.src");
54 private final FileSystem FS = FileSystems.getDefault();
55
56 private final Path libDir = FS.getPath(TEST_CLASSES, "lib");
57 private final Path rmiRegistryTemplate = FS.getPath(TEST_SRC, "rmiregistry.properties");
58 private final Path rmiRegistrySslTemplate = FS.getPath(TEST_SRC, "rmiregistryssl.properties");
59 private final Path rmiRegistryFile = libDir.resolve("rmiregistry.properties");
60 private final Path rmiRegistrySslFile = libDir.resolve("rmiregistryssl.properties");
61 private final String className = "RmiRegistrySslTestApp";
62 private int failures = 0;
63 private int port = 4444;
64 private static int MAX_GET_FREE_PORT_TRIES = 10;
65 private Map<String, Object> model = new HashMap<>();
|