diff options
author | Ivan Dubrov <idubrov@guidewire.com> | 2015-06-26 09:07:17 -0700 |
---|---|---|
committer | Ivan Dubrov <idubrov@guidewire.com> | 2015-06-26 09:07:17 -0700 |
commit | 31f5a79f5052e7d86486cce997a9dacb9430d1d1 (patch) | |
tree | 6d2cfc4f1dad235a4c599fe53f381ff593ad1ed8 /dcevm | |
parent | 3892c7b61a6e5869c4138b67d07c53f1ab2ce7ba (diff) | |
download | dcevm-31f5a79f5052e7d86486cce997a9dacb9430d1d1.tar.gz dcevm-31f5a79f5052e7d86486cce997a9dacb9430d1d1.zip |
Verify that JMX attach still works fine
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(); + } +} |