1 /*
2 * Copyright (c) 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 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 8078813
40 * @library /lib/testlibrary
41 * @library /java/security/modules
42 * @build CompilerUtils JarUtils
43 * @summary Test custom JAAS module with all possible modular option. The test
44 * includes different combination of JAAS client/login modules
45 * interaction with or without service description.
46 * @run testng JaasModularClientTest
47 */
48 public class JaasModularClientTest extends ModularTest {
49
50 private static final Path S_SRC = SRC.resolve("TestLoginModule.java");
51 private static final String S_PKG = "login";
52 private static final String S_JAR_NAME = S_PKG + JAR_EXTN;
53 private static final String S_DESCR_JAR_NAME = S_PKG + DESCRIPTOR
54 + JAR_EXTN;
55 private static final String MS_JAR_NAME = MODULAR + S_PKG + JAR_EXTN;
56 private static final String MS_DESCR_JAR_NAME = MODULAR + S_PKG + DESCRIPTOR
57 + JAR_EXTN;
58
59 private static final Path C_SRC = SRC.resolve("JaasClient.java");
60 private static final String C_PKG = "client";
61 private static final String C_JAR_NAME = C_PKG + JAR_EXTN;
62 private static final String MCN_JAR_NAME = MODULAR + C_PKG + "N" + JAR_EXTN;
|
1 /*
2 * Copyright (c) 2015, 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.testlibrary.ProcessTools;
34 import jdk.testlibrary.OutputAnalyzer;
35 import jdk.test.lib.compiler.CompilerUtils;
36 import org.testng.annotations.BeforeTest;
37
38 /**
39 * @test
40 * @bug 8078813
41 * @library /lib/testlibrary /test/lib
42 * @library /java/security/modules
43 * @build jdk.test.lib.compiler.CompilerUtils JarUtils
44 * @summary Test custom JAAS module with all possible modular option. The test
45 * includes different combination of JAAS client/login modules
46 * interaction with or without service description.
47 * @run testng JaasModularClientTest
48 */
49 public class JaasModularClientTest extends ModularTest {
50
51 private static final Path S_SRC = SRC.resolve("TestLoginModule.java");
52 private static final String S_PKG = "login";
53 private static final String S_JAR_NAME = S_PKG + JAR_EXTN;
54 private static final String S_DESCR_JAR_NAME = S_PKG + DESCRIPTOR
55 + JAR_EXTN;
56 private static final String MS_JAR_NAME = MODULAR + S_PKG + JAR_EXTN;
57 private static final String MS_DESCR_JAR_NAME = MODULAR + S_PKG + DESCRIPTOR
58 + JAR_EXTN;
59
60 private static final Path C_SRC = SRC.resolve("JaasClient.java");
61 private static final String C_PKG = "client";
62 private static final String C_JAR_NAME = C_PKG + JAR_EXTN;
63 private static final String MCN_JAR_NAME = MODULAR + C_PKG + "N" + JAR_EXTN;
|