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

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


            try {
                logWriter.println("Waiting for process exit");
                WaitForProcessExit(process);
                logWriter.println("Finished process");
            } catch (IOException e) {
                throw new TestErrorException("IOException in waiting for process exit: ", e);
            }

            logWriter.println("Waiting for redirectors finish");
            if (outRedir != null) {
                outRedir.exit();
View Full Code Here


        thrd.setDaemon(true);
        thrd.start();
        try {
            thrd.join(settings.getTimeout());
        } catch (InterruptedException e) {
            throw new TestErrorException(e);
        }

        if (thrd.isAlive()) {
            thrd.interrupt();
        }

        try {
            int exitCode = process.exitValue();
            logWriter.println("Finished debuggee with exit code: " + exitCode);
        } catch (IllegalThreadStateException e) {
            logWriter.printError("Terminate debugge process");
            process.destroy();
            throw new TestErrorException("Debuggee process did not finish during timeout", e);
        }

        // dispose any resources of the process
        process.destroy();
    }
View Full Code Here

            logWriter.println("----------------------------------------");
        } catch (Throwable e) {
            logWriter.printError(e);
            logWriter.println("----------------------------------------");
            internalTearDown();
            throw new TestErrorException(e);
        }
    }
View Full Code Here

            logWriter.printError("unexpected event received: " + event);
            fail("unexpected event received");
        } catch (TimeoutException e) {
            logWriter.println("no events were received");
        } catch (Exception e) {
            throw new TestErrorException(e);
        }

        logWriter.println("send ReleaseEvents");
        packet = new CommandPacket(
                JDWPCommands.VirtualMachineCommandSet.CommandSetID,
View Full Code Here

                    .println("=> Send InvokeMethod command for method: " + PopFramesDebuggee.METHOD_TO_INVOKE_NAME);
            invokeCommandID = debuggeeWrapper.vmMirror
                    .sendCommand(invokeCommand);
        } catch (Exception e) {
            logWriter.println("Exception during invokeCommand: " + e);
            throw new TestErrorException(e);
        }

        // wait to ensure that method invocation started
        logWriter.println("=> Wait " + timeoutToWait
                + " mls to ensure that method invocation started");
        Object waitObj = new Object();
        synchronized (waitObj) {
            try {
                waitObj.wait(timeoutToWait);
            } catch (InterruptedException e) {
                logWriter.println("##Exception while waiting on object: " + e);
                throw new TestErrorException(e);
            }
        }

        // perform PopFrame command
        logWriter.println("=> Perform PopFrames command for method = " + methodToPop + " with frameID = " + frameID + " and expect errors");
        CommandPacket popFramesCommand = new CommandPacket(
                JDWPCommands.StackFrameCommandSet.CommandSetID,
                JDWPCommands.StackFrameCommandSet.PopFramesCommand);
        popFramesCommand.setNextValueAsThreadID(breakpointThreadID);
        popFramesCommand.setNextValueAsFrameID(frameID);

        ReplyPacket popFrameReply = debuggeeWrapper.vmMirror
                .performCommand(popFramesCommand);
        int res = popFrameReply.getErrorCode();
        logWriter.println("=> Returned error code: " + res + " ("
                + JDWPConstants.Error.getName(res) + ")");

        // check that PopFrames returns error, because thread is resumed by
        // InvokeMethod
        if (res == JDWPConstants.Error.NONE) {
            logWriter
                    .println("##PopFrames command returned no error for thread resumed by InvokeMethod");
            fail("##PopFrames command returned no error for thread resumed by InvokeMethod");
        }

        logWriter.println("=> Receive reply of invoked method: " + PopFramesDebuggee.METHOD_TO_INVOKE_NAME);
        try {
            ReplyPacket reply = debuggeeWrapper.vmMirror
                    .receiveReply(invokeCommandID);
            checkReplyPacket(reply, "ClassType::InvokeMethod command");
        } catch (Exception e) {
            logWriter
                    .println("##Exception while receiving reply for invoke command: "
                            + e);
            throw new TestErrorException(e);
        }

        logWriter.println("=> Resume debuggee");
        debuggeeWrapper.vmMirror.resume();
View Full Code Here

        try {
      cls = Class.forName(TESTED_CLASS_NAME, true, loader);
          logWriter.println("--> Tested class loaded: " + cls);
    } catch (Exception e) {
          logWriter.println("--> Unable to load tested class: " + e);
      throw new TestErrorException(e);
    }

        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY);
        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
   
View Full Code Here

          logWriter.println("=> Event received");
    } catch (TimeoutException e) {
          logWriter.println("=> ClassUnload event was not received (class might be not really unloaded)");
    } catch (Exception e) {
          logWriter.println("=> Exception during receiving ClassUnload event: " + e);
          throw new TestErrorException(e);
    }

        logWriter.println("=> Clear request for ClassUnload event");
        reply = debuggeeWrapper.vmMirror.clearEvent(JDWPConstants.EventKind.CLASS_UNLOAD, requestID);
       
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

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.