Package org.apache.harmony.jpda.tests.framework

Examples of org.apache.harmony.jpda.tests.framework.TestErrorException


                && parsedEvents[0].getEventKind() == eventKind)
            return eventPacket;

        switch (parsedEvents.length) {
        case (0):
            throw new TestErrorException(
                    "Unexpected event received: zero length");
        case (1):
            throw new TestErrorException("Unexpected event received: "
                    + parsedEvents[0].getEventKind());
        default:
            throw new TestErrorException(
                    "Unexpected event received: Event was grouped in a composite event");
        }
    }
View Full Code Here


     * @param values
     *            An array of Value objects to set
     */
    public final void setLocalVars(Frame frame, Variable[] vars, Value[] values) {
        if (vars.length != values.length) {
            throw new TestErrorException(
                    "Number of variables doesn't correspond to number of their values");
        }

        CommandPacket command = new CommandPacket(
                JDWPCommands.StackFrameCommandSet.CommandSetID,
View Full Code Here

     *            An array of Value objects representing each value to set
     */
    public final void setInstanceFieldsValues(long objectID, long[] fieldIDs,
            Value[] values) {
        if (fieldIDs.length != values.length) {
            throw new TestErrorException(
                    "Number of fields doesn't correspond to number of their values");
        }

        CommandPacket command = new CommandPacket(
                JDWPCommands.ObjectReferenceCommandSet.CommandSetID,
View Full Code Here

     *            An array of Value objects representing each value to set
     */
    public final void setStaticFieldsValues(long classID, long[] fieldIDs,
            Value[] values) {
        if (fieldIDs.length != values.length) {
            throw new TestErrorException(
                    "Number of fields doesn't correspond to number of their values");
        }

        CommandPacket command = new CommandPacket(
                JDWPCommands.ClassTypeCommandSet.CommandSetID,
View Full Code Here

     * @param p array of bytes for new packet.
     */
    public Packet(byte p[]) {
        length = (int) readFromByteArray(p, LENGTH_INDEX, INT_SIZE);
        if (length < HEADER_SIZE) {
            throw new TestErrorException(
                    "Packet creation error: size of packet = " + length
                            + "is less than header size = " + HEADER_SIZE);
        }
        id = (int) readFromByteArray(p, ID_INDEX, INT_SIZE);
        flags = p[FLAGS_INDEX];
View Full Code Here

        }
        case JDWPConstants.Tag.NO_TAG: {
            return true;
        }
        default: {
            throw new TestErrorException("Improper JDWP.tag value = " + tag);
        }
        }
    }
View Full Code Here

        byte data_temp[] = data;
        byte val_as_bytes[];
        try {
            val_as_bytes = val.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            throw new TestErrorException(e);
        }
        int new_data_size = data.length + val_as_bytes.length
                + TypesLengths.getTypeLength(TypesLengths.INT_ID);
        data = new byte[new_data_size];
        System.arraycopy(data_temp, 0, data, 0, new_data_size
View Full Code Here

        int string_length = this.getNextValueAsInt();
        String res = null;
        try {
            res = new String(data, reading_data_index, string_length, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            throw new TestErrorException(e);
        }
        reading_data_index = reading_data_index + string_length;
        return res;
    }
View Full Code Here

     *            the ObjectID value.
     */
    public void setNextValueAsObjectID(long val) {
        if (TypesLengths.getTypeLength(TypesLengths.OBJECT_ID) < 0
                || TypesLengths.getTypeLength(TypesLengths.OBJECT_ID) > 8) {
            throw new TestErrorException("Improper ObjectID value length = "
                    + TypesLengths.getTypeLength(TypesLengths.OBJECT_ID));
        }
        int new_data_size = data.length
                + TypesLengths.getTypeLength(TypesLengths.OBJECT_ID);
        byte data_temp[] = data;
View Full Code Here

     * @return the next value of the data of the Packet as VM-sensitive value.
     */
    public long getNextValueAsObjectID() {
        if (TypesLengths.getTypeLength(TypesLengths.OBJECT_ID) < 0
                || TypesLengths.getTypeLength(TypesLengths.OBJECT_ID) > 8) {
            throw new TestErrorException("Improper ObjectID value length = "
                    + TypesLengths.getTypeLength(TypesLengths.OBJECT_ID) + "!");
        }
        reading_data_index = reading_data_index
                + TypesLengths.getTypeLength(TypesLengths.OBJECT_ID);
        return (int) readFromByteArray(data, reading_data_index
View Full Code Here

TOP

Related Classes of org.apache.harmony.jpda.tests.framework.TestErrorException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.