harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r480141 [17/38] - in /harmony/enhanced/jdktools/trunk/modules/jpda: ./ doc/ doc/images/ make/ src/ src/common/ src/common/other/ src/common/other/jpda/ src/common/other/jpda/jdwp/ src/common/other/jpda/jdwp/agent/ src/common/other/jpda/jdwp...
Date Tue, 28 Nov 2006 17:49:31 GMT
Added: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/TestOptions.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/TestOptions.java?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/TestOptions.java (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/TestOptions.java Tue Nov 28 09:49:08 2006
@@ -0,0 +1,435 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Vitaly A. Provodin
+ * @version $Revision: 1.9.2.2 $
+ */
+
+/**
+ * Created on 26.01.2005
+ */
+package org.apache.harmony.jpda.tests.framework;
+
+import java.io.File;
+
+/**
+ * This class provides access to options for running JPDA tests.
+ * <p>
+ * The settings are presented as a set of getters and setters for test options,
+ * which can be implemented in different ways. In this implementation test
+ * options are implemented via VM system properties, which can be specified
+ * using option '-D' in VM command line.
+ * <p>
+ * The following options are currently recognized:
+ * <ul>
+ * <li><code>jpda.settings.debuggeeJavaHome</code>
+ *   - path to Java bundle to run debuggee on
+ * <li><code>jpda.settings.debuggeeJavaExec</code>
+ *   - name of Java executable to run debuggee on
+ * <li><code>jpda.settings.debuggeeJavaPath</code>
+ *   - full path to Java executable to run debuggee on
+ * <li><code>jpda.settings.debuggeeAgentName</code>
+ *   - name of agent native library
+ * <li><code>jpda.settings.debuggeeAgentExtraOptions</code>
+ *   - extra options for agent
+ * <li><code>jpda.settings.debuggeeClassName</code>
+ *   - full name of class to run debuggee with
+ * <li><code>jpda.settings.debuggeeVMExtraOptions</code>
+ *   - extra options to run debuggee with
+ * <li><code>jpda.settings.transportWrapperClass</code>
+ *   - class name of TransportWrapper implementation
+ * <li><code>jpda.settings.transportAddress</code>
+ *   - address for JDWP connection
+ * <li><code>jpda.settings.connectorKind</code>
+ *   - type of JDWP connection (attach or listen)
+ * <li><code>jpda.settings.syncPort</code>
+ *   - port number for sync connection
+ * <li><code>jpda.settings.timeout</code>
+ *   - timeout used in JPDA tests
+ * <li><code>jpda.settings.waitingTime</code>
+ *   - timeout for waiting events
+ * </ul>
+ * <li><code>jpda.settings.verbose</code>
+ *   - flag that disables (default) or enables writing messages to the log
+ * </ul>
+ * All options have default values, if they are not specified.
+ *  
+ */
+public class TestOptions {
+
+    /** Default timeout value for various operations. */
+    public static final int DEFAULT_TIMEOUT = 1 * 60 * 1000; // 1 minute
+
+    /** Default time interval for waiting for various events. */
+    public static final int DEFAULT_WAITING_TIME = DEFAULT_TIMEOUT;
+    
+    /** Default static address for transport connection. */
+    public static final String DEFAULT_ATTACHING_ADDRESS = "127.0.0.1:9898";
+
+    /** Default port number for sync connection. */
+    public static final int DEFAULT_SYNC_PORT = 0;
+
+    /** Default class name for transport wrapper. */
+    public static final String DEFAULT_TRANSPORT_WRAPPER 
+        = "org.apache.harmony.jpda.tests.framework.jdwp.SocketTransportWrapper";
+
+    // current waiting time value (negative means using default value)
+    private long waitingTime = -1;
+
+    // current timeout value (negative means using default value)
+    private long timeout = -1;
+
+    
+    /**
+     * Constructs an instance of this class.
+     */
+    public TestOptions() {
+        super();
+    }
+
+    /**
+     * Returns path to Java bundle to run debuggee on.
+     * 
+     * @return option "jpda.settings.debuggeeJavaHome" or system property
+     *         "java.home" by default.
+     */
+    public String getDebuggeeJavaHome() {
+        return System.getProperty("jpda.settings.debuggeeJavaHome", System
+                .getProperty("java.home"));
+    }
+
+    /**
+     * Returns name of Java executable to run debuggee on.
+     * 
+     * @return option "jpda.settings.debuggeeJavaExec" or "java" by default.
+     */
+    public String getDebuggeeJavaExec() {
+        return System.getProperty("jpda.settings.debuggeeJavaExec", "java");
+    }
+
+    /**
+     * Returns full path to Java executable to run debuggee on.
+     * 
+     * @return option "jpda.settings.debuggeeJavaPath" or construct path from
+     *         getDebuggeeJavaHome() and getDebuggeeJavaExec() by default.
+     */
+    public String getDebuggeeJavaPath() {
+        return System.getProperty("jpda.settings.debuggeeJavaPath",
+                getDebuggeeJavaHome() + "/bin/" + getDebuggeeJavaExec());
+    }
+
+    /**
+     * Returns class name of TransportWrapper implementation.
+     * 
+     * @return option "jpda.settings.transportWrapperClass" or
+     *         DEFAULT_TRANSPORT_WRAPPER by default.
+     */
+    public String getTransportWrapperClassName() {
+        return System.getProperty("jpda.settings.transportWrapperClass",
+                DEFAULT_TRANSPORT_WRAPPER);
+    }
+
+    /**
+     * Returns address for JDWP connection or null for dynamic address.
+     * 
+     * @return option "jpda.settings.transportAddress" or null by default.
+     */
+    public String getTransportAddress() {
+        return System.getProperty("jpda.settings.transportAddress", null);
+    }
+    
+    /**
+     * Sets address to attach to debuggee.
+     * 
+     * @param address to attach
+     */
+    public void setTransportAddress(String address) {
+        System.setProperty("jpda.settings.transportAddress", address);
+    }
+
+    /**
+     * Returns name of JDWP agent library.
+     * 
+     * @return option "jpda.settings.debuggeeAgentName" or "jdwp" by default
+     */
+    public String getDebuggeeAgentName() {
+        return System.getProperty("jpda.settings.debuggeeAgentName", "jdwp");
+    }
+
+    /**
+     * Returns string with extra options for agent.
+     * 
+     * @return option "jpda.settings.debuggeeAgentExtraOptions" or "" by default
+     */
+    public String getDebuggeeAgentExtraOptions() {
+        return System
+                .getProperty("jpda.settings.debuggeeAgentExtraOptions", "");
+    }
+
+    /**
+     * Returns string with all options for agent including specified connection
+     * address.
+     *  
+     * @param address - address to attach
+     * @param isDebuggerListen - true if debugger is listening for connection
+     * 
+     * @return string with all agent options
+     */
+    public String getDebuggeeAgentOptions(String address, boolean isDebuggerListen) {
+        String serv;
+        if (isDebuggerListen) {
+            serv = "n";
+        } else {
+            serv = "y";
+        }
+
+        return System.getProperty("jpda.settings.debuggeeAgentOptions",
+                "transport=dt_socket,address=" + address + ",server=" + serv
+                        + getDebuggeeAgentExtraOptions());
+    }
+
+    /**
+     * Returns string with all options for agent including specified connection
+     * address (only for debugger in listening mode). It just calls
+     * <ul>
+     * <li><code>getDebuggeeAgentOptions(address, true)</code></li>
+     * </ul>
+     *  
+     * @deprecated This method is used as workaround for old tests and will be removed soon. 
+     *  
+     * @param address - address to attach
+     * 
+     * @return string with all agent options
+     */
+    public String getDebuggeeAgentOptions(String address) {
+        return getDebuggeeAgentOptions(address, true);
+    }
+    
+    /**
+     * Returns VM classpath value to run debuggee with.
+     * 
+     * @return system property "java.class.path" by default.
+     */
+    public String getDebuggeeClassPath() {
+        return System.getProperty("java.class.path");
+    }
+
+    /**
+     * Returns full name of the class to start debuggee with.
+     * 
+     * @return option "jpda.settings.debuggeeClassName" or
+     *         "org.apache.harmony.jpda.tests.jdwp.share.debuggee.HelloWorld" by default
+     */
+    public String getDebuggeeClassName() {
+        return System.getProperty("jpda.settings.debuggeeClassName",
+                "org.apache.harmony.jpda.tests.jdwp.share.debuggee.HelloWorld");
+    }
+
+    /**
+     * Sets full name of the class to start debuggee with.
+     * 
+     * @param className
+     *            full class name
+     */
+    public void setDebuggeeClassName(String className) {
+        System.setProperty("jpda.settings.debuggeeClassName", className);
+    }
+
+    /**
+     * Returns string with extra options to start debuggee with.
+     * 
+     * @return option "jpda.settings.debuggeeVMExtraOptions" or "" by default
+     */
+    public String getDebuggeeVMExtraOptions() {
+        String extOpts = System.getProperty("jpda.settings.debuggeeVMExtraOptions", "");
+        extOpts = extOpts + " -Djpda.settings.verbose=" + isVerbose();
+        return extOpts;
+    }
+
+    /**
+     * Returns string representation of TCP/IP port for synchronization channel.
+     * 
+     * @return string with port number or null
+     */
+    public String getSyncPortString() {
+        return System.getProperty("jpda.settings.syncPort");
+    }
+
+    /**
+     * Returns type of connection with debuggee.
+     * 
+     * @return system property "jpda.settings.connectorKind" or "listen" by default.
+     */
+    public String getConnectorKind() {
+        return System.getProperty("jpda.settings.connectorKind", "listen");
+    }
+
+    /**
+     * Checks if attach connection with debuggee.
+     * 
+     * @return true, if attach connection, false otherwise.
+     */
+    public boolean isAttachConnectorKind() {
+        return ((getConnectorKind()).equals("attach"));
+
+    }
+
+    /**
+     * Checks if listen connection with debuggee.
+     * 
+     * @return true, if listen connection, false otherwise.
+     */
+    public boolean isListenConnectorKind() {
+        return (getConnectorKind().equals("listen"));
+    }
+
+    /**
+     * Sets connectorKind to attach to debuggee.
+     */
+    public void setAttachConnectorKind() {
+        setConnectorKind("attach");
+    }
+
+    /**
+     * Sets connectorKind to listen connection from debuggee.
+     */
+    public void setListenConnectorKind() {
+        setConnectorKind("listen");
+    }
+    
+    /**
+     * Sets kind of connector (attach or listen).
+     */
+    public void setConnectorKind(String kind) {
+        System.setProperty("jpda.settings.connectorKind", kind);
+    }
+
+    /**
+     * Returns kind of launching debuggee VM, which can be "auto" or "manual".
+     * 
+     * @return option "jpda.settings.debuggeeLaunchKind" or "auto" by default.
+     */
+    public String getDebuggeeLaunchKind() {
+        return System.getProperty("jpda.settings.debuggeeLaunchKind", "auto");
+    }
+
+    /**
+     * Returns TCP/IP port for synchronization channel.
+     * 
+     * @return string with port number or null
+     */
+    public int getSyncPortNumber() {
+        String buf = getSyncPortString();
+        if (buf == null) {
+            return DEFAULT_SYNC_PORT;
+        }
+
+        try {
+            return Integer.parseInt(buf);
+        } catch (NumberFormatException e) {
+            throw new TestErrorException(e);
+        }
+    }
+
+    /**
+     * Returns timeout for JPDA tests in milliseconds.
+     * 
+     * @return option "jpda.settings.timeout" or DEFAULT_TIMEOUT by default.
+     */
+    public long getTimeout() {
+        if (timeout < 0) {
+            timeout = DEFAULT_TIMEOUT;
+            String buf = System.getProperty("jpda.settings.timeout");
+            if (buf != null) {
+                try {
+                    timeout = Long.parseLong(buf);
+                } catch (NumberFormatException e) {
+                    throw new TestErrorException(e);
+                }
+            }
+        }
+        return timeout;
+    }
+
+    /**
+     * Sets timeout for JPDA tests in milliseconds.
+     * 
+     * @param timeout
+     *            timeout to be set
+     */
+    public void setTimeout(long timeout) {
+        if (timeout < 0) {
+            throw new TestErrorException("Cannot set negative timeout value: "
+                    + timeout);
+        }
+        this.timeout = timeout;
+    }
+
+    /**
+     * Returns waiting time for events in milliseconds.
+     * 
+     * @return waiting time
+     */
+    public long getWaitingTime() {
+        if (waitingTime < 0) {
+            waitingTime = DEFAULT_WAITING_TIME;
+            String buf = System.getProperty("jpda.settings.waitingTime");
+            if (buf != null) {
+                try {
+                    waitingTime = Long.parseLong(buf);
+                } catch (NumberFormatException e) {
+                    throw new TestErrorException(e);
+                }
+            }
+        }
+        return waitingTime;
+    }
+
+    /**
+     * Sets waiting time for events in milliseconds.
+     * 
+     * @param waitingTime
+     *            waiting time to be set
+     */
+    public void setWaitingTime(long waitingTime) {
+        this.waitingTime = waitingTime;
+    }
+    
+    /**
+     * Returns whether print to log is enabled.
+     * 
+     * @return false (default) if log is disabled or true otherwise.
+     */
+    public boolean isVerbose() {
+        return isTrue(System.getProperty("jpda.settings.verbose", "true"));
+    }
+
+    /**
+     * Converts text to boolean.
+     * 
+     * @param str string representing boolean value
+     * @return boolean
+     */
+    static public boolean isTrue(String str) {
+        return str != null && (
+            str.equalsIgnoreCase("true") ||
+            str.equalsIgnoreCase("yes") ||
+            str.equalsIgnoreCase("on") ||
+            str.equals("1"));
+    }
+}

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/TestOptions.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/ArrayRegion.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/ArrayRegion.java?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/ArrayRegion.java (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/ArrayRegion.java Tue Nov 28 09:49:08 2006
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Aleksey V. Yantsen
+ * @version $Revision: 1.2 $
+ */
+
+/**
+ * Created on 10.25.2004
+ */
+package org.apache.harmony.jpda.tests.framework.jdwp;
+
+public class ArrayRegion {
+    private byte    tag;
+    private int     length;
+    private Value[] values;
+
+    /**
+     * Constructor
+     */
+    public ArrayRegion(byte tag, int length) {
+        this.tag = tag;
+        this.length = length;
+        values = new Value[length];
+    }
+    
+    /**
+     * @param index Index of value to return
+     * @return Returns the value.
+     */
+    public Value getValue(int index) {
+        return values[index];
+    }
+
+    /**
+     * @param index Index of value
+     * @param value Value to set
+     */
+    public void setValue(int index, Value value) {
+        values[index] = value;
+    }
+
+    /**
+     * @return Returns the length.
+     */
+    public int getLength() {
+        return length;
+    }
+    /**
+     * @param length The length to set.
+     */
+    public void setLength(int length) {
+        this.length = length;
+    }
+    /**
+     * @return Returns the tag.
+     */
+    public byte getTag() {
+        return tag;
+    }
+    /**
+     * @param tag The tag to set.
+     */
+    public void setTag(byte tag) {
+        this.tag = tag;
+    }
+}
\ No newline at end of file

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/ArrayRegion.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Capabilities.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Capabilities.java?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Capabilities.java (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Capabilities.java Tue Nov 28 09:49:08 2006
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Aleksey V. Yantsen
+ * @version $Revision: 1.2 $
+ */
+
+/**
+ * Created on 12.01.2004
+ */
+package org.apache.harmony.jpda.tests.framework.jdwp;
+
+/**
+ * This class defines capabilities from JDWP specifications.
+ */
+public class Capabilities {
+    // Target VM Capabilities
+    public boolean canWatchFieldModification        = false;
+
+    public boolean canWatchFieldAccess              = false;
+
+    public boolean canGetBytecodes                  = false;
+
+    public boolean canGetSyntheticAttribute         = false;
+
+    public boolean canGetOwnedMonitorInfo           = false;
+
+    public boolean canGetCurrentContendedMonitor    = false;
+
+    public boolean canGetMonitorInfo                = false;
+
+    public boolean canRedefineClasses               = false;
+
+    public boolean canAddMethod                     = false;
+
+    public boolean canUnrestrictedlyRedefineClasses = false;
+
+    public boolean canPopFrames                     = false;
+
+    public boolean canUseInstanceFilters            = false;
+
+    public boolean canGetSourceDebugExtension       = false;
+
+    public boolean canRequestVMDeathEvent           = false;
+
+    public boolean canSetDefaultStratum             = false;
+
+    public boolean reserved16                       = false;
+
+    public boolean reserved17                       = false;
+
+    public boolean reserved18                       = false;
+
+    public boolean reserved19                       = false;
+
+    public boolean reserved20                       = false;
+
+    public boolean reserved21                       = false;
+
+    public boolean reserved22                       = false;
+
+    public boolean reserved23                       = false;
+
+    public boolean reserved24                       = false;
+
+    public boolean reserved25                       = false;
+
+    public boolean reserved26                       = false;
+
+    public boolean reserved27                       = false;
+
+    public boolean reserved28                       = false;
+
+    public boolean reserved29                       = false;
+
+    public boolean reserved30                       = false;
+
+    public boolean reserved31                       = false;
+
+    public boolean reserved32                       = false;
+}
\ No newline at end of file

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Capabilities.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/CommandPacket.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/CommandPacket.java?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/CommandPacket.java (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/CommandPacket.java Tue Nov 28 09:49:08 2006
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Khen G. Kim
+ * @version $Revision: 1.2 $
+ */
+
+/**
+ * Created on 10.01.2004
+ */
+package org.apache.harmony.jpda.tests.framework.jdwp;
+
+import org.apache.harmony.jpda.tests.framework.jdwp.Packet;
+
+/**
+ * This class represents JDWP command packet.
+ */
+public class CommandPacket extends Packet {
+    private final int COMMAND_SET_INDEX = 9;
+    private final int COMMAND_INDEX     = 10;
+
+    private byte      command_set;
+    private byte      command;
+
+    /**
+     * Creates an empty CommandPacket with empty header and no data.
+     */
+    public CommandPacket() {
+        super();
+    }
+
+    /**
+     * Creates an empty CommandPacket for specific JDWP command with no data.
+     */
+    public CommandPacket(byte commandSet, byte command) {
+        super();
+        this.command_set = commandSet;
+        this.command = command;
+    }
+
+    /**
+     * Creates CommandPacket from given array of bytes including header and data sections.
+     * 
+     * @param bytes_array the JDWP packet, given as array of bytes.
+     */
+    public CommandPacket(byte bytes_array[]) {
+        super(bytes_array);
+        command_set = bytes_array[COMMAND_SET_INDEX];
+        command = bytes_array[COMMAND_INDEX];
+    }
+
+    /**
+     * Sets command set value of the header of the CommandPacket as byte.
+     * 
+     * @param val the command set.
+     */
+    public void setCommandSet(byte val) {
+        command_set = val;
+    }
+
+    /**
+     * Gets command set value of the header of the CommandPacket as byte.
+     * 
+     * @return the command set value of the header of the CommandPacket as byte.
+     */
+    public byte getCommandSet() {
+        return command_set;
+    }
+
+    /**
+     * Sets command value of the header of the CommandPacket as byte.
+     * 
+     * @param val the command.
+     */
+    public void setCommand(byte val) {
+        command = val;
+    }
+
+    /**
+     * Sets command value of the header of the CommandPacket as byte.
+     * 
+     * @param commandSet number of the command set.
+     * @param command number of the command.
+     */
+    public void setCommand(byte commandSet, byte command) {
+        this.command_set = commandSet;
+        this.command = command;
+    }
+
+    /**
+     * Gets command value of the header of the CommandPacket as byte.
+     * 
+     * @return the command value of the header of the CommandPacket as byte.
+     */
+    public byte getCommand() {
+        return command;
+    }
+
+    /**
+     * Gets the representation of the CommandPacket as array of bytes in the
+     * JDWP format including header and data sections.
+     * 
+     * @return the representation of the CommandPacket as array of bytes in the
+     *         JDWP format.
+     */
+    public byte[] toBytesArray() {
+        byte res[] = super.toBytesArray();
+        res[COMMAND_SET_INDEX] = command_set;
+        res[COMMAND_INDEX] = command;
+        return res;
+    }
+
+}
\ No newline at end of file

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/CommandPacket.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Event.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Event.java?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Event.java (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Event.java Tue Nov 28 09:49:08 2006
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Aleksey V. Yantsen
+ * @version $Revision: 1.2 $
+ */
+
+/**
+ * Created on 11.29.2004
+ */
+package org.apache.harmony.jpda.tests.framework.jdwp;
+
+/**
+ * This class provides description of event request. 
+ */
+public class Event {
+
+    public byte eventKind;
+    public byte suspendPolicy;
+
+    /** List of event modifiers. */
+    public EventMod[] mods;
+    public int modifiers;
+
+    /**
+     * Creates new instance with empty data.
+     */
+    public Event() {
+        eventKind = 0;
+        suspendPolicy = 0;
+        modifiers = -1;
+        mods = null;
+    }
+
+    /**
+     * Create new instance with specified data.
+     */
+    public Event(byte eventKind, byte suspendPolicy, EventMod[] mods) {
+        this.eventKind = eventKind;
+        this.suspendPolicy = suspendPolicy;
+        this.modifiers = mods.length;
+        this.mods = mods;
+    }
+}

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Event.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/EventMod.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/EventMod.java?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/EventMod.java (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/EventMod.java Tue Nov 28 09:49:08 2006
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Aleksey V. Yantsen
+ * @version $Revision: 1.2 $
+ */
+
+/**
+ * Created on 11.29.2004
+ */
+package org.apache.harmony.jpda.tests.framework.jdwp;
+
+import org.apache.harmony.jpda.tests.framework.jdwp.Location;
+
+/**
+ * This class provides specific event modifiers for event request.
+ */
+public class EventMod {
+
+    public class ModKind {
+        public static final byte Count         = 1;
+
+        public static final byte Conditional   = 2;
+
+        public static final byte ThreadOnly    = 3;
+
+        public static final byte ClassOnly     = 4;
+
+        public static final byte ClassMatch    = 5;
+
+        public static final byte ClassExclude  = 6;
+
+        public static final byte LocationOnly  = 7;
+
+        public static final byte ExceptionOnly = 8;
+
+        public static final byte FieldOnly     = 9;
+
+        public static final byte Step          = 10;
+
+        public static final byte InstanceOnly  = 11;
+    }
+
+    public byte modKind;
+    public int  count;
+    public int  exprID;
+
+    // threadID
+    public long     thread;
+
+    // referenceTypeID
+    public long     clazz;
+
+    public String   classPattern;
+
+    public Location loc;
+
+    // referenceTypeID
+    public long     exceptionOrNull;
+
+    public boolean  caught;
+
+    public boolean  uncaught;
+
+    // referenceTypeID
+    public long     declaring;
+
+    // fieldID
+    public long     fieldID;
+
+    public int      size;
+
+    public int      depth;
+
+    // objectID
+    public long     instance;
+
+    /**
+     * Creates new instance with empty data.
+     */
+    public EventMod() {
+        modKind = 0;
+        count = -1;
+        exprID = -1;
+        // threadID
+        thread = -1;
+        // referenceTypeID
+        clazz = -1;
+        classPattern = new String();
+        loc = new Location();
+        // referenceTypeID
+        exceptionOrNull = -1;
+        caught = false;
+        uncaught = false;
+        // referenceTypeID
+        declaring = -1;
+        // fieldID
+        fieldID = -1;
+        size = -1;
+        depth = -1;
+        // objectID
+        instance = -1;
+    }
+}

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/EventMod.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/EventPacket.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/EventPacket.java?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/EventPacket.java (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/EventPacket.java Tue Nov 28 09:49:08 2006
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Anton V. Karnachuk
+ * @version $Revision: 1.2 $
+ */
+
+/**
+ * Created on 18.03.2005
+ */
+package org.apache.harmony.jpda.tests.framework.jdwp;
+
+/**
+ * This class represents JDWP event packet, which is special kind of command packet.
+ */
+public class EventPacket extends CommandPacket {
+    
+    /**
+     * Creates EventPacket from array of bytes including header and data sections.
+     * 
+     * @param p the JDWP packet, given as array of bytes.
+     */
+    public EventPacket(byte[] p) {
+        super(p);
+    }
+}

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/EventPacket.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Field.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Field.java?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Field.java (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Field.java Tue Nov 28 09:49:08 2006
@@ -0,0 +1,390 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Alexei S. Vaskin
+ * @version $Revision: 1.4 $
+ */
+
+/**
+ * Created on 03.05.2005 
+ */
+
+package org.apache.harmony.jpda.tests.framework.jdwp;
+
+/**
+ * This class provides description of class field.
+ * 
+ */
+public final class Field {
+
+    private long id;
+
+    private long classID;
+
+    private String name;
+
+    private String signature;
+
+    private int modBits;
+
+    private byte tag;
+
+    /**
+     * Default constructor.
+     */
+    public Field() {
+        id = -1;
+        classID = -1;
+        name = "unknown";
+        signature = "unknown";
+        modBits = -1;
+    }
+
+    /**
+     * Constructor initializing all members of the Field instance.
+     * 
+     * @param id
+     *            field id
+     * @param classID
+     *            class id
+     * @param name
+     *            field name
+     * @param signature
+     *            signature signature of the field class
+     * @param modBits
+     *            field modifiers
+     */
+    public Field(long id, long classID, String name, String signature,
+            int modBits) {
+        this.id = id;
+        this.classID = classID;
+        this.name = name;
+        this.modBits = modBits;
+        setSignature(signature);
+    }
+
+    /**
+     * Sets signature and detects type tag from it.
+     * 
+     * @param signature
+     *            signature of the field class
+     */
+    private void setSignature(String signature) {
+        switch (signature.charAt(0)) {
+        case '[':
+            tag = JDWPConstants.Tag.ARRAY_TAG;
+            break;
+        case 'B':
+            tag = JDWPConstants.Tag.BYTE_TAG;
+            break;
+        case 'C':
+            tag = JDWPConstants.Tag.CHAR_TAG;
+            break;
+        case 'L':
+            tag = JDWPConstants.Tag.OBJECT_TAG;
+            break;
+        case 'F':
+            tag = JDWPConstants.Tag.FLOAT_TAG;
+            break;
+        case 'D':
+            tag = JDWPConstants.Tag.DOUBLE_TAG;
+            break;
+        case 'I':
+            tag = JDWPConstants.Tag.INT_TAG;
+            break;
+        case 'J':
+            tag = JDWPConstants.Tag.LONG_TAG;
+            break;
+        case 'S':
+            tag = JDWPConstants.Tag.SHORT_TAG;
+            break;
+        case 'V':
+            tag = JDWPConstants.Tag.VOID_TAG;
+            break;
+        case 'Z':
+            tag = JDWPConstants.Tag.BOOLEAN_TAG;
+            break;
+        case 's':
+            tag = JDWPConstants.Tag.STRING_TAG;
+            break;
+        case 't':
+            tag = JDWPConstants.Tag.THREAD_TAG;
+            break;
+        case 'g':
+            tag = JDWPConstants.Tag.THREAD_GROUP_TAG;
+            break;
+        case 'l':
+            tag = JDWPConstants.Tag.CLASS_LOADER_TAG;
+            break;
+        case 'c':
+            tag = JDWPConstants.Tag.CLASS_OBJECT_TAG;
+            break;
+        }
+
+        this.signature = signature;
+    }
+
+    /**
+     * Gets field id.
+     * 
+     * @return long
+     */
+    public long getID() {
+        return this.id;
+    }
+
+    /**
+     * Gets id of the field reference type.
+     * 
+     * @return long
+     */
+    public long getClassID() {
+        return classID;
+    }
+
+    /**
+     * Gets field name.
+     * 
+     * @return String
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Gets signature of field type.
+     * 
+     * @return String
+     */
+    public String getSignature() {
+        return signature;
+    }
+
+    /**
+     * Gets field modifiers.
+     * 
+     * @return int
+     */
+    public int getModBits() {
+        return modBits;
+    }
+
+    /**
+     * Gets field java type.
+     * 
+     * @return String
+     */
+    public String getType() {
+        String type = "unknown type";
+        switch (tag) {
+        case JDWPConstants.Tag.ARRAY_TAG:
+            switch (signature.charAt(1)) {
+            case 'B':
+                type = "byte[]";
+                break;
+            case 'C':
+                type = "char[]";
+                break;
+            case 'J':
+                type = "long[]";
+                break;
+            case 'F':
+                type = "float[]";
+                break;
+            case 'D':
+                type = "double[]";
+                break;
+            case 'I':
+                type = "int[]";
+                break;
+            case 'S':
+                type = "short[]";
+                break;
+            case 'V':
+                type = "void[]";
+                break;
+            case 'Z':
+                type = "boolean[]";
+                break;
+            case 's':
+                type = "java.Lang.String[]";
+                break;
+            case 'L':
+                type = signature
+                        .substring(2, signature.length() - 1 /*
+                                                                 * skip ending
+                                                                 * ';'
+                                                                 */)
+                        .replaceAll("/", ".")
+                        + "[]"; // skip ending ';'
+                break;
+            }
+            break;
+        case JDWPConstants.Tag.OBJECT_TAG:
+            type = signature
+                    .substring(1, signature.length() - 1 /* skip ending ';' */)
+                    .replaceAll("/", "."); // skip ending ';'
+            break;
+        case JDWPConstants.Tag.BOOLEAN_TAG:
+            type = "boolean";
+            break;
+        case JDWPConstants.Tag.BYTE_TAG:
+            type = "byte";
+            break;
+        case JDWPConstants.Tag.CHAR_TAG:
+            type = "char";
+            break;
+        case JDWPConstants.Tag.DOUBLE_TAG:
+            type = "double";
+            break;
+        case JDWPConstants.Tag.FLOAT_TAG:
+            type = "float";
+            break;
+        case JDWPConstants.Tag.INT_TAG:
+            type = "int";
+            break;
+        case JDWPConstants.Tag.LONG_TAG:
+            type = "long";
+            break;
+        case JDWPConstants.Tag.SHORT_TAG:
+            type = "short";
+            break;
+        case JDWPConstants.Tag.STRING_TAG:
+            type = "string";
+            break;
+        default:
+            break;
+        }
+
+        return type;
+    }
+
+    /**
+     * Compares two Field objects.
+     * 
+     * @see java.lang.Object#equals(java.lang.Object)
+     * @return boolean
+     */
+    public boolean equals(Object obj) {
+        if (!(obj instanceof Field)) {
+            return false;
+        }
+
+        if (this.getClass() != obj.getClass()) {
+            return false;
+        }
+
+        Field field = (Field) obj;
+        return this.id == field.id && this.classID == field.classID
+                && this.name.equals(field.name)
+                && this.signature.equals(field.signature)
+                && this.modBits == field.modBits;
+    }
+
+    /**
+     * Converts Field object to String.
+     * 
+     * @see java.lang.Object#toString()
+     * @return String
+     */
+    public String toString() {
+        String str = "Field: id=" + id + ", classID=" + classID + ", name='"
+                + name + "', signature='" + signature + "', modBits=";
+        String access = "";
+        if ((this.modBits & JDWPConstants.FieldAccess.ACC_PRIVATE) == JDWPConstants.FieldAccess.ACC_PRIVATE) {
+            access += JDWPConstants.FieldAccess
+                    .getName(JDWPConstants.FieldAccess.ACC_PRIVATE)
+                    + " ";
+        } else if ((this.modBits & JDWPConstants.FieldAccess.ACC_PROTECTED) == JDWPConstants.FieldAccess.ACC_PROTECTED) {
+            access += JDWPConstants.FieldAccess
+                    .getName(JDWPConstants.FieldAccess.ACC_PROTECTED)
+                    + " ";
+        } else if ((this.modBits & JDWPConstants.FieldAccess.ACC_PUBLIC) == JDWPConstants.FieldAccess.ACC_PUBLIC) {
+            access += JDWPConstants.FieldAccess
+                    .getName(JDWPConstants.FieldAccess.ACC_PUBLIC)
+                    + " ";
+        }
+        if ((this.modBits & JDWPConstants.FieldAccess.ACC_FINAL) == JDWPConstants.FieldAccess.ACC_FINAL) {
+            access += JDWPConstants.FieldAccess
+                    .getName(JDWPConstants.FieldAccess.ACC_FINAL)
+                    + " ";
+        }
+        if ((this.modBits & JDWPConstants.FieldAccess.ACC_STATIC) == JDWPConstants.FieldAccess.ACC_STATIC) {
+            access += JDWPConstants.FieldAccess
+                    .getName(JDWPConstants.FieldAccess.ACC_STATIC)
+                    + " ";
+        }
+        if ((this.modBits & JDWPConstants.FieldAccess.ACC_TRANSIENT) == JDWPConstants.FieldAccess.ACC_TRANSIENT) {
+            access += JDWPConstants.FieldAccess
+                    .getName(JDWPConstants.FieldAccess.ACC_TRANSIENT)
+                    + " ";
+        }
+        if ((this.modBits & JDWPConstants.FieldAccess.ACC_VOLATILE) == JDWPConstants.FieldAccess.ACC_VOLATILE) {
+            access += JDWPConstants.FieldAccess
+                    .getName(JDWPConstants.FieldAccess.ACC_VOLATILE)
+                    + " ";
+        }
+
+        return str + access;
+    }
+
+    /**
+     * Tells whether this field is private.
+     * 
+     * @return boolean
+     */
+    public boolean isPrivate() {
+        return (modBits & JDWPConstants.FieldAccess.ACC_PRIVATE) == JDWPConstants.FieldAccess.ACC_PRIVATE;
+    }
+
+    /**
+     * Tells whether this field is protected.
+     * 
+     * @return boolean
+     */
+    public boolean isProtected() {
+        return (modBits & JDWPConstants.FieldAccess.ACC_PROTECTED) == JDWPConstants.FieldAccess.ACC_PROTECTED;
+    }
+
+    /**
+     * Tells whether this field is public.
+     * 
+     * @return boolean
+     */
+    public boolean isPublic() {
+        return (modBits & JDWPConstants.FieldAccess.ACC_PUBLIC) == JDWPConstants.FieldAccess.ACC_PUBLIC;
+    }
+
+    /**
+     * Tells whether this field is final.
+     * 
+     * @return boolean
+     */
+    public boolean isFinal() {
+        return (modBits & JDWPConstants.FieldAccess.ACC_FINAL) == JDWPConstants.FieldAccess.ACC_FINAL;
+    }
+
+    /**
+     * Tells whether this field is static.
+     * 
+     * @return boolean
+     */
+    public boolean isStatic() {
+        return (modBits & JDWPConstants.FieldAccess.ACC_STATIC) == JDWPConstants.FieldAccess.ACC_STATIC;
+    }
+}

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Field.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Frame.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Frame.java?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Frame.java (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Frame.java Tue Nov 28 09:49:08 2006
@@ -0,0 +1,516 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Alexei S. Vaskin
+ * @version $Revision: 1.6 $
+ */
+
+/**
+ * Created on 22.04.2005 
+ */
+
+package org.apache.harmony.jpda.tests.framework.jdwp;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * This class provides description of frame.
+ * 
+ */
+public class Frame {
+
+    protected long threadID;
+
+    protected Location loc;
+
+    protected long id;
+
+    protected ArrayList vars;
+
+    /**
+     * Default constructor.
+     */
+    public Frame() {
+        threadID = -1;
+        id = -1L;
+        loc = new Location();
+        vars = null;
+    }
+
+    /**
+     * Constructor initializing all members of the Frame instance.
+     * 
+     * @param threadID
+     *            thread id
+     * @param id
+     *            frame id
+     * @param location
+     *            frame location
+     * @param vars
+     *            list of variables
+     */
+    Frame(long threadID, long id, Location location, ArrayList vars) {
+        this.threadID = threadID;
+        this.id = id;
+        this.loc = location;
+        this.vars = vars;
+    }
+
+    /**
+     * Gets thread id.
+     * 
+     * @return long
+     */
+    public long getThreadID() {
+        return threadID;
+    }
+
+    /**
+     * Sets new thread id.
+     * 
+     * @param threadID
+     *            new thread id
+     */
+    public void setThreadID(long threadID) {
+        this.threadID = threadID;
+    }
+
+    /**
+     * Gets frame id.
+     * 
+     * @return long
+     */
+    public long getID() {
+        return id;
+    }
+
+    /**
+     * Sets new frame id.
+     * 
+     * @param id
+     *            new frame id
+     */
+    public void setID(long id) {
+        this.id = id;
+    }
+
+    /**
+     * Gets frame location.
+     * 
+     * @return Location
+     */
+    public Location getLocation() {
+        return loc;
+    }
+
+    /**
+     * Sets new frame location.
+     * 
+     * @param location
+     *            new frame location
+     */
+    public void setLocation(Location location) {
+        this.loc = location;
+    }
+
+    /**
+     * Gets frame variables.
+     * 
+     * @return list of frame variables
+     */
+    public ArrayList getVars() {
+        return vars;
+    }
+
+    /**
+     * Sets new frame variables.
+     * 
+     * @param vars
+     *            list of new frame variables
+     */
+    public void setVars(ArrayList vars) {
+        this.vars = vars;
+    }
+
+    /**
+     * Converts Frame object to String.
+     * 
+     * @see java.lang.Object#toString()
+     * @return String
+     */
+    public String toString() {
+        String string = "Frame: id=" + id + ", threadID=" + threadID
+                + ", location=" + loc.toString() + "\n";
+        string += "--- Variables ---";
+        Iterator it = vars.iterator();
+        while (it.hasNext()) {
+            string += ((Variable) it.next()).toString();
+        }
+        return string;
+    }
+
+    /**
+     * Compares two Frame objects.
+     * 
+     * @see java.lang.Object#equals(java.lang.Object)
+     * @return boolean
+     */
+    public boolean equals(Object obj) {
+        if (!(obj instanceof Frame)) {
+            return false;
+        }
+
+        if (this.getClass() != obj.getClass()) {
+            return false;
+        }
+
+        Frame frame = (Frame) obj;
+        if (this.threadID != frame.threadID || this.id != frame.id
+                || !(this.loc.equals(frame.loc))) {
+            return false;
+        }
+
+        if (vars.size() != frame.vars.size()) {
+            return false;
+        }
+
+        if (!vars.equals(frame.vars)) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * This describing frame variable.
+     * 
+     */
+    public final class Variable {
+        private long codeIndex;
+
+        private String name;
+
+        private String signature;
+
+        private int length;
+
+        private int slot;
+
+        private byte tag;
+
+        private String type;
+
+        /**
+         * Constructor.
+         * 
+         */
+        public Variable() {
+            codeIndex = -1;
+            name = "unknown";
+            signature = "unknown";
+            length = -1;
+            slot = -1;
+            tag = JDWPConstants.Tag.NO_TAG;
+            type = "unknown type";
+        }
+
+        /**
+         * Gets code index of variable.
+         * 
+         * @return long
+         */
+        public long getCodeIndex() {
+            return codeIndex;
+        }
+
+        /**
+         * Sets new code index for variable.
+         * 
+         * @param codeIndex
+         */
+        public void setCodeIndex(long codeIndex) {
+            this.codeIndex = codeIndex;
+        }
+
+        /**
+         * Gets variable name.
+         * 
+         * @return String
+         */
+        public String getName() {
+            return name;
+        }
+
+        /**
+         * Sets new variable name.
+         * 
+         * @param name
+         *            new variable name
+         */
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        /**
+         * Gets signature of the variable reference type.
+         * 
+         * @return String
+         */
+        public String getSignature() {
+            return signature;
+        }
+
+        /**
+         * Sets new signature and detects value of a type tag.
+         * 
+         * @param signature
+         */
+        public void setSignature(String signature) {
+            switch (signature.charAt(0)) {
+            case '[':
+                tag = JDWPConstants.Tag.ARRAY_TAG;
+                break;
+            case 'B':
+                tag = JDWPConstants.Tag.BYTE_TAG;
+                break;
+            case 'C':
+                tag = JDWPConstants.Tag.CHAR_TAG;
+                break;
+            case 'L':
+                tag = JDWPConstants.Tag.OBJECT_TAG;
+                break;
+            case 'F':
+                tag = JDWPConstants.Tag.FLOAT_TAG;
+                break;
+            case 'D':
+                tag = JDWPConstants.Tag.DOUBLE_TAG;
+                break;
+            case 'I':
+                tag = JDWPConstants.Tag.INT_TAG;
+                break;
+            case 'J':
+                tag = JDWPConstants.Tag.LONG_TAG;
+                break;
+            case 'S':
+                tag = JDWPConstants.Tag.SHORT_TAG;
+                break;
+            case 'V':
+                tag = JDWPConstants.Tag.VOID_TAG;
+                break;
+            case 'Z':
+                tag = JDWPConstants.Tag.BOOLEAN_TAG;
+                break;
+            case 's':
+                tag = JDWPConstants.Tag.STRING_TAG;
+                break;
+            case 't':
+                tag = JDWPConstants.Tag.THREAD_TAG;
+                break;
+            case 'g':
+                tag = JDWPConstants.Tag.THREAD_GROUP_TAG;
+                break;
+            case 'l':
+                tag = JDWPConstants.Tag.CLASS_LOADER_TAG;
+                break;
+            case 'c':
+                tag = JDWPConstants.Tag.CLASS_OBJECT_TAG;
+                break;
+            }
+
+            this.signature = signature;
+        }
+
+        /**
+         * Gets variable length.
+         * 
+         * @return int
+         */
+        public int getLength() {
+            return length;
+        }
+
+        /**
+         * Sets new variable length.
+         * 
+         * @param length
+         *            new variable length
+         */
+        public void setLength(int length) {
+            this.length = length;
+        }
+
+        /**
+         * Returns variable slot value.
+         * 
+         * @return int
+         */
+        public int getSlot() {
+            return slot;
+        }
+
+        /**
+         * Assigns new slot value.
+         * 
+         * @param slot
+         *            new slot value
+         */
+        public void setSlot(int slot) {
+            this.slot = slot;
+        }
+
+        /**
+         * Gets variable type tag value.
+         * 
+         * @return byte
+         */
+        public byte getTag() {
+            return tag;
+        }
+
+        /**
+         * Gets variable java type.
+         * 
+         * @return String
+         */
+        public String getType() {
+            switch (tag) {
+            case JDWPConstants.Tag.ARRAY_TAG:
+                switch (signature.charAt(1)) {
+                case 'B':
+                    type = "byte[]";
+                    break;
+                case 'C':
+                    type = "char[]";
+                    break;
+                case 'J':
+                    type = "long[]";
+                    break;
+                case 'F':
+                    type = "float[]";
+                    break;
+                case 'D':
+                    type = "double[]";
+                    break;
+                case 'I':
+                    type = "int[]";
+                    break;
+                case 'S':
+                    type = "short[]";
+                    break;
+                case 'V':
+                    type = "void[]";
+                    break;
+                case 'Z':
+                    type = "boolean[]";
+                    break;
+                case 's':
+                    type = "java.Lang.String[]";
+                    break;
+                case 'L':
+                    type = signature
+                            .substring(2, signature.length() - 1 /*
+                                                                     * skip
+                                                                     * ending
+                                                                     * ';'
+                                                                     */)
+                            .replaceAll("/", ".")
+                            + "[]"; // skip ending ';'
+                    break;
+                }
+                break;
+            case JDWPConstants.Tag.OBJECT_TAG:
+                type = signature
+                        .substring(1, signature.length() - 1 /*
+                                                                 * skip ending
+                                                                 * ';'
+                                                                 */)
+                        .replaceAll("/", "."); // skip ending ';'
+                break;
+            case JDWPConstants.Tag.BOOLEAN_TAG:
+                type = "boolean";
+                break;
+            case JDWPConstants.Tag.BYTE_TAG:
+                type = "byte";
+                break;
+            case JDWPConstants.Tag.CHAR_TAG:
+                type = "char";
+                break;
+            case JDWPConstants.Tag.DOUBLE_TAG:
+                type = "double";
+                break;
+            case JDWPConstants.Tag.FLOAT_TAG:
+                type = "float";
+                break;
+            case JDWPConstants.Tag.INT_TAG:
+                type = "int";
+                break;
+            case JDWPConstants.Tag.LONG_TAG:
+                type = "long";
+                break;
+            case JDWPConstants.Tag.SHORT_TAG:
+                type = "short";
+                break;
+            case JDWPConstants.Tag.STRING_TAG:
+                type = "string";
+                break;
+            default:
+                break;
+            }
+
+            return type;
+        }
+
+        /**
+         * Converts Variable object to String.
+         * 
+         * @see java.lang.Object#toString()
+         * @return String
+         */
+        public String toString() {
+            return "Variable: codeIndex=" + codeIndex + ", name=" + name
+                    + ", signature=" + signature + ", length=" + length
+                    + ", slot=" + slot + ", tag="
+                    + JDWPConstants.Tag.getName(tag) + ", type=" + type;
+        }
+
+        /**
+         * Compares two Variable objects.
+         * 
+         * @see java.lang.Object#equals(java.lang.Object)
+         * @return boolean
+         */
+        public boolean equals(Object obj) {
+            if (!(obj instanceof Variable)) {
+                return false;
+            }
+
+            if (this.getClass() != obj.getClass()) {
+                return false;
+            }
+
+            Variable var = (Variable) obj;
+            return this.codeIndex == var.codeIndex
+                    && this.name.equals(var.name)
+                    && this.signature.equals(var.signature)
+                    && this.length == var.length && this.slot == var.slot
+                    && this.tag == var.tag && this.type.equals(var.type);
+
+        }
+    }
+}

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/Frame.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/JDWPCommands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/JDWPCommands.java?view=auto&rev=480141
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/JDWPCommands.java (added)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/JDWPCommands.java Tue Nov 28 09:49:08 2006
@@ -0,0 +1,332 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Aleksey V. Yantsen
+ * @version $Revision: 1.3 $
+ */
+
+/**
+ * Created on 12.03.2004
+ */
+package org.apache.harmony.jpda.tests.framework.jdwp;
+
+/**
+ * This class defines constants for JDWP commands and command sets.
+ */
+public class JDWPCommands {
+
+    /**
+     * JDWP VirtualMachine Command Set constants.
+     */
+    public class VirtualMachineCommandSet {
+
+        public static final byte CommandSetID = 1;
+
+        public static final byte VersionCommand = 1;
+
+        public static final byte ClassesBySignatureCommand = 2;
+
+        public static final byte AllClassesCommand = 3;
+
+        public static final byte AllThreadsCommand = 4;
+
+        public static final byte TopLevelThreadGroupsCommand = 5;
+
+        public static final byte DisposeCommand = 6;
+
+        public static final byte IDSizesCommand = 7;
+
+        public static final byte SuspendCommand = 8;
+
+        public static final byte ResumeCommand = 9;
+
+        public static final byte ExitCommand = 10;
+
+        public static final byte CreateStringCommand = 11;
+
+        public static final byte CapabilitiesCommand = 12;
+
+        public static final byte ClassPathsCommand = 13;
+
+        public static final byte DisposeObjectsCommand = 14;
+
+        public static final byte HoldEventsCommand = 15;
+
+        public static final byte ReleaseEventsCommand = 16;
+
+        public static final byte CapabilitiesNewCommand = 17;
+
+        public static final byte RedefineClassesCommand = 18;
+
+        public static final byte SetDefaultStratumCommand = 19;
+
+        public static final byte AllClassesWithGenericCommand = 20;
+    }
+
+    /**
+     * JDWP ReferenceType Command Set constants.
+     */
+    public class ReferenceTypeCommandSet {
+
+        public static final byte CommandSetID = 2;
+
+        public static final byte SignatureCommand = 1;
+
+        public static final byte ClassLoaderCommand = 2;
+
+        public static final byte ModifiersCommand = 3;
+
+        public static final byte FieldsCommand = 4;
+
+        public static final byte MethodsCommand = 5;
+
+        public static final byte GetValuesCommand = 6;
+
+        public static final byte SourceFileCommand = 7;
+
+        public static final byte NestedTypesCommand = 8;
+
+        public static final byte StatusCommand = 9;
+
+        public static final byte InterfacesCommand = 10;
+
+        public static final byte ClassObjectCommand = 11;
+
+        public static final byte SourceDebugExtensionCommand = 12;
+
+        public static final byte SignatureWithGenericCommand = 13;
+
+        public static final byte FieldsWithGenericCommand = 14;
+
+        public static final byte MethodsWithGenericCommand = 15;
+    }
+
+    /**
+     * JDWP ClassType Command Set constants.
+     */
+    public class ClassTypeCommandSet {
+
+        public static final byte CommandSetID = 3;
+
+        public static final byte SuperclassCommand = 1;
+
+        public static final byte SetValuesCommand = 2;
+
+        public static final byte InvokeMethodCommand = 3;
+
+        public static final byte NewInstanceCommand = 4;
+    }
+
+    /**
+     * JDWP ArrayType Command Set constants.
+     */
+    public class ArrayTypeCommandSet {
+
+        public static final byte CommandSetID = 4;
+
+        public static final byte NewInstanceCommand = 1;
+    }
+
+    /**
+     * JDWP InterfaceType Command Set constants.
+     */
+    public class InterfaceTypeCommandSet {
+        public static final byte CommandSetID = 5;
+    }
+
+    /**
+     * JDWP Method Command Set constants.
+     */
+    public class MethodCommandSet {
+
+        public static final byte CommandSetID = 6;
+
+        public static final byte LineTableCommand = 1;
+
+        public static final byte VariableTableCommand = 2;
+
+        public static final byte BytecodesCommand = 3;
+
+        public static final byte IsObsoleteCommand = 4;
+
+        public static final byte VariableTableWithGenericCommand = 5;
+    }
+
+    /**
+     * JDWP Field Command Set constants.
+     */
+    public class FieldCommandSet {
+
+        public static final byte CommandSetID = 8;
+    }
+
+    /**
+     * JDWP ObjectReference Command Set constants.
+     */
+    public class ObjectReferenceCommandSet {
+
+        public static final byte CommandSetID = 9;
+
+        public static final byte ReferenceTypeCommand = 1;
+
+        public static final byte GetValuesCommand = 2;
+
+        public static final byte SetValuesCommand = 3;
+
+        public static final byte MonitorInfoCommand = 5;
+
+        public static final byte InvokeMethodCommand = 6;
+
+        public static final byte DisableCollectionCommand = 7;
+
+        public static final byte EnableCollectionCommand = 8;
+
+        public static final byte IsCollectedCommand = 9;
+    }
+
+    /**
+     * JDWP String Command Set constants.
+     */
+    public class StringReferenceCommandSet {
+
+        public static final byte CommandSetID = 10;
+
+        public static final byte ValueCommand = 1;
+    }
+
+    /**
+     * JDWP ThreadReference Command Set constants.
+     */
+    public class ThreadReferenceCommandSet {
+
+        public static final byte CommandSetID = 11;
+
+        public static final byte NameCommand = 1;
+
+        public static final byte SuspendCommand = 2;
+
+        public static final byte ResumeCommand = 3;
+
+        public static final byte StatusCommand = 4;
+
+        public static final byte ThreadGroupCommand = 5;
+
+        public static final byte FramesCommand = 6;
+
+        public static final byte FrameCountCommand = 7;
+
+        public static final byte OwnedMonitorsCommand = 8;
+
+        public static final byte CurrentContendedMonitorCommand = 9;
+
+        public static final byte StopCommand = 10;
+
+        public static final byte InterruptCommand = 11;
+
+        public static final byte SuspendCountCommand = 12;
+    }
+
+    /**
+     * JDWP ThreadGroupReference Command Set constants.
+     */
+    public class ThreadGroupReferenceCommandSet {
+
+        public static final byte CommandSetID = 12;
+
+        public static final byte NameCommand = 1;
+
+        public static final byte ParentCommand = 2;
+
+        public static final byte ChildrenCommand = 3;
+    }
+
+    /**
+     * JDWP ArrayReference Command Set constants.
+     */
+    public class ArrayReferenceCommandSet {
+
+        public static final byte CommandSetID = 13;
+
+        public static final byte LengthCommand = 1;
+
+        public static final byte GetValuesCommand = 2;
+
+        public static final byte SetValuesCommand = 3;
+    }
+
+    /**
+     * JDWP ClassLoaderReference Command Set constants.
+     */
+    public class ClassLoaderReferenceCommandSet {
+
+        public static final byte CommandSetID = 14;
+
+        public static final byte VisibleClassesCommand = 1;
+    }
+
+    /**
+     * JDWP EventRequest Command Set constants.
+     */
+    public class EventRequestCommandSet {
+
+        public static final byte CommandSetID = 15;
+
+        public static final byte SetCommand = 1;
+
+        public static final byte ClearCommand = 2;
+
+        public static final byte ClearAllBreakpointsCommand = 3;
+    }
+
+    /**
+     * JDWP StackFrame Command Set constants.
+     */
+    public class StackFrameCommandSet {
+
+        public static final byte CommandSetID = 16;
+
+        public static final byte GetValuesCommand = 1;
+
+        public static final byte SetValuesCommand = 2;
+
+        public static final byte ThisObjectCommand = 3;
+
+        public static final byte PopFramesCommand = 4;
+    }
+
+    /**
+     * JDWP ClassObjectReference Command Set constants.
+     */
+    public class ClassObjectReferenceCommandSet {
+
+        public static final byte CommandSetID = 17;
+
+        public static final byte ReflectedTypeCommand = 1;
+    }
+
+    /**
+     * JDWP Event Command Set constants.
+     */
+    public class EventCommandSet {
+
+        public static final byte CommandSetID = 64;
+
+        public static final byte CompositeCommand = 100;
+    }
+
+}

Propchange: harmony/enhanced/jdktools/trunk/modules/jpda/test/common/unit/org/apache/harmony/jpda/tests/framework/jdwp/JDWPCommands.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message