diff options
Diffstat (limited to 'dcevm')
-rw-r--r-- | dcevm/gosu-classredefiner-1.0.0.jar | bin | 0 -> 8477 bytes | |||
-rw-r--r-- | dcevm/src/test/java7/com/github/dcevm/test/management/AttachTest.java | 18 |
2 files changed, 18 insertions, 0 deletions
diff --git a/dcevm/gosu-classredefiner-1.0.0.jar b/dcevm/gosu-classredefiner-1.0.0.jar Binary files differnew file mode 100644 index 00000000..b2c7029a --- /dev/null +++ b/dcevm/gosu-classredefiner-1.0.0.jar diff --git a/dcevm/src/test/java7/com/github/dcevm/test/management/AttachTest.java b/dcevm/src/test/java7/com/github/dcevm/test/management/AttachTest.java new file mode 100644 index 00000000..e681f88e --- /dev/null +++ b/dcevm/src/test/java7/com/github/dcevm/test/management/AttachTest.java @@ -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(); + } +} |