1 /*
2 * Copyright (c) 2016, 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 import java.nio.file.Path;
25 import java.nio.file.Paths;
26 import java.util.LinkedHashMap;
27 import java.util.List;
28 import java.util.Map;
29 import java.util.Arrays;
30 import java.io.IOException;
31 import java.lang.module.ModuleDescriptor;
32 import java.util.ArrayList;
33 import jdk.testlibrary.ProcessTools;
34 import jdk.testlibrary.OutputAnalyzer;
35 import org.testng.annotations.BeforeTest;
36
37 /**
38 * @test
39 * @bug 8151654
40 * @library /lib/testlibrary
41 * @library /java/security/modules
42 * @build CompilerUtils JarUtils
43 * @summary Test custom JAAS callback handler with all possible modular option.
44 * @run testng JaasModularDefaultHandlerTest
45 */
46 public class JaasModularDefaultHandlerTest extends ModularTest {
47
48 private static final Path S_SRC = SRC.resolve("TestCallbackHandler.java");
49 private static final String MODULAR = "M";
50 private static final String S_PKG = "handler";
51 private static final String S_JAR_NAME = S_PKG + JAR_EXTN;
52 private static final String MS_JAR_NAME = MODULAR + S_PKG + JAR_EXTN;
53 private static final String HANDLER = S_PKG + ".TestCallbackHandler";
54
55 private static final Path C_SRC
56 = SRC.resolve("JaasClientWithDefaultHandler.java");
57 private static final Path CL_SRC = SRC.resolve("TestLoginModule.java");
58 private static final String C_PKG = "login";
59 private static final String C_JAR_NAME = C_PKG + JAR_EXTN;
60 private static final String MCN_JAR_NAME
61 = MODULAR + C_PKG + "NoMUse" + JAR_EXTN;
62 private static final String MC_JAR_NAME = MODULAR + C_PKG + JAR_EXTN;
|
1 /*
2 * Copyright (c) 2016, 2017, 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 import java.nio.file.Path;
25 import java.nio.file.Paths;
26 import java.util.LinkedHashMap;
27 import java.util.List;
28 import java.util.Map;
29 import java.util.Arrays;
30 import java.io.IOException;
31 import java.lang.module.ModuleDescriptor;
32 import java.util.ArrayList;
33 import jdk.test.lib.compiler.CompilerUtils;
34 import jdk.testlibrary.ProcessTools;
35 import jdk.testlibrary.OutputAnalyzer;
36 import org.testng.annotations.BeforeTest;
37
38 /**
39 * @test
40 * @bug 8151654
41 * @library /lib/testlibrary /test/lib
42 * @library /java/security/modules
43 * @build jdk.test.lib.compiler.CompilerUtils JarUtils
44 * @summary Test custom JAAS callback handler with all possible modular option.
45 * @run testng JaasModularDefaultHandlerTest
46 */
47 public class JaasModularDefaultHandlerTest extends ModularTest {
48
49 private static final Path S_SRC = SRC.resolve("TestCallbackHandler.java");
50 private static final String MODULAR = "M";
51 private static final String S_PKG = "handler";
52 private static final String S_JAR_NAME = S_PKG + JAR_EXTN;
53 private static final String MS_JAR_NAME = MODULAR + S_PKG + JAR_EXTN;
54 private static final String HANDLER = S_PKG + ".TestCallbackHandler";
55
56 private static final Path C_SRC
57 = SRC.resolve("JaasClientWithDefaultHandler.java");
58 private static final Path CL_SRC = SRC.resolve("TestLoginModule.java");
59 private static final String C_PKG = "login";
60 private static final String C_JAR_NAME = C_PKG + JAR_EXTN;
61 private static final String MCN_JAR_NAME
62 = MODULAR + C_PKG + "NoMUse" + JAR_EXTN;
63 private static final String MC_JAR_NAME = MODULAR + C_PKG + JAR_EXTN;
|