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.lang.reflect.Method;
25 import java.util.HashMap;
26 import java.util.Map;
27 import javax.management.loading.MLet;
28 import org.testng.annotations.Test;
29 import org.testng.annotations.BeforeClass;
30 import org.testng.annotations.BeforeTest;
31
32 import static org.testng.Assert.*;
33
34 /*
35 * @test
36 * @bug 8058089
37 * @summary Tests various internal functions provided by MLet for correctness
38 * @author Jaroslav Bachorik
39 * @modules java.management/javax.management.loading:open
40 * @run testng MLetInternalsTest
41 */
42 public class MLetInternalsTest {
43 private final static String CONSTRUCT_PARAMETER = "constructParameter";
44
45 private final static Map<String, Method> testedMethods = new HashMap<>();
46
47 @BeforeClass
48 public static void setupClass() {
49 testedMethods.clear();
50 try {
51 Method m = MLet.class.getDeclaredMethod(
52 CONSTRUCT_PARAMETER,
53 String.class, String.class
54 );
55 m.setAccessible(true);
56
57 testedMethods.put(CONSTRUCT_PARAMETER, m);
58 } catch (Exception ex) {
59 throw new Error(ex);
|
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.lang.reflect.Method;
25 import java.util.HashMap;
26 import java.util.Map;
27 import javax.management.loading.MLet;
28 import org.testng.annotations.Test;
29 import org.testng.annotations.BeforeClass;
30 import org.testng.annotations.BeforeTest;
31
32 import static org.testng.Assert.*;
33
34 /*
35 * @test
36 * @bug 8058089
37 * @summary Tests various internal functions provided by MLet for correctness
38 * @author Jaroslav Bachorik
39 *
40 * @modules java.management/javax.management.loading:open
41 *
42 * @run testng MLetInternalsTest
43 */
44 public class MLetInternalsTest {
45 private final static String CONSTRUCT_PARAMETER = "constructParameter";
46
47 private final static Map<String, Method> testedMethods = new HashMap<>();
48
49 @BeforeClass
50 public static void setupClass() {
51 testedMethods.clear();
52 try {
53 Method m = MLet.class.getDeclaredMethod(
54 CONSTRUCT_PARAMETER,
55 String.class, String.class
56 );
57 m.setAccessible(true);
58
59 testedMethods.put(CONSTRUCT_PARAMETER, m);
60 } catch (Exception ex) {
61 throw new Error(ex);
|