Browse Source

Verify that JMX attach still works fine

tags/full-jdk7u79+4
Ivan Dubrov 9 years ago
parent
commit
31f5a79f50

BIN
dcevm/gosu-classredefiner-1.0.0.jar View File


+ 18
- 0
dcevm/src/test/java7/com/github/dcevm/test/management/AttachTest.java View File

@@ -0,0 +1,18 @@
package com.github.dcevm.test.management;

import com.sun.tools.attach.VirtualMachine;
import org.junit.Test;

import java.lang.management.ManagementFactory;

public class AttachTest {

@Test
public void attachToSelfIsOk() throws Exception {
String nameOfRunningVM = ManagementFactory.getRuntimeMXBean().getName();
int p = nameOfRunningVM.indexOf('@');
String pid = nameOfRunningVM.substring(0, p);
VirtualMachine vm = VirtualMachine.attach(pid);
vm.detach();
}
}

Loading…
Cancel
Save