1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *  Unless required by applicable law or agreed to in writing, software
12 *  distributed under the License is distributed on an "AS IS" BASIS,
13 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *
15 *  See the License for the specific language governing permissions and
16 *  limitations under the License.
17 */
18
19/**
20 * @author Viacheslav G. Rybalov
21 */
22
23/**
24 * Created on 10.03.2005
25 */
26package org.apache.harmony.jpda.tests.jdwp.ClassType;
27
28import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket;
29import org.apache.harmony.jpda.tests.framework.jdwp.JDWPCommands;
30import org.apache.harmony.jpda.tests.framework.jdwp.JDWPConstants;
31import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket;
32import org.apache.harmony.jpda.tests.framework.jdwp.TaggedObject;
33import org.apache.harmony.jpda.tests.framework.jdwp.Value;
34import org.apache.harmony.jpda.tests.jdwp.share.JDWPSyncTestCase;
35import org.apache.harmony.jpda.tests.share.JPDADebuggeeSynchronizer;
36
37
38/**
39 * JDWP unit test for ClassType.InvokeMethod command.
40 */
41public class InvokeMethodTest extends JDWPSyncTestCase {
42
43    static final int testStatusPassed = 0;
44    static final int testStatusFailed = -1;
45
46    @Override
47    protected String getDebuggeeClassName() {
48        return "org.apache.harmony.jpda.tests.jdwp.share.debuggee.InvokeMethodDebuggee";
49    }
50
51    /**
52     * This testcase exercises ClassType.InvokeMethod command.
53     * <BR>At first the test starts debuggee.
54     * <BR>Then does the following checks:
55     * <BR>&nbsp;&nbsp; - send ClassType.InvokeMethod command for method,
56     * which should not throw any Exception, and checks,
57     * that returned value is expected int value and returned
58     * exception object is null;
59     * <BR>&nbsp;&nbsp; - send ClassType.InvokeMethod command for method,
60     * which should throw some Exception, and checks, that
61     * returned exception object is not null and has expected attributes;
62     */
63    public void testInvokeMethod001() {
64        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
65
66        // Get referenceTypeID
67        CommandPacket packet = new CommandPacket(
68                JDWPCommands.VirtualMachineCommandSet.CommandSetID,
69                JDWPCommands.VirtualMachineCommandSet.ClassesBySignatureCommand);
70        String classSig = "Lorg/apache/harmony/jpda/tests/jdwp/share/debuggee/InvokeMethodDebuggee;";
71        packet.setNextValueAsString(classSig);
72        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
73        checkReplyPacket(reply, "VirtualMachine::ClassesBySignature command");
74
75        int classes = reply.getNextValueAsInt();
76        assertEquals("VirtualMachine::ClassesBySignature returned invalid number of classes,",
77                1, classes); //this class may be loaded only once
78        byte refTypeTag = reply.getNextValueAsByte();
79        long typeID = reply.getNextValueAsReferenceTypeID();
80        int status = reply.getNextValueAsInt();
81        assertAllDataRead(reply);
82        assertEquals("VirtualMachine::ClassesBySignature returned Invalid type tag,",
83                JDWPConstants.TypeTag.CLASS, refTypeTag,
84                JDWPConstants.TypeTag.getName(JDWPConstants.TypeTag.CLASS),
85                JDWPConstants.TypeTag.getName(refTypeTag));
86
87        logWriter.println(" VirtualMachine.ClassesBySignature: classes="
88                + classes + " refTypeTag=" + refTypeTag + " typeID= " + typeID
89                + " status=" + status);
90
91        // Get methodID
92        packet = new CommandPacket(
93                JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
94                JDWPCommands.ReferenceTypeCommandSet.MethodsCommand);
95        packet.setNextValueAsClassID(typeID);
96        reply = debuggeeWrapper.vmMirror.performCommand(packet);
97        checkReplyPacket(reply, "ReferenceType::Methods command");
98
99        int declared = reply.getNextValueAsInt();
100        logWriter.println(" ReferenceType.Methods: declared=" + declared);
101        long targetMethodID = 0;
102        for (int i = 0; i < declared; i++) {
103            long methodID = reply.getNextValueAsMethodID();
104            String name = reply.getNextValueAsString();
105            String signature = reply.getNextValueAsString();
106            int modBits = reply.getNextValueAsInt();
107            logWriter.println("  methodID=" + methodID + " name=" + name
108                    + " signature=" + signature + " modBits=" + modBits);
109            if (name.equals("testMethod2")) {
110                targetMethodID = methodID;
111            }
112        }
113        assertAllDataRead(reply);
114
115        // Set EventRequest
116        packet = new CommandPacket(
117                JDWPCommands.EventRequestCommandSet.CommandSetID,
118                JDWPCommands.EventRequestCommandSet.SetCommand);
119        packet.setNextValueAsByte(JDWPConstants.EventKind.METHOD_ENTRY);
120        packet.setNextValueAsByte(JDWPConstants.SuspendPolicy.ALL);
121        packet.setNextValueAsInt(1);
122        packet.setNextValueAsByte((byte) 5);
123        packet.setNextValueAsString("*.InvokeMethodDebuggee");
124        reply = debuggeeWrapper.vmMirror.performCommand(packet);
125        checkReplyPacket(reply, "EventRequest::Set command");
126
127        int requestID = reply.getNextValueAsInt();
128        logWriter.println(" EventRequest.Set: requestID=" + requestID);
129        assertAllDataRead(reply);
130        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
131
132        long targetThreadID = 0;
133        // Wait event
134        CommandPacket event = debuggeeWrapper.vmMirror.receiveEvent();
135        byte suspendPolicy = event.getNextValueAsByte();
136        int events = event.getNextValueAsInt();
137        logWriter.println(" EVENT_THREAD event: suspendPolicy=" + suspendPolicy + " events=" + events);
138        for (int i = 0; i < events; i++) {
139            byte eventKind = event.getNextValueAsByte();
140            int newRequestID = event.getNextValueAsInt();
141            long threadID = event.getNextValueAsThreadID();
142            //Location location =
143                event.getNextValueAsLocation();
144            logWriter.println("  EVENT_THREAD event " + i + ": eventKind="
145                    + eventKind + " requestID=" + newRequestID + " threadID="
146                    + threadID);
147            if (newRequestID == requestID) {
148                targetThreadID = threadID;
149            }
150        }
151        assertAllDataRead(event);
152        assertTrue("Invalid targetThreadID, must be != 0", targetThreadID != 0);
153
154        //  Let's clear event request
155        packet = new CommandPacket(
156                JDWPCommands.EventRequestCommandSet.CommandSetID,
157                JDWPCommands.EventRequestCommandSet.ClearCommand);
158        packet.setNextValueAsByte(JDWPConstants.EventKind.METHOD_ENTRY);
159        packet.setNextValueAsInt(requestID);
160        reply = debuggeeWrapper.vmMirror.performCommand(packet);
161        checkReplyPacket(reply, "EventRequest::Clear command");
162        assertAllDataRead(reply);
163
164        // Make InvokeMethod without Exception
165        packet = new CommandPacket(
166                JDWPCommands.ClassTypeCommandSet.CommandSetID,
167                JDWPCommands.ClassTypeCommandSet.InvokeMethodCommand);
168        packet.setNextValueAsClassID(typeID);
169        packet.setNextValueAsThreadID(targetThreadID);
170        packet.setNextValueAsMethodID(targetMethodID);
171        packet.setNextValueAsInt(1);
172            packet.setNextValueAsValue(Value.createBoolean(false));
173        packet.setNextValueAsInt(0);
174        logWriter.println(" Send ClassType.InvokeMethod without Exception");
175        reply = debuggeeWrapper.vmMirror.performCommand(packet);
176        checkReplyPacket(reply, "ClassType::InvokeMethod command");
177
178        Value returnValue = reply.getNextValueAsValue();
179        assertNotNull("Returned value is null", returnValue);
180        assertEquals("Invalid returned value,", 234, returnValue.getIntValue());
181        logWriter.println(" ClassType.InvokeMethod: returnValue.getIntValue()="
182                + returnValue.getIntValue());
183
184        TaggedObject exception = reply.getNextValueAsTaggedObject();
185        assertNotNull("Returned exception is null", exception);
186        assertTrue("Invalid exception object ID:<" + exception.objectID + ">", exception.objectID == 0);
187        assertEquals("Invalid exception tag,", JDWPConstants.Tag.OBJECT_TAG, exception.tag
188                , JDWPConstants.Tag.getName(JDWPConstants.Tag.OBJECT_TAG)
189                , JDWPConstants.Tag.getName(exception.tag));
190        logWriter.println(" ClassType.InvokeMethod: exception.tag="
191                + exception.tag + " exception.objectID=" + exception.objectID);
192        assertAllDataRead(reply);
193
194        // Make InvokeMethod with Exception
195        packet = new CommandPacket(
196                JDWPCommands.ClassTypeCommandSet.CommandSetID,
197                JDWPCommands.ClassTypeCommandSet.InvokeMethodCommand);
198        packet.setNextValueAsClassID(typeID);
199        packet.setNextValueAsThreadID(targetThreadID);
200        packet.setNextValueAsMethodID(targetMethodID);
201        packet.setNextValueAsInt(1);
202            packet.setNextValueAsValue(Value.createBoolean(true));
203        packet.setNextValueAsInt(0);
204        logWriter.println(" Send ClassType.InvokeMethod with Exception");
205        reply = debuggeeWrapper.vmMirror.performCommand(packet);
206        checkReplyPacket(reply, "ClassType::InvokeMethod command");
207
208        returnValue = reply.getNextValueAsValue();
209        logWriter.println(" ClassType.InvokeMethod: returnValue.getIntValue()="
210                + returnValue.getIntValue());
211
212        exception = reply.getNextValueAsTaggedObject();
213        assertNotNull("Returned exception is null", exception);
214        assertTrue("Invalid exception object ID:<" + exception.objectID + ">", exception.objectID != 0);
215        assertEquals("Invalid exception tag,", JDWPConstants.Tag.OBJECT_TAG, exception.tag
216                , JDWPConstants.Tag.getName(JDWPConstants.Tag.OBJECT_TAG)
217                , JDWPConstants.Tag.getName(exception.tag));
218        logWriter.println(" ClassType.InvokeMethod: exception.tag="
219                + exception.tag + " exception.objectID=" + exception.objectID);
220        assertAllDataRead(reply);
221
222        //  Let's resume application
223        packet = new CommandPacket(
224                JDWPCommands.VirtualMachineCommandSet.CommandSetID,
225                JDWPCommands.VirtualMachineCommandSet.ResumeCommand);
226        reply = debuggeeWrapper.vmMirror.performCommand(packet);
227        checkReplyPacket(reply, "VirtualMachine::Resume command");
228        assertAllDataRead(reply);
229
230        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
231    }
232
233    /**
234     * This testcase exercises ClassType.InvokeMethod command.
235     * <BR>At first the test starts debuggee.
236     * <BR>Then does the following checks:
237     * <BR>&nbsp;&nbsp; - send ClassType.InvokeMethod command for method,
238     * which actually does not belong to passed class (taking into account
239     * inheritance).
240     * <BR>Test expects that INVALID_METHODID error is returned by command.
241     */
242    public void testInvokeMethod002() {
243        logWriter.println("==> testInvokeMethod002: START...");
244        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
245
246        logWriter.println("\n==> Getting debuggeeRefTypeID... ");
247        String debuggeeSignature = "Lorg/apache/harmony/jpda/tests/jdwp/share/debuggee/InvokeMethodDebuggee;";
248        logWriter.println("==> debuggeeSignature = |" + debuggeeSignature + "|+");
249        long debuggeeRefTypeID = debuggeeWrapper.vmMirror.getClassID(debuggeeSignature);
250        if ( debuggeeRefTypeID == -1 ) {
251            logWriter.println("## FAILURE: Can not get debuggeeRefTypeID!");
252            fail("Can not get debuggeeRefTypeID!");
253        }
254        logWriter.println("==> debuggeeRefTypeID = " + debuggeeRefTypeID);
255
256        logWriter.println("\n==> Getting testMethodID for debuggee method 'testMethod2'... ");
257        String testMethodName = "testMethod2";
258        long testMethodID =
259            debuggeeWrapper.vmMirror.getMethodID(debuggeeRefTypeID, testMethodName);
260        if ( testMethodID == -1 ) {
261            logWriter.println("## FAILURE: Can not get methodID!");
262            fail("Can not get methodID!");
263        }
264        logWriter.println("==> testMethodID = " + testMethodID);
265
266        logWriter.println("\n==> Setting EventRequest... ");
267        CommandPacket packet = new CommandPacket(
268                JDWPCommands.EventRequestCommandSet.CommandSetID,
269                JDWPCommands.EventRequestCommandSet.SetCommand);
270        packet.setNextValueAsByte(JDWPConstants.EventKind.METHOD_ENTRY);
271        packet.setNextValueAsByte(JDWPConstants.SuspendPolicy.ALL);
272        packet.setNextValueAsInt(1);
273        packet.setNextValueAsByte((byte) 5);
274        packet.setNextValueAsString("*.InvokeMethodDebuggee");
275
276        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
277        checkReplyPacket(reply, "EventRequest::Set command");
278
279        int requestID = reply.getNextValueAsInt();
280        logWriter.println(" EventRequest.Set: requestID=" + requestID);
281
282        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
283
284        logWriter.println("\n==> Getting targetThreadID... ");
285        long targetThreadID = 0;
286        // Wait event
287        CommandPacket event = debuggeeWrapper.vmMirror
288                .receiveEvent();
289        byte suspendPolicy = event.getNextValueAsByte();
290        int events = event.getNextValueAsInt();
291        logWriter.println(" EVENT_THREAD event: suspendPolicy=" + suspendPolicy
292                + " events=" + events);
293        for (int i = 0; i < events; i++) {
294            byte eventKind = event.getNextValueAsByte();
295            int newRequestID = event.getNextValueAsInt();
296            long threadID = event.getNextValueAsThreadID();
297            //Location location =
298                event.getNextValueAsLocation();
299            logWriter.println("  EVENT_THREAD event " + i + ": eventKind="
300                    + eventKind + " requestID=" + newRequestID + " threadID="
301                    + threadID);
302            if (newRequestID == requestID) {
303                targetThreadID = threadID;
304            }
305        }
306        logWriter.println("==> targetThreadID = " + targetThreadID);
307        assertTrue("Invalid targetThreadID, must be != 0", targetThreadID != 0);
308
309        logWriter.println("\n==> Clear EventRequest... ");
310        packet = new CommandPacket(
311                JDWPCommands.EventRequestCommandSet.CommandSetID,
312                JDWPCommands.EventRequestCommandSet.ClearCommand);
313        packet.setNextValueAsByte(JDWPConstants.EventKind.METHOD_ENTRY);
314        packet.setNextValueAsInt(requestID);
315        reply = debuggeeWrapper.vmMirror.performCommand(packet);
316        checkReplyPacket(reply, "EventRequest::Clear command");
317
318        logWriter.println("\n==> Getting invalidClassRefTypeID... ");
319        String invalidClassSignature = "Lorg/apache/harmony/jpda/tests/jdwp/share/debuggee/testClass2;";
320        logWriter.println("==> invalidClassSignature = |" + invalidClassSignature + "|+");
321        long invalidClassRefTypeID = debuggeeWrapper.vmMirror.getClassID(invalidClassSignature);
322        if ( invalidClassRefTypeID == -1 ) {
323            logWriter.println("## FAILURE: Can not get invalidClassRefTypeID!");
324            fail("Can not get invalidClassRefTypeID!");
325        }
326        logWriter.println("==> invalidClassRefTypeID = " + invalidClassRefTypeID);
327
328        logWriter.println
329        ("\n==> Send ClassType::InvokeMethod for invalidClassRefTypeID, testMethodID...");
330        packet = new CommandPacket(
331                JDWPCommands.ClassTypeCommandSet.CommandSetID,
332                JDWPCommands.ClassTypeCommandSet.InvokeMethodCommand);
333        packet.setNextValueAsClassID(invalidClassRefTypeID);
334        packet.setNextValueAsThreadID(targetThreadID);
335        packet.setNextValueAsMethodID(testMethodID);
336        packet.setNextValueAsInt(1);
337            packet.setNextValueAsValue(Value.createBoolean(false));
338        packet.setNextValueAsInt(0);
339        reply = debuggeeWrapper.vmMirror.performCommand(packet);
340        short errorCode = reply.getErrorCode();
341        if (errorCode == JDWPConstants.Error.NONE) {
342            logWriter.println
343            ("## FAILURE: ClassType::InvokeMethod command does NOT return expected error - INVALID_METHODID");
344
345            // next is only for extra info
346            logWriter.println("\n==> Result if invoke method:");
347            Value returnValue = reply.getNextValueAsValue();
348            if (returnValue != null) {
349                logWriter.println(" ClassType.InvokeMethod: returnValue.getIntValue()="
350                        + returnValue.getIntValue());
351            }
352
353            TaggedObject exception = reply.getNextValueAsTaggedObject();
354            if (exception != null) {
355                logWriter.println(" ClassType.InvokeMethod: exception.tag="
356                        + exception.tag + " exception.objectID=" + exception.objectID);
357                if ( exception.objectID != 0 ) {
358                    String exceptionSignature = getObjectSignature(exception.objectID);
359                    logWriter.println(" exceptionSignature = " + exceptionSignature);
360                }
361            }
362        }
363        checkReplyPacket(reply, "ClassType::InvokeMethod command", JDWPConstants.Error.INVALID_METHODID);
364
365        logWriter.println("==> PASSED: Expected error (INVALID_METHODID) is returned");
366        resumeDebuggee();
367
368        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
369    }
370
371    /**
372     * This testcase exercises ClassType.InvokeMethod command.
373     * <BR>At first the test starts debuggee.
374     * <BR>Then does the following checks:
375     * <BR>&nbsp;&nbsp; - send ClassType.InvokeMethod command for method,
376     * which actually is not static method.
377     * <BR>Test expects that INVALID_METHODID error is returned by command.
378     */
379    public void testInvokeMethod003() {
380        logWriter.println("==> testInvokeMethod003: START...");
381        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
382
383        logWriter.println("\n==> Getting debuggeeRefTypeID... ");
384        String debuggeeSignature = "Lorg/apache/harmony/jpda/tests/jdwp/share/debuggee/InvokeMethodDebuggee;";
385        logWriter.println("==> debuggeeSignature = |" + debuggeeSignature + "|+");
386        long debuggeeRefTypeID = debuggeeWrapper.vmMirror.getClassID(debuggeeSignature);
387        if ( debuggeeRefTypeID == -1 ) {
388            logWriter.println("## FAILURE: Can not get debuggeeRefTypeID!");
389            fail("Can not get debuggeeRefTypeID!");
390        }
391        logWriter.println("==> debuggeeRefTypeID = " + debuggeeRefTypeID);
392
393        logWriter.println("\n==> Getting nonStaticMethodID for debuggee method 'testMethod1'... ");
394        String nonStaticMethodName = "testMethod1";
395        long nonStaticMethodID =
396            debuggeeWrapper.vmMirror.getMethodID(debuggeeRefTypeID, nonStaticMethodName);
397        if ( nonStaticMethodID == -1 ) {
398            logWriter.println("## FAILURE: Can not get methodID!");
399            fail("Can not get methodID!");
400        }
401        logWriter.println("==> nonStaticMethodID = " + nonStaticMethodID);
402
403        logWriter.println("\n==> Setting EventRequest... ");
404        CommandPacket packet = new CommandPacket(
405                JDWPCommands.EventRequestCommandSet.CommandSetID,
406                JDWPCommands.EventRequestCommandSet.SetCommand);
407        packet.setNextValueAsByte(JDWPConstants.EventKind.METHOD_ENTRY);
408        packet.setNextValueAsByte(JDWPConstants.SuspendPolicy.ALL);
409        packet.setNextValueAsInt(1);
410        packet.setNextValueAsByte((byte) 5);
411        packet.setNextValueAsString("*.InvokeMethodDebuggee");
412
413        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
414        checkReplyPacket(reply, "EventRequest::Set command");
415
416        int requestID = reply.getNextValueAsInt();
417        logWriter.println(" EventRequest.Set: requestID=" + requestID);
418
419        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
420
421        logWriter.println("\n==> Getting targetThreadID... ");
422        long targetThreadID = 0;
423        // Wait event
424        CommandPacket event = debuggeeWrapper.vmMirror
425                .receiveEvent();
426        byte suspendPolicy = event.getNextValueAsByte();
427        int events = event.getNextValueAsInt();
428        logWriter.println(" EVENT_THREAD event: suspendPolicy=" + suspendPolicy
429                + " events=" + events);
430        for (int i = 0; i < events; i++) {
431            byte eventKind = event.getNextValueAsByte();
432            int newRequestID = event.getNextValueAsInt();
433            long threadID = event.getNextValueAsThreadID();
434            //Location location =
435                event.getNextValueAsLocation();
436            logWriter.println("  EVENT_THREAD event " + i + ": eventKind="
437                    + eventKind + " requestID=" + newRequestID + " threadID="
438                    + threadID);
439            if (newRequestID == requestID) {
440                targetThreadID = threadID;
441            }
442        }
443        logWriter.println("==> targetThreadID = " + targetThreadID);
444        assertTrue("Invalid targetThreadID, must be != 0", targetThreadID != 0);
445
446        logWriter.println("\n==> Clear EventRequest... ");
447        packet = new CommandPacket(
448                JDWPCommands.EventRequestCommandSet.CommandSetID,
449                JDWPCommands.EventRequestCommandSet.ClearCommand);
450        packet.setNextValueAsByte(JDWPConstants.EventKind.METHOD_ENTRY);
451        packet.setNextValueAsInt(requestID);
452        reply = debuggeeWrapper.vmMirror.performCommand(packet);
453        checkReplyPacket(reply, "EventRequest::Clear command");
454
455        logWriter.println
456        ("\n==> Send ClassType::InvokeMethod for debuggeeRefTypeID, nonStaticMethodID...");
457        packet = new CommandPacket(
458                JDWPCommands.ClassTypeCommandSet.CommandSetID,
459                JDWPCommands.ClassTypeCommandSet.InvokeMethodCommand);
460        packet.setNextValueAsClassID(debuggeeRefTypeID);
461        packet.setNextValueAsThreadID(targetThreadID);
462        packet.setNextValueAsMethodID(nonStaticMethodID);
463        packet.setNextValueAsInt(1);
464        packet.setNextValueAsValue(Value.createBoolean(false));
465        packet.setNextValueAsInt(0);
466        reply = debuggeeWrapper.vmMirror.performCommand(packet);
467        short errorCode = reply.getErrorCode();
468        if (errorCode == JDWPConstants.Error.NONE) {
469            logWriter.println
470            ("## FAILURE: ClassType::InvokeMethod command does NOT return expected error - INVALID_METHODID");
471
472            // next is only for extra info
473            logWriter.println("\n==> Result if invoke method:");
474            Value returnValue = reply.getNextValueAsValue();
475            if (returnValue != null) {
476                logWriter.println(" ClassType.InvokeMethod: returnValue.getIntValue()="
477                        + returnValue.getIntValue());
478            }
479
480            TaggedObject exception = reply.getNextValueAsTaggedObject();
481            if (exception != null) {
482                logWriter.println(" ClassType.InvokeMethod: exception.tag="
483                        + exception.tag + " exception.objectID=" + exception.objectID);
484                if ( exception.objectID != 0 ) {
485                    String exceptionSignature = getObjectSignature(exception.objectID);
486                    logWriter.println(" exceptionSignature = " + exceptionSignature);
487                }
488            }
489        }
490        checkReplyPacket(reply, "ClassType::InvokeMethod command", JDWPConstants.Error.INVALID_METHODID);
491
492        logWriter.println("==> PASSED: Expected error (INVALID_METHODID) is returned");
493        resumeDebuggee();
494
495        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
496    }
497}
498