From 1d9d035f192ac58d99387695f93643f934ff6962 Mon Sep 17 00:00:00 2001 From: Stephane Gamard Date: Tue, 15 Jul 2014 22:10:49 +0200 Subject: [PATCH] Ignoring JVM level test --- .../java/org/sonar/process/ProcessWrapperTest.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server/sonar-process/src/test/java/org/sonar/process/ProcessWrapperTest.java b/server/sonar-process/src/test/java/org/sonar/process/ProcessWrapperTest.java index 557527e8ffe..9530b02646b 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/ProcessWrapperTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/ProcessWrapperTest.java @@ -1,9 +1,9 @@ package org.sonar.process; -import com.sun.tools.attach.VirtualMachine; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; +import sun.tools.jconsole.LocalVirtualMachine; import javax.management.MalformedObjectNameException; import java.io.IOException; @@ -29,7 +29,11 @@ public class ProcessWrapperTest { @Ignore("Not a good idea to assert on # of VMs") public void process_should_run() throws IOException, MalformedObjectNameException, InterruptedException { - int VMcount = VirtualMachine.list().size(); + LocalVirtualMachine.getAllVirtualMachines().size(); + int VMcount = LocalVirtualMachine.getAllVirtualMachines().size(); + + System.out.println("LocalVirtualMachine.getAllVirtualMachines() = " + LocalVirtualMachine.getAllVirtualMachines()); + RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); ProcessWrapper wrapper = wrapper = new ProcessWrapper(ProcessTest.TestProcess.class.getName(), Collections.EMPTY_MAP, "TEST", freePort, runtime.getClassPath()); @@ -37,10 +41,10 @@ public class ProcessWrapperTest { assertThat(wrapper).isNotNull(); assertThat(wrapper.isReady()).isTrue(); - assertThat(VirtualMachine.list().size()).isEqualTo(VMcount + 1); + assertThat(LocalVirtualMachine.getAllVirtualMachines().size()).isEqualTo(VMcount + 1); wrapper.stop(); - assertThat(VirtualMachine.list().size()).isEqualTo(VMcount); + assertThat(LocalVirtualMachine.getAllVirtualMachines().size()).isEqualTo(VMcount); } } \ No newline at end of file -- 2.39.5