1 /* |
1 /* |
2 * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
141 String name = rt.getName(); |
141 String name = rt.getName(); |
142 System.out.println("name = " + name); |
142 System.out.println("name = " + name); |
143 String vmid = name.substring(0, name.indexOf("@")); |
143 String vmid = name.substring(0, name.indexOf("@")); |
144 System.out.println("vmid = " + vmid); |
144 System.out.println("vmid = " + vmid); |
145 VirtualMachine vm = VirtualMachine.attach(vmid); |
145 VirtualMachine vm = VirtualMachine.attach(vmid); |
146 String agent = vm.getSystemProperties().getProperty("java.home") + |
146 Properties p = new Properties(); |
147 File.separator + "lib" + File.separator + "management-agent.jar"; |
147 p.put("com.sun.management.jmxremote.port", "0"); |
148 vm.loadAgent(agent, "com.sun.management.jmxremote.port=0,com.sun.management.jmxremote.authenticate=false,com.sun.management.jmxremote.ssl=false"); |
148 p.put("com.sun.management.jmxremote.authenticate", "false"); |
|
149 p.put("com.sun.management.jmxremote.ssl", "false"); |
|
150 vm.startManagementAgent(p); |
|
151 vm.startLocalManagementAgent(); |
149 vm.detach(); |
152 vm.detach(); |
150 String localAddress2 = ConnectorAddressLink.importFrom(0); |
153 String localAddress2 = ConnectorAddressLink.importFrom(0); |
151 if (localAddress2 == null) { |
154 if (localAddress2 == null) { |
152 System.out.println("Test FAILED! The OOTB management " + |
155 System.out.println("Test FAILED! The OOTB management " + |
153 "agent didn't publish the local connector."); |
156 "agent didn't publish the local connector."); |