JDWP: remove unecessary feature checks in tests

Removes checks about features both supported by ART and the RI (see
command VirtualMachine.CapabilitiesNew). These capabilities are:
* canWatchFieldModification
* canWatchFieldAccess
* canGetBytecodes
* canGetOwnedMonitorInfo
* canGetCurrentContendedMonitor
* canGetMonitorInfo
* canUseInstanceFilters
* canGetInstanceInfo
* canGetMonitorFrameInfo

For the other capabilites (not supported by both runtimes), adds
dedicated method in VmMirror class and updates tests to use them.

Bug: 17941560
Change-Id: Idf54eb41fa9557f0a4ec0b7a450d42dbd6564265
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/framework/jdwp/VmMirror.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/framework/jdwp/VmMirror.java
index 67c0aa0..5ea81e9 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/framework/jdwp/VmMirror.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/framework/jdwp/VmMirror.java
@@ -55,7 +55,7 @@
 public class VmMirror {
 
     /** Target VM Capabilities. */
-    public Capabilities targetVMCapabilities;
+    private Capabilities targetVMCapabilities;
 
     /** Transport used to sent and receive packets. */
     private TransportWrapper connection;
@@ -445,19 +445,84 @@
         return replyPacket;
     }
 
-    public boolean canWatchFieldModification() {
+    /**
+     * Indicates whether the capability <i>canRedefineClasses</i> is supported.
+     *
+     * @return true if supported, false otherwise.
+     */
+    public boolean canRedefineClasses() {
         capabilities();
-        return targetVMCapabilities.canWatchFieldModification;
+        return targetVMCapabilities.canRedefineClasses;
     }
 
-    public boolean canWatchFieldAccess() {
+    /**
+     * Indicates whether the capability <i>canPopFrames</i> is supported.
+     *
+     * @return true if supported, false otherwise.
+     */
+    public boolean canPopFrames() {
         capabilities();
-        return targetVMCapabilities.canWatchFieldAccess;
+        return targetVMCapabilities.canPopFrames;
     }
 
-    public boolean canUseInstanceFilters() {
+    /**
+     * Indicates whether the capability <i>canGetSourceDebugExtension</i> is supported.
+     *
+     * @return true if supported, false otherwise.
+     */
+    public boolean canGetSourceDebugExtension() {
         capabilities();
-        return targetVMCapabilities.canUseInstanceFilters;
+        return targetVMCapabilities.canGetSourceDebugExtension;
+    }
+
+    /**
+     * Indicates whether the capability <i>canRequestVMDeathEvent</i> is supported.
+     *
+     * @return true if supported, false otherwise.
+     */
+    public boolean canRequestVMDeathEvent() {
+        capabilities();
+        return targetVMCapabilities.canRequestVMDeathEvent;
+    }
+
+    /**
+     * Indicates whether the capability <i>canSetDefaultStratum</i> is supported.
+     *
+     * @return true if supported, false otherwise.
+     */
+    public boolean canSetDefaultStratum() {
+        capabilities();
+        return targetVMCapabilities.canSetDefaultStratum;
+    }
+
+    /**
+     * Indicates whether the capability <i>canUseSourceNameFilters</i> is supported.
+     *
+     * @return true if supported, false otherwise.
+     */
+    public boolean canUseSourceNameFilters() {
+        capabilities();
+        return targetVMCapabilities.canUseSourceNameFilters;
+    }
+
+    /**
+     * Indicates whether the capability <i>canGetConstantPool</i> is supported.
+     *
+     * @return true if supported, false otherwise.
+     */
+    public boolean canGetConstantPool() {
+        capabilities();
+        return targetVMCapabilities.canGetConstantPool;
+    }
+
+    /**
+     * Indicates whether the capability <i>canForceEarlyReturn</i> is supported.
+     *
+     * @return true if supported, false otherwise.
+     */
+    public boolean canForceEarlyReturn() {
+        capabilities();
+        return targetVMCapabilities.canForceEarlyReturn;
     }
 
     /**
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/CountModifierTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/CountModifierTest.java
index 3a3938e..c000e8b 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/CountModifierTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/CountModifierTest.java
@@ -185,11 +185,6 @@
 
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!canWatchFieldAccessCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
         EventBuilder builder = createFieldAccessEventBuilder(
                 JDWPConstants.TypeTag.CLASS, DEBUGGEE_SIGNATURE,
                 WATCHED_FIELD_NAME);
@@ -215,11 +210,6 @@
 
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!canWatchFieldModificationCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
         EventBuilder builder = createFieldModificationEventBuilder(
                 JDWPConstants.TypeTag.CLASS, DEBUGGEE_SIGNATURE,
                 WATCHED_FIELD_NAME);
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/InstanceOnlyModifierTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/InstanceOnlyModifierTest.java
index 9e299e0..f43fbd3 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/InstanceOnlyModifierTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/InstanceOnlyModifierTest.java
@@ -68,11 +68,6 @@
 
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!checkCanUseInstanceFilterCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
         byte typeTag = JDWPConstants.TypeTag.CLASS;
         Breakpoint breakpoint = new Breakpoint(TEST_CLASS_SIGNATURE,
                 METHOD_NAME, 0);
@@ -99,11 +94,6 @@
 
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!checkCanUseInstanceFilterCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
         EventBuilder builder = createMethodEntryEventBuilder(TEST_CLASS_NAME);
         testEventWithInstanceOnlyModifier(builder);
 
@@ -127,11 +117,6 @@
 
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!checkCanUseInstanceFilterCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
         EventBuilder builder = createMethodExitEventBuilder(TEST_CLASS_NAME);
         testEventWithInstanceOnlyModifier(builder);
 
@@ -157,11 +142,6 @@
 
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!checkCanUseInstanceFilterCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
         EventBuilder builder = createMethodExitWithReturnValueEventBuilder(TEST_CLASS_NAME);
         testEventWithInstanceOnlyModifier(builder);
 
@@ -184,11 +164,6 @@
 
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!checkCanUseInstanceFilterCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
         String exceptionClassSignature =
                 "Lorg/apache/harmony/jpda/tests/jdwp/EventModifiers/InstanceOnlyModifierDebuggee$TestException;";
         EventBuilder builder = createExceptionEventBuilder(exceptionClassSignature, true, false);
@@ -214,16 +189,6 @@
 
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!checkCanUseInstanceFilterCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
-        if (!canWatchFieldAccessCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
         EventBuilder builder = createFieldAccessEventBuilder(
                 JDWPConstants.TypeTag.CLASS, TEST_CLASS_SIGNATURE,
                 WATCHED_FIELD_NAME);
@@ -249,16 +214,6 @@
 
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!checkCanUseInstanceFilterCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
-        if (!canWatchFieldModificationCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
         EventBuilder builder = createFieldModificationEventBuilder(
                 JDWPConstants.TypeTag.CLASS, TEST_CLASS_SIGNATURE,
                 WATCHED_FIELD_NAME);
@@ -267,15 +222,6 @@
         logWriter.println("testFieldModification done");
     }
 
-    private boolean checkCanUseInstanceFilterCapability() {
-        logWriter.println("Checking canUseInstanceFilters capability");
-        boolean result = debuggeeWrapper.vmMirror.canUseInstanceFilters();
-        if (!result) {
-            logCapabilityWarning("canUseInstanceFilters");
-        }
-        return result;
-    }
-
     private long getInstanceObjectId() {
         Value fieldValue = getFieldValue(DEBUGGEE_SIGNATURE,
                 INSTANCE_FIELD_NAME);
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/JDWPEventModifierTestCase.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/JDWPEventModifierTestCase.java
index cb49cea..ae66ba1 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/JDWPEventModifierTestCase.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/JDWPEventModifierTestCase.java
@@ -252,38 +252,6 @@
     }
 
     /**
-     * Checks the VM supports the canWatchFieldAccess capability. If it does
-     * not, prints a warning in the console.
-     *
-     * @return true if the VM supports the canWatchFieldAccess capability, false
-     * otherwise.
-     */
-    protected boolean canWatchFieldAccessCapability() {
-        logWriter.println("Checking canWatchFieldAccess capability");
-        boolean result = debuggeeWrapper.vmMirror.canWatchFieldAccess();
-        if (!result) {
-            logCapabilityWarning("canWatchFieldAccess");
-        }
-        return result;
-    }
-
-    /**
-     * Checks the VM supports the canWatchFieldModification capability. If it
-     * does not, prints a warning in the console.
-     *
-     * @return true if the VM supports the canWatchFieldModification capability,
-     * false otherwise.
-     */
-    protected boolean canWatchFieldModificationCapability() {
-        logWriter.println("Checking canWatchFieldModification capability");
-        boolean result = debuggeeWrapper.vmMirror.canWatchFieldModification();
-        if (!result) {
-            logCapabilityWarning("canWatchFieldModification");
-        }
-        return result;
-    }
-
-    /**
      * Warns about an unsupported capability by printing a message in the
      * console.
      *
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/ThreadOnlyModifierTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/ThreadOnlyModifierTest.java
index b2752e1..7061bc1 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/ThreadOnlyModifierTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/ThreadOnlyModifierTest.java
@@ -208,11 +208,6 @@
 
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!canWatchFieldAccessCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
         EventBuilder builder = createFieldAccessEventBuilder(
                 JDWPConstants.TypeTag.CLASS, DEBUGGEE_SIGNATURE,
                 WATCHED_FIELD_NAME);
@@ -237,11 +232,6 @@
 
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!canWatchFieldModificationCapability()) {
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
         EventBuilder builder = createFieldModificationEventBuilder(
                 JDWPConstants.TypeTag.CLASS, DEBUGGEE_SIGNATURE,
                 WATCHED_FIELD_NAME);
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/ClassPrepareTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/ClassPrepareTest.java
index 0740b79..461ad55 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/ClassPrepareTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/ClassPrepareTest.java
@@ -82,8 +82,7 @@
      * expectedSourceNamePattern is used to assign the source name's pattern
      */
     public void testClassPrepareEventWithoutSourceDebugExtension(String expectedSourceNamePattern){
-        debuggeeWrapper.vmMirror.capabilities();
-        if (!debuggeeWrapper.vmMirror.targetVMCapabilities.canUseSourceNameFilters) {
+        if (!debuggeeWrapper.vmMirror.canUseSourceNameFilters()) {
             logWriter.println("##WARNING: this VM doesn't possess capability: canUseSourceNameFilters");
             return;
         }
@@ -145,8 +144,7 @@
      * expectedSourceNamePattern is used to assign the source name's pattern
      */
     private void testClassPrepareEventWithSourceDebugExtension(String expectedSourceNamePattern){
-        debuggeeWrapper.vmMirror.capabilities();
-        if (!debuggeeWrapper.vmMirror.targetVMCapabilities.canUseSourceNameFilters) {
+        if (!debuggeeWrapper.vmMirror.canUseSourceNameFilters()) {
             logWriter.println("##WARNING: this VM doesn't possess capability: canUseSourceNameFilters");
             return;
         }
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldAccessTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldAccessTest.java
index b833c85..bd6ef89 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldAccessTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldAccessTest.java
@@ -51,15 +51,6 @@
 
         logWriter.println("ExceptionTest started");
 
-        //check capability, relevant for this test
-        logWriter.println("=> Check capability: canWatchFieldAccess");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canWatchFieldAccess;
-        if (!isCapability) {
-            logWriter.println("##WARNING: this VM doesn't possess capability: canWatchFieldAccess");
-            return;
-        }
-
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
         String classSignature = "Lorg/apache/harmony/jpda/tests/jdwp/Events/FieldDebuggee;";
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldModification002Test.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldModification002Test.java
index 7fb3b23..a2cbea2 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldModification002Test.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldModification002Test.java
@@ -51,15 +51,6 @@
 
         logWriter.println("FieldModification002Test started");
 
-        //check capability, relevant for this test
-        logWriter.println("=> Check capability: canWatchFieldModification");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canWatchFieldModification;
-        if (!isCapability) {
-            logWriter.println("##WARNING: this VM doesn't possess capability: canWatchFieldModification");
-            return;
-        }
-
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
         String classSignature = "L" + getDebuggeeClassName().replace('.', '/') + ";";
 
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldModificationTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldModificationTest.java
index cc5b62a..a8a5dd0 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldModificationTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldModificationTest.java
@@ -51,15 +51,6 @@
 
         logWriter.println("FieldModificationTest started");
 
-        //check capability, relevant for this test
-        logWriter.println("=> Check capability: canWatchFieldModification");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canWatchFieldModification;
-        if (!isCapability) {
-            logWriter.println("##WARNING: this VM doesn't possess capability: canWatchFieldModification");
-            return;
-        }
-
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
         String classSignature = "Lorg/apache/harmony/jpda/tests/jdwp/Events/FieldDebuggee;";
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldWithLocationTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldWithLocationTest.java
index abdeda7..f047bc0 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldWithLocationTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/FieldWithLocationTest.java
@@ -112,12 +112,6 @@
                 DEBUGGEE_SIGNATURE, returnedExceptionSignature);
     }
 
-    private boolean supportFieldCapability(boolean modification) {
-        VmMirror mirror = debuggeeWrapper.vmMirror;
-        return modification ? mirror.canWatchFieldModification() :
-            mirror.canWatchFieldAccess();
-    }
-
     private static String getFieldCapabilityName(boolean modification) {
         return modification ? "canWatchFieldModification" :
             "canWatchFieldAccess";
@@ -133,11 +127,6 @@
         final String capabilityname = getFieldCapabilityName(modification);
 
         logWriter.println("Check capability " + capabilityname);
-        if (supportFieldCapability(modification)) {
-            runEventWithLocationTest(eventKind);
-        } else {
-            logWriter.println("##WARNING: this VM doesn't possess capability " +
-                    capabilityname);
-        }
+        runEventWithLocationTest(eventKind);
     }
 }
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/VMDeath002Test.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/VMDeath002Test.java
index 1ba7f10..f492d7b 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/VMDeath002Test.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Events/VMDeath002Test.java
@@ -63,9 +63,7 @@
 
         //check capability, relevant for this test
         logWriter.println("=> Check capability: canRequestVMDeathEvent");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canRequestVMDeathEvent;
-        if (!isCapability) {
+        if (!debuggeeWrapper.vmMirror.canRequestVMDeathEvent()) {
             logWriter.println("##WARNING: this VM doesn't possess capability: canRequestVMDeathEvent");
             return;
         }
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Method/BytecodesTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Method/BytecodesTest.java
index c64017e..0956a50 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Method/BytecodesTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Method/BytecodesTest.java
@@ -47,15 +47,6 @@
     public void testBytecodesTest001() throws UnsupportedEncodingException {
         logWriter.println("testBytecodesTest001 started");
 
-        //check capability, relevant for this test
-        logWriter.println("=> Check capability: canGetBytecodes");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetBytecodes;
-        if (!isCapability) {
-            logWriter.println("##WARNING: this VM doesn't possess capability: canGetBytecodes");
-            return;
-        }
-
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
         long classID = getClassIDBySignature("L"+getDebuggeeClassName().replace('.', '/')+";");
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Method/IsObsoleteTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Method/IsObsoleteTest.java
index b53ecc3..ee816db 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Method/IsObsoleteTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/Method/IsObsoleteTest.java
@@ -48,9 +48,7 @@
 
         //check capability, relevant for this test
         logWriter.println("=> Check, can VM redefine classes");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canRedefineClasses;
-        if (!isCapability) {
+        if (!debuggeeWrapper.vmMirror.canRedefineClasses()) {
             logWriter.println("##WARNING: this VM can't redefine classes");
             return;
         }
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/MultiSession/FieldAccessTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/MultiSession/FieldAccessTest.java
index 70fd345..158dd8a 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/MultiSession/FieldAccessTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/MultiSession/FieldAccessTest.java
@@ -52,15 +52,6 @@
 
         logWriter.println("==> testFieldAccess001 started");
 
-        //check capability, relevant for this test
-        logWriter.println("=> Check capability: canWatchFieldAccess");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canWatchFieldAccess;
-        if (!isCapability) {
-            logWriter.println("##WARNING: this VM doesn't possess capability: canWatchFieldAccess");
-            return;
-        }
-
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
         String classSignature = "Lorg/apache/harmony/jpda/tests/jdwp/MultiSession/FieldDebuggee;";
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/MultiSession/FieldModificationTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/MultiSession/FieldModificationTest.java
index 95b65c2..9b63b6d 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/MultiSession/FieldModificationTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/MultiSession/FieldModificationTest.java
@@ -53,15 +53,6 @@
 
         logWriter.println("==> testFieldModification001 started");
 
-        //check capability, relevant for this test
-        logWriter.println("=> Check capability: canWatchFieldModification");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canWatchFieldModification;
-        if (!isCapability) {
-            logWriter.println("##WARNING: this VM doesn't possess capability: canWatchFieldModification");
-            return;
-        }
-
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
         String classSignature = "Lorg/apache/harmony/jpda/tests/jdwp/MultiSession/FieldDebuggee;";
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ObjectReference/MonitorInfoTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ObjectReference/MonitorInfoTest.java
index 5e803e7..465240e 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ObjectReference/MonitorInfoTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ObjectReference/MonitorInfoTest.java
@@ -61,16 +61,6 @@
     public void testMonitorInfo001() {
         String thisTestName = "testMonitorInfo001";
 
-        //check capability, relevant for this test
-        logWriter.println("=> Check capability: canGetMonitorInfo");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetMonitorInfo;
-        if (!isCapability) {
-            logWriter.println("##WARNING: this VM doesn't possess capability: canGetMonitorInfo");
-            return;
-        }
-
-
         logWriter.println("==> " + thisTestName + " for " + thisCommandName + ": START...");
         String failMessage = "";
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ObjectReference/ReferringObjectsTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ObjectReference/ReferringObjectsTest.java
index 736b886..0d65bdf 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ObjectReference/ReferringObjectsTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ObjectReference/ReferringObjectsTest.java
@@ -48,15 +48,6 @@
         return "org.apache.harmony.jpda.tests.jdwp.ObjectReference.ReferringObjectsDebuggee";
     }
 
-    // ReferringObjects need canGetInstanceInfo VM capability support
-    private boolean isCapability() {
-        // check capability, relevant for this test
-        logWriter.println("=> Check capability: canGetInstanceInfo");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetInstanceInfo;
-        return isCapability;
-    }
-
     /**
      * This testcase exercises ObjectReference.ReferringObjects command.
      * <BR>The test starts ReferringObjectsDebuggee class, requests referree objectID,
@@ -100,12 +91,7 @@
      * command and checks that returned instances are equal to the expected referrer objects.
      */
     public void DoTestReferringObjects() {
-        String thisTestName = "testReferringObjects_Normal";
-
-        if (!isCapability()) {
-            logWriter.println("##WARNING: this VM dosn't possess capability: canGetInstanceInfo");
-            return;
-        }
+        String thisTestName = getName();
 
         logWriter.println("==> " + thisTestName + " for " + thisCommandName + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
@@ -198,11 +184,6 @@
     public void testReferringObjects_IllegalArgument() {
         String thisTestName = "testReferringObjects_IllegalArgument";
 
-        if (!isCapability()) {
-            logWriter.println("##WARNING: this VM dosn't possess capability: canGetInstanceInfo");
-            return;
-        }
-
         int maxReferrers = -1;
 
         logWriter.println("==> " + thisTestName + " for " + thisCommandName + ": START...");
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/ConstantPoolTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/ConstantPoolTest.java
index 0306604..f075906 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/ConstantPoolTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/ConstantPoolTest.java
@@ -61,11 +61,8 @@
 
         // Check capability, relevant for this test
         logWriter.println("=> Check capability: canGetConstantPool");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetConstantPool;
-        if (!isCapability) {
-            logWriter
-                    .println("##WARNING: this VM dosn't possess capability: canGetConstantPool");
+        if (!debuggeeWrapper.vmMirror.canGetConstantPool()) {
+            logWriter.println("##WARNING: this VM dosn't possess capability: canGetConstantPool");
             return;
         }
 
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/InstancesTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/InstancesTest.java
index 72fbb3d..79a4315 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/InstancesTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/InstancesTest.java
@@ -58,16 +58,6 @@
      * objects are expected ones.
      */
     private void runTestInstances() {
-        // check capability, relevant for this test
-        logWriter.println("=> Check capability: canGetInstanceInfo");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetInstanceInfo;
-        if (!isCapability) {
-            logWriter
-                    .println("##WARNING: this VM dosn't possess capability: canGetInstanceInfo");
-            return;
-        }
-
         logWriter.println("==> " + thisTestName + " for " + thisCommandName
                 + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
@@ -217,16 +207,6 @@
     public void testInstances_String() {
         String thisTestName = "testInstances_String";
 
-        // check capability, relevant for this test
-        logWriter.println("=> Check capability: canGetInstanceInfo");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetInstanceInfo;
-        if (!isCapability) {
-            logWriter
-                    .println("##WARNING: this VM dosn't possess capability: canGetInstanceInfo");
-            return;
-        }
-
         logWriter.println("==> " + thisTestName + " for " + thisCommandName
                 + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
@@ -277,16 +257,6 @@
     public void testInstances_Array() {
         String thisTestName = "testInstances_Array";
 
-        // check capability, relevant for this test
-        logWriter.println("=> Check capability: canGetInstanceInfo");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetInstanceInfo;
-        if (!isCapability) {
-            logWriter
-                    .println("##WARNING: this VM dosn't possess capability: canGetInstanceInfo");
-            return;
-        }
-
         logWriter.println("==> " + thisTestName + " for " + thisCommandName
                 + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/SourceDebugExtensionTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/SourceDebugExtensionTest.java
index d37000a..ab24efd 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/SourceDebugExtensionTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/SourceDebugExtensionTest.java
@@ -59,9 +59,7 @@
 
         //check capability, relevant for this test
         logWriter.println("=> Check capability: canGetSourceDebugExtension");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetSourceDebugExtension;
-        if (!isCapability) {
+        if (!debuggeeWrapper.vmMirror.canGetSourceDebugExtension()) {
             logWriter.println("##WARNING: this VM doesn't possess capability: canGetSourceDebugExtension");
             return;
         }
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/StackFrame/PopFrames002Test.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/StackFrame/PopFrames002Test.java
index 12728ba..8162cfb 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/StackFrame/PopFrames002Test.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/StackFrame/PopFrames002Test.java
@@ -68,9 +68,7 @@
 
         //check capability, relevant for this test
         logWriter.println("=> Check capability: canPopFrames");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canPopFrames;
-        if (!isCapability) {
+        if (!debuggeeWrapper.vmMirror.canPopFrames()) {
             logWriter.println("##WARNING: this VM doesn't possess capability: canPopFrames");
             return;
         }
@@ -194,9 +192,7 @@
 
         //check capability, relevant for this test
         logWriter.println("=> Check capability: canPopFrames");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canPopFrames;
-        if (!isCapability) {
+        if (!debuggeeWrapper.vmMirror.canPopFrames()) {
             logWriter.println("##WARNING: this VM doesn't possess capability: canPopFrames");
             return;
         }
@@ -291,9 +287,7 @@
 
         //check capability, relevant for this test
         logWriter.println("=> Check capability: canPopFrames");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canPopFrames;
-        if (!isCapability) {
+        if (!debuggeeWrapper.vmMirror.canPopFrames()) {
             logWriter.println("##WARNING: this VM doesn't possess capability: canPopFrames");
             return;
         }
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/StackFrame/PopFramesTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/StackFrame/PopFramesTest.java
index fae3d6e..16c94dc 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/StackFrame/PopFramesTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/StackFrame/PopFramesTest.java
@@ -59,9 +59,7 @@
 
         //check capability, relevant for this test
         logWriter.println("=> Check capability: canPopFrames");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canPopFrames;
-        if (!isCapability) {
+        if (!debuggeeWrapper.vmMirror.canPopFrames()) {
             logWriter.println("##WARNING: this VM doesn't possess capability: canPopFrames");
             return;
         }
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/CurrentContendedMonitorTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/CurrentContendedMonitorTest.java
index 2d04e3f..99388bd 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/CurrentContendedMonitorTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/CurrentContendedMonitorTest.java
@@ -57,21 +57,6 @@
     public void testCurrentContendedMonitor001() {
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        //check capability, relevant for this test
-        debuggeeWrapper.vmMirror.capabilities();
-        logWriter.println("=> Check capability: canGetMonitorInfo");
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetMonitorInfo;
-        if (!isCapability) {
-            logWriter.println("##WARNING: this VM doesn't possess capability: canGetMonitorInfo");
-            return;
-        }
-        logWriter.println("=> Check capability: canGetCurrentContendedMonitor");
-        isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetCurrentContendedMonitor;
-        if (!isCapability) {
-            logWriter.println("##WARNING: this VM doesn't possess capability: canGetCurrentContendedMonitor");
-            return;
-        }
-
         // getting ID of the tested thread
         logWriter.println
         ("==> testedThreadName = " + CurrentContendedMonitorDebuggee.TESTED_THREAD);
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn002Test.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn002Test.java
index 96ca7f5..8a90cce 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn002Test.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn002Test.java
@@ -38,15 +38,6 @@
         return "org.apache.harmony.jpda.tests.jdwp.ThreadReference.ForceEarlyReturnDebuggee";
     }
 
-    // ForceEarlyReturn needs canForceEarlyReturn VM capability support
-    private boolean isCapability() {
-        // check capability, relevant for this test
-        logWriter.println("=> Check capability: canForceEarlyReturn");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canForceEarlyReturn;
-        return isCapability;
-    }
-
     /**
      * This testcase exercises ThreadReference.ForceEarlyReturn command. <BR>
      * At first the test starts ForceEarlyReturnDebuggee and send it the thread
@@ -62,9 +53,9 @@
                 + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!isCapability()) {
-            logWriter
-                    .println("##WARNING: this VM dosn't possess capability:canForceEarlyReturn");
+        // ForceEarlyReturn needs canForceEarlyReturn VM capability support
+        if (!debuggeeWrapper.vmMirror.canForceEarlyReturn()) {
+            logWriter.println("##WARNING: this VM dosn't possess capability:canForceEarlyReturn");
             return;
         }
         // Tell debuggee to start a thread named THREAD_LONG
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn003Test.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn003Test.java
index c53f7d1..855e305 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn003Test.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn003Test.java
@@ -35,15 +35,6 @@
         return "org.apache.harmony.jpda.tests.jdwp.ThreadReference.ForceEarlyReturnDebuggee";
     }
 
-    // ForceEarlyReturn needs canForceEarlyReturn VM capability support
-    private boolean isCapability() {
-        // check capability, relevant for this test
-        logWriter.println("=> Check capability: canForceEarlyReturn");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canForceEarlyReturn;
-        return isCapability;
-    }
-
     /**
      * This testcase exercises ThreadReference.ForceEarlyReturn command. <BR>
      * At first the test starts ForceEarlyReturnDebuggee and send it the thread
@@ -59,9 +50,9 @@
                 + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!isCapability()) {
-            logWriter
-                    .println("##WARNING: this VM dosn't possess capability:canForceEarlyReturn");
+        // ForceEarlyReturn needs canForceEarlyReturn VM capability support
+        if (!debuggeeWrapper.vmMirror.canForceEarlyReturn()) {
+            logWriter.println("##WARNING: this VM dosn't possess capability:canForceEarlyReturn");
             return;
         }
         // Tell debuggee to start a thread named THREAD_FLOAT
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn004Test.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn004Test.java
index 4c282bf..a0a84d5 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn004Test.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn004Test.java
@@ -35,15 +35,6 @@
         return "org.apache.harmony.jpda.tests.jdwp.ThreadReference.ForceEarlyReturnDebuggee";
     }
 
-    // ForceEarlyReturn needs canForceEarlyReturn VM capability support
-    private boolean isCapability() {
-        // check capability, relevant for this test
-        logWriter.println("=> Check capability: canForceEarlyReturn");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canForceEarlyReturn;
-        return isCapability;
-    }
-
     /**
      * This testcase exercises ThreadReference.ForceEarlyReturn command. <BR>
      * At first the test starts ForceEarlyReturnDebuggee and send it the thread
@@ -59,9 +50,9 @@
                 + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!isCapability()) {
-            logWriter
-                    .println("##WARNING: this VM dosn't possess capability:canForceEarlyReturn");
+        // ForceEarlyReturn needs canForceEarlyReturn VM capability support
+        if (!debuggeeWrapper.vmMirror.canForceEarlyReturn()) {
+            logWriter.println("##WARNING: this VM dosn't possess capability:canForceEarlyReturn");
             return;
         }
         // Tell debuggee to start a thread named THREAD_DOUBLE
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn005Test.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn005Test.java
index cf70842..fd4933f 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn005Test.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn005Test.java
@@ -34,15 +34,6 @@
         return "org.apache.harmony.jpda.tests.jdwp.ThreadReference.ForceEarlyReturnDebuggee";
     }
 
-    // ForceEarlyReturn needs canForceEarlyReturn VM capability support
-    private boolean isCapability() {
-        // check capability, relevant for this test
-        logWriter.println("=> Check capability: canForceEarlyReturn");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canForceEarlyReturn;
-        return isCapability;
-    }
-
     /**
      * This testcase exercises ThreadReference.ForceEarlyReturn command. <BR>
      * At first the test starts ForceEarlyReturnDebuggee and send it the thread
@@ -58,9 +49,9 @@
                 + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!isCapability()) {
-            logWriter
-                    .println("##WARNING: this VM dosn't possess capability:canForceEarlyReturn");
+        // ForceEarlyReturn needs canForceEarlyReturn VM capability support
+        if (!debuggeeWrapper.vmMirror.canForceEarlyReturn()) {
+            logWriter.println("##WARNING: this VM dosn't possess capability:canForceEarlyReturn");
             return;
         }
 
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn006Test.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn006Test.java
index e75ceb7..82d5fb8 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn006Test.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturn006Test.java
@@ -36,15 +36,6 @@
         return "org.apache.harmony.jpda.tests.jdwp.ThreadReference.ForceEarlyReturnDebuggee";
     }
 
-    // ForceEarlyReturn needs canForceEarlyReturn VM capability support
-    private boolean isCapability() {
-        // check capability, relevant for this test
-        logWriter.println("=> Check capability: canForceEarlyReturn");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canForceEarlyReturn;
-        return isCapability;
-    }
-
     // Get the objectID of test thread
     private long getObjectID() {
         // Compose Instances command to get tested thread objectID
@@ -83,9 +74,9 @@
                 + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!isCapability()) {
-            logWriter
-                    .println("##WARNING: this VM dosn't possess capability:canForceEarlyReturn");
+        // ForceEarlyReturn needs canForceEarlyReturn VM capability support
+        if (!debuggeeWrapper.vmMirror.canForceEarlyReturn()) {
+            logWriter.println("##WARNING: this VM dosn't possess capability:canForceEarlyReturn");
             return;
         }
 
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturnTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturnTest.java
index a0d5647..d614c84 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturnTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/ForceEarlyReturnTest.java
@@ -57,15 +57,6 @@
         return "org.apache.harmony.jpda.tests.jdwp.ThreadReference.ForceEarlyReturnDebuggee";
     }
 
-    // ForceEarlyReturn needs canForceEarlyReturn VM capability support
-    private boolean isCapability() {
-        // check capability, relevant for this test
-        logWriter.println("=> Check capability: canForceEarlyReturn");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canForceEarlyReturn;
-        return isCapability;
-    }
-
     private String toString(Value value) {
 
         switch (value.getTag()) {
@@ -83,14 +74,14 @@
         return "";
     }
 
-    public void RunTestForceEarlyReturn() {
+    private void RunTestForceEarlyReturn() {
         logWriter.println("==> " + thisTestName + " for " + thisCommandName
                 + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!isCapability()) {
-            logWriter
-                    .println("##WARNING: this VM dosn't possess capability: canForceEarlyReturn");
+        // ForceEarlyReturn needs canForceEarlyReturn VM capability support
+        if (!debuggeeWrapper.vmMirror.canForceEarlyReturn()) {
+            logWriter.println("##WARNING: this VM dosn't possess capability: canForceEarlyReturn");
             return;
         }
         // Tell debuggee to start a thread
@@ -243,9 +234,9 @@
                 + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        if (!isCapability()) {
-            logWriter
-                    .println("##WARNING: this VM dosn't possess capability: canForceEarlyReturn");
+        // ForceEarlyReturn needs canForceEarlyReturn VM capability support
+        if (!debuggeeWrapper.vmMirror.canForceEarlyReturn()) {
+            logWriter.println("##WARNING: this VM dosn't possess capability: canForceEarlyReturn");
             return;
         }
         // Tell debuggee to start a thread
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/OwnedMonitorsStackDepthInfoTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/OwnedMonitorsStackDepthInfoTest.java
index 6f54259..23278df 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/OwnedMonitorsStackDepthInfoTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/OwnedMonitorsStackDepthInfoTest.java
@@ -37,15 +37,6 @@
         return "org.apache.harmony.jpda.tests.jdwp.ThreadReference.OwnedMonitorsStackDepthInfoDebuggee";
     }
 
-    // OwnedMonitorsStackDepthInfo needs canGetMonitorFrameInfo VM capability support
-    private boolean isCapability() {
-        // check capability, relevant for this test
-        logWriter.println("=> Check capability: canGetMonitorFrameInfo");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetMonitorFrameInfo;
-        return isCapability;
-    }
-
     private int jdwpGetFrameCount(long threadID) {
       CommandPacket packet = new CommandPacket(JDWPCommands.ThreadReferenceCommandSet.CommandSetID,
                                                JDWPCommands.ThreadReferenceCommandSet.FrameCountCommand);
@@ -75,11 +66,6 @@
         // Ensure we signal the debuggee to continue at the end of the test.
         finalSyncMessage = JPDADebuggeeSynchronizer.SGNL_CONTINUE;
 
-        if (!isCapability()) {
-            logWriter.println("##WARNING: this VM dosn't possess capability: canGetMonitorFrameInfo");
-            return;
-        }
-
         // Getting ID of the tested thread
         logWriter.println("==> testedThreadName = "
                 + OwnedMonitorsStackDepthInfoDebuggee.TESTED_THREAD);
@@ -163,12 +149,6 @@
         // Ensure we signal the debuggee to continue at the end of the test.
         finalSyncMessage = JPDADebuggeeSynchronizer.SGNL_CONTINUE;
 
-        if (!isCapability()) {
-            logWriter
-                    .println("##WARNING: this VM dosn't possess capability: OwnedMonitorsStackDepthInfo");
-            return;
-        }
-
         // Getting ID of the tested thread
         logWriter.println("==> testedThreadName = "
                 + OwnedMonitorsStackDepthInfoDebuggee.TESTED_THREAD);
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/OwnedMonitorsTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/OwnedMonitorsTest.java
index 5906e06..90f05ce 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/OwnedMonitorsTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ThreadReference/OwnedMonitorsTest.java
@@ -60,16 +60,6 @@
 
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
-        // checking capability relevant for this test
-        logWriter.println("==> Check capability: canGetOwnedMonitorInfo");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetOwnedMonitorInfo;
-        if (!isCapability) {
-            logWriter.println("##WARNING: this VM dosn't possess capability: canGetOwnedMonitorInfo");
-            synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
-            return;
-        }
-
         // getting ID of the tested thread
         logWriter.println("==> testedThreadName = " + OwnedMonitorsDebuggee.TESTED_THREAD);
         logWriter.println("==> Get testedThreadID...");
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/VirtualMachine/InstanceCountsTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/VirtualMachine/InstanceCountsTest.java
index e66a6a9..cc4ffe4 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/VirtualMachine/InstanceCountsTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/VirtualMachine/InstanceCountsTest.java
@@ -44,15 +44,6 @@
         return "org.apache.harmony.jpda.tests.jdwp.VirtualMachine.InstanceCountsDebuggee";
     }
 
-    // InstanceCounts need canGetInstanceInfo VM capability support
-    private boolean isCapability() {
-        // check capability, relevant for this test
-        logWriter.println("=> Check capability: canGetInstanceInfo");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetInstanceInfo;
-        return isCapability;
-    }
-
     /**
      * This testcase exercises VirtualMachine.InstanceCounts command.
      * <BR>The test starts InstanceCountsDebuggee class, requests referenceTypeId,
@@ -63,11 +54,6 @@
     public void testInstanceCounts_Normal() {
         String thisTestName = "testInstanceCounts_Normal";
 
-        if (!isCapability()) {
-            logWriter.println("##WARNING: this VM dosn't possess capability: canGetInstanceInfo");
-            return;
-        }
-
         logWriter.println("==> " + thisTestName + " for " + thisCommandName + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
@@ -151,11 +137,6 @@
     public void testInstanceCounts_IllegalArgument() {
         String thisTestName = "testInstanceCounts_IllegalArgument";
 
-        if (!isCapability()) {
-            logWriter.println("##WARNING: this VM dosn't possess capability: canGetInstanceInfo");
-            return;
-        }
-
         int refTypesCount = -1;
 
         logWriter.println("==> " + thisTestName + " for " + thisCommandName + ": START...");
@@ -198,11 +179,6 @@
     public void testInstanceCounts_Zero() {
         String thisTestName = "testInstanceCounts_Zero";
 
-        if (!isCapability()) {
-            logWriter.println("##WARNING: this VM dosn't possess capability: canGetInstanceInfo");
-            return;
-        }
-
         logWriter.println("==> " + thisTestName + " for " + thisCommandName + ": START...");
         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
 
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/VirtualMachine/RedefineClassesTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/VirtualMachine/RedefineClassesTest.java
index be27a00..957c71b 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/VirtualMachine/RedefineClassesTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/VirtualMachine/RedefineClassesTest.java
@@ -110,9 +110,7 @@
 
         //check capability, relevant for this test
         logWriter.println("=> Check capability: canRedefineClasses");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canRedefineClasses;
-        if (!isCapability) {
+        if (!debuggeeWrapper.vmMirror.canRedefineClasses()) {
             logWriter.println("##WARNING: this VM doesn't possess capability: canRedefineClasses");
             return;
         }
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/VirtualMachine/SetDefaultStratumTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/VirtualMachine/SetDefaultStratumTest.java
index 628215e..723ff05 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/VirtualMachine/SetDefaultStratumTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/VirtualMachine/SetDefaultStratumTest.java
@@ -59,9 +59,7 @@
 
         //check capability, relevant for this test
         logWriter.println("=> Check capability: canSetDefaultStratum");
-        debuggeeWrapper.vmMirror.capabilities();
-        boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canSetDefaultStratum;
-        if (!isCapability) {
+        if (!debuggeeWrapper.vmMirror.canSetDefaultStratum()) {
             logWriter.println("##WARNING: this VM dosn't possess capability: canSetDefaultStratum");
             return;
         }