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 19package org.apache.harmony.jpda.tests.jdwp.StackFrame; 20 21import org.apache.harmony.jpda.tests.framework.TestErrorException; 22import org.apache.harmony.jpda.tests.share.JPDADebuggeeSynchronizer; 23import org.apache.harmony.jpda.tests.share.SyncDebuggee; 24 25import java.lang.reflect.InvocationTargetException; 26import java.lang.reflect.Method; 27 28/** 29 * Debuggee for GetValues002Test and SetValues002Test. 30 */ 31public class StackTrace002Debuggee extends SyncDebuggee { 32 // Signals to select which method the debuggee needs to call. 33 static final String BOOLEAN_SIGNAL = "runBreakpointBoolean"; 34 static final String BYTE_SIGNAL = "runBreakpointByte"; 35 static final String CHAR_SIGNAL = "runBreakpointChar"; 36 static final String SHORT_SIGNAL = "runBreakpointShort"; 37 static final String INT_SIGNAL = "runBreakpointInt"; 38 static final String INT_METHOD2_SIGNAL = "runBreakpointInt2"; 39 static final String INT_CONSTANT_METHOD_SIGNAL = "runBreakpointIntConstant"; 40 static final String INT_TWO_CONSTANTS_METHOD_SIGNAL = "runBreakpointIntTwoConstants"; 41 static final String INT_CONSTANT_METHOD_WITH_EXCEPTION_SIGNAL = 42 "runBreakpointIntConstantWithException"; 43 static final String INT_CONSTANT_METHOD_WITH_EXCEPTION_IN_CALLEE_SIGNAL = 44 "runBreakpointIntConstantWithExceptionInCallee"; 45 static final String INT_CONSTANT_METHOD_WITH_EXCEPTION_IN_CALLER_SIGNAL = 46 "runBreakpointIntConstantWithExceptionInCaller"; 47 static final String INT_CONSTANT_METHOD_WITH_EXCEPTION_FROM_NATIVE_SIGNAL = 48 "runBreakpointIntConstantWithExceptionAndNativeTransition"; 49 static final String LONG_METHOD_SIGNAL = "runBreakpointLong"; 50 static final String FLOAT_METHOD = "runBreakpointFloat"; 51 static final String DOUBLE_METHOD = "runBreakpointDouble"; 52 static final String OBJECT_SIGNAL = "runBreakpointObject"; 53 static final String OBJECT_WITH_EXCEPTION_SIGNAL = "runBreakpointObjectWithException"; 54 static final String OBJECT_METHOD_WITH_EXCEPTION_IN_CALLEE_SIGNAL = 55 "runBreakpointObjectWithExceptionInCallee"; 56 static final String OBJECT_METHOD_WITH_EXCEPTION_IN_CALLER_SIGNAL = 57 "runBreakpointObjectWithExceptionInCaller"; 58 static final String OBJECT_METHOD_WITH_EXCEPTION_FROM_NATIVE_SIGNAL = 59 "runBreakpointObjectWithExceptionAndNativeTransition"; 60 static final String ARRAY_SIGNAL = "runBreakpointArray"; 61 static final String CLASS_SIGNAL = "runBreakpointClass"; 62 static final String CLASS_LOADER_SIGNAL = "runBreakpointClassLoader"; 63 static final String STRING_SIGNAL = "runBreakpointString"; 64 static final String THREAD_SIGNAL = "runBreakpointThread"; 65 static final String THREAD_GROUP_SIGNAL = "runBreakpointThreadGroup"; 66 static final String ARRAY_AS_OBJECT_SIGNAL = "runBreakpointArrayAsObject"; 67 static final String CLASS_AS_OBJECT_SIGNAL = "runBreakpointClassAsObject"; 68 static final String CLASS_LOADER_AS_OBJECT_SIGNAL = "runBreakpointClassLoaderAsObject"; 69 static final String STRING_AS_OBJECT_SIGNAL = "runBreakpointStringAsObject"; 70 static final String THREAD_AS_OBJECT_SIGNAL = "runBreakpointThreadAsObject"; 71 static final String THREAD_GROUP_AS_OBJECT_SIGNAL = "runBreakpointThreadGroupAsObject"; 72 73 // Values used to check StackFrame.GetValues. 74 static final boolean BOOLEAN_PARAM_VALUE = true; 75 static final byte BYTE_PARAM_VALUE = 123; 76 static final char CHAR_PARAM_VALUE = '@'; 77 static final short SHORT_PARAM_VALUE = 12345; 78 static final int INT_PARAM_VALUE = 123456789; 79 static final long LONG_PARAM_VALUE = 102030405060708090L; 80 static final float FLOAT_PARAM_VALUE = 123.456f; 81 static final double DOUBLE_PARAM_VALUE = 0.123456789; 82 static final Object OBJECT_PARAM_VALUE = new Object(); 83 static final int[] ARRAY_PARAM_VALUE = new int[]{1, 2, 3, 4, 5}; 84 static final Class<?> CLASS_PARAM_VALUE = StackTrace002Debuggee.class; 85 static final ClassLoader CLASS_LOADER_PARAM_VALUE = CLASS_PARAM_VALUE.getClassLoader(); 86 static final String STRING_PARAM_VALUE = "this is a string object"; 87 static final Thread THREAD_PARAM_VALUE = new Thread("this is a thread"); 88 static final ThreadGroup THREAD_GROUP_PARAM_VALUE = THREAD_PARAM_VALUE.getThreadGroup(); 89 90 // Values used to check StackFrame.SetValues. 91 static final boolean BOOLEAN_PARAM_VALUE_TO_SET = !BOOLEAN_PARAM_VALUE; 92 static final byte BYTE_PARAM_VALUE_TO_SET = -BYTE_PARAM_VALUE; 93 static final char CHAR_PARAM_VALUE_TO_SET = '%'; 94 static final short SHORT_PARAM_VALUE_TO_SET = -SHORT_PARAM_VALUE; 95 static final int INT_PARAM_VALUE_TO_SET = -INT_PARAM_VALUE; 96 static final long LONG_PARAM_VALUE_TO_SET = -LONG_PARAM_VALUE; 97 static final float FLOAT_PARAM_VALUE_TO_SET = -FLOAT_PARAM_VALUE; 98 static final double DOUBLE_PARAM_VALUE_TO_SET = -DOUBLE_PARAM_VALUE; 99 static final Object OBJECT_PARAM_VALUE_TO_SET = new Object(); 100 static final int[] ARRAY_PARAM_VALUE_TO_SET = new int[]{5, 4, 3, 2, 1}; 101 static final Class<?> CLASS_PARAM_VALUE_TO_SET = Object.class; 102 static final ClassLoader CLASS_LOADER_PARAM_VALUE_TO_SET = 103 CLASS_PARAM_VALUE_TO_SET.getClassLoader(); 104 static final String STRING_PARAM_VALUE_TO_SET = "this is another string object"; 105 static final Thread THREAD_PARAM_VALUE_TO_SET = new Thread("this is another thread"); 106 static final ThreadGroup THREAD_GROUP_PARAM_VALUE_TO_SET = 107 THREAD_PARAM_VALUE_TO_SET.getThreadGroup(); 108 109 // A reference to 'this' debuggee. 110 static Object THIS_OBJECT; 111 112 private static class TestException extends Exception { 113 } 114 115 public static void main(String[] args) { 116 runDebuggee(StackTrace002Debuggee.class); 117 } 118 119 @Override 120 public void run() { 121 THIS_OBJECT = this; 122 123 synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY); 124 125 // Wait for test setup. 126 String signal = synchronizer.receiveMessage(); 127 128 // Invoke the method requested by the test. 129 switch (signal) { 130 case BOOLEAN_SIGNAL: 131 runBreakpointBoolean(BOOLEAN_PARAM_VALUE); 132 break; 133 case BYTE_SIGNAL: 134 runBreakpointByte(BYTE_PARAM_VALUE); 135 break; 136 case CHAR_SIGNAL: 137 runBreakpointChar(CHAR_PARAM_VALUE); 138 break; 139 case SHORT_SIGNAL: 140 runBreakpointShort(SHORT_PARAM_VALUE); 141 break; 142 case INT_SIGNAL: 143 runBreakpointInt(INT_PARAM_VALUE); 144 break; 145 case INT_METHOD2_SIGNAL: 146 runBreakpointInt2(INT_PARAM_VALUE); 147 break; 148 case INT_CONSTANT_METHOD_SIGNAL: 149 runBreakpointIntConstant(); 150 break; 151 case INT_TWO_CONSTANTS_METHOD_SIGNAL: 152 runBreakpointIntTwoConstants(); 153 break; 154 case INT_CONSTANT_METHOD_WITH_EXCEPTION_SIGNAL: 155 runBreakpointIntConstantWithException(); 156 break; 157 case INT_CONSTANT_METHOD_WITH_EXCEPTION_IN_CALLEE_SIGNAL: 158 runBreakpointIntConstantWithExceptionInCallee(); 159 break; 160 case INT_CONSTANT_METHOD_WITH_EXCEPTION_IN_CALLER_SIGNAL: 161 runBreakpointIntConstantWithExceptionInCaller(); 162 break; 163 case INT_CONSTANT_METHOD_WITH_EXCEPTION_FROM_NATIVE_SIGNAL: 164 runBreakpointIntConstantWithExceptionAndNativeTransition(); 165 break; 166 case LONG_METHOD_SIGNAL: 167 runBreakpointLong(LONG_PARAM_VALUE); 168 break; 169 case FLOAT_METHOD: 170 runBreakpointFloat(FLOAT_PARAM_VALUE); 171 break; 172 case DOUBLE_METHOD: 173 runBreakpointDouble(DOUBLE_PARAM_VALUE); 174 break; 175 case OBJECT_SIGNAL: 176 runBreakpointObject(OBJECT_PARAM_VALUE); 177 break; 178 case OBJECT_WITH_EXCEPTION_SIGNAL: 179 runBreakpointObjectWithException(); 180 break; 181 case OBJECT_METHOD_WITH_EXCEPTION_IN_CALLEE_SIGNAL: 182 runBreakpointObjectWithExceptionInCallee(); 183 break; 184 case OBJECT_METHOD_WITH_EXCEPTION_IN_CALLER_SIGNAL: 185 runBreakpointObjectWithExceptionInCaller(); 186 break; 187 case OBJECT_METHOD_WITH_EXCEPTION_FROM_NATIVE_SIGNAL: 188 runBreakpointObjectWithExceptionAndNativeTransition(); 189 break; 190 case ARRAY_SIGNAL: 191 runBreakpointArray(ARRAY_PARAM_VALUE); 192 break; 193 case CLASS_SIGNAL: 194 runBreakpointClass(CLASS_PARAM_VALUE); 195 break; 196 case CLASS_LOADER_SIGNAL: 197 runBreakpointClassLoader(CLASS_LOADER_PARAM_VALUE); 198 break; 199 case STRING_SIGNAL: 200 runBreakpointString(STRING_PARAM_VALUE); 201 break; 202 case THREAD_SIGNAL: 203 runBreakpointThread(THREAD_PARAM_VALUE); 204 break; 205 case THREAD_GROUP_SIGNAL: 206 runBreakpointThreadGroup(THREAD_GROUP_PARAM_VALUE); 207 break; 208 case ARRAY_AS_OBJECT_SIGNAL: 209 runBreakpointObject(ARRAY_PARAM_VALUE); 210 break; 211 case CLASS_AS_OBJECT_SIGNAL: 212 runBreakpointObject(CLASS_PARAM_VALUE); 213 break; 214 case CLASS_LOADER_AS_OBJECT_SIGNAL: 215 runBreakpointObject(CLASS_LOADER_PARAM_VALUE); 216 break; 217 case STRING_AS_OBJECT_SIGNAL: 218 runBreakpointObject(STRING_PARAM_VALUE); 219 break; 220 case THREAD_AS_OBJECT_SIGNAL: 221 runBreakpointObject(THREAD_PARAM_VALUE); 222 break; 223 case THREAD_GROUP_AS_OBJECT_SIGNAL: 224 runBreakpointObject(THREAD_GROUP_PARAM_VALUE); 225 break; 226 default: 227 throw new TestErrorException("Unexpected signal \"" + signal + "\""); 228 } 229 230 } 231 232 // Test boolean type. 233 public void runBreakpointBoolean(boolean param) { 234 breakpointBoolean(param); 235 breakpointBoolean(param); 236 } 237 238 public void breakpointBoolean(boolean param) { 239 logWriter.println("breakpointBoolean(param=" + param + ")"); 240 synchronizeWithTest(); 241 } 242 243 // Test byte type. 244 public void runBreakpointByte(byte param) { 245 breakpointByte(param); 246 breakpointByte(param); 247 } 248 249 public void breakpointByte(byte param) { 250 logWriter.println("breakpointByte(param=" + param + ")"); 251 synchronizeWithTest(); 252 } 253 254 // Test char type. 255 public void runBreakpointChar(char param) { 256 breakpointChar(param); 257 breakpointChar(param); 258 } 259 260 public void breakpointChar(char param) { 261 logWriter.println("breakpointChar(param=" + param + ")"); 262 synchronizeWithTest(); 263 } 264 265 // Test short type. 266 public void runBreakpointShort(short param) { 267 breakpointShort(param); 268 breakpointShort(param); 269 } 270 271 public void breakpointShort(short param) { 272 logWriter.println("breakpointShort(param=" + param + ")"); 273 synchronizeWithTest(); 274 } 275 276 // Test int type. 277 public void runBreakpointInt(int param) { 278 breakpointInt(param); 279 breakpointInt(param); 280 } 281 282 public void breakpointInt(int param) { 283 logWriter.println("breakpointInt(param=" + param + ")"); 284 synchronizeWithTest(); 285 } 286 287 public void runBreakpointInt2(int param) { 288 int local = param; 289 breakpointInt2(local); 290 local = local + param; 291 breakpointInt2(local); 292 } 293 294 public void breakpointInt2(int param) { 295 logWriter.println("breakpointInt2(param=" + param + ")"); 296 synchronizeWithTest(); 297 } 298 299 // Test int type with a constant. 300 public void runBreakpointIntConstant() { 301 int local = INT_PARAM_VALUE; 302 breakpointIntConstant(local); 303 breakpointIntConstant(local); 304 } 305 306 public void breakpointIntConstant(int param) { 307 logWriter.println("breakpointIntConstant(param=" + param + ")"); 308 synchronizeWithTest(); 309 } 310 311 // Test int type with two constants in the same frame. 312 public void runBreakpointIntTwoConstants() { 313 int local1 = INT_PARAM_VALUE; 314 int local2 = -INT_PARAM_VALUE; 315 breakpointIntTwoConstants(local1, local2); 316 breakpointIntTwoConstants(local1, local2); 317 } 318 319 public void breakpointIntTwoConstants(int param1, int param2) { 320 logWriter.println("breakpointIntTwoConstants(param1=" + param1 + 321 ", param2=" + param2 + ")"); 322 synchronizeWithTest(); 323 } 324 325 // Test setting a variable with a caught exception. 326 public void runBreakpointIntConstantWithException() { 327 int local = INT_PARAM_VALUE; 328 try { 329 breakpointIntConstantWithException(local); 330 } catch (TestException expected) { 331 } 332 try { 333 breakpointIntConstantWithException(local); 334 } catch (TestException expected) { 335 } 336 } 337 338 // Test setting a variable with a caught exception in the callee. 339 public void runBreakpointIntConstantWithExceptionInCallee() { 340 int local = INT_PARAM_VALUE; 341 breakpointIntConstantWithCaughtException(local); 342 breakpointIntConstantWithCaughtException(local); 343 } 344 345 // Test setting a variable with a caught exception in the caller. Because the frame will 346 // be unwound after throwing the exception, setting the variable has no effect. 347 public void runBreakpointIntConstantWithExceptionInCaller() { 348 // Call twice to remain compatible with the test expecting 2 suspensions. 349 try { 350 runBreakpointIntConstantWithExceptionInCallerImpl(); 351 } catch (TestException expected) { 352 } 353 try { 354 runBreakpointIntConstantWithExceptionInCallerImpl(); 355 } catch (TestException expected) { 356 } 357 } 358 359 public void runBreakpointIntConstantWithExceptionInCallerImpl() throws TestException { 360 int local = INT_PARAM_VALUE; 361 // We're going to throw in the callee and the exception is caught in our caller so we 362 // won't execute the current frame anymore. 363 breakpointIntConstantWithException(local); 364 } 365 366 private void breakpointIntConstantWithCaughtException(int param) { 367 try { 368 breakpointIntConstantWithException(param); 369 } catch (TestException expected) { 370 } 371 } 372 373 public void breakpointIntConstantWithException(int param) throws TestException { 374 logWriter.println("breakpointIntConstantWithException(param=" + param + ")"); 375 synchronizeWithTest(); 376 throw new TestException(); 377 } 378 379 // Test setting a variable with a caught exception with a native transition (using reflect). 380 public void runBreakpointIntConstantWithExceptionAndNativeTransition() { 381 int local = INT_PARAM_VALUE; 382 try { 383 breakpointIntConstantWithExceptionAndNativeTransition(local); 384 } catch (TestException expected) { 385 } 386 try { 387 breakpointIntConstantWithExceptionAndNativeTransition(local); 388 } catch (TestException expected) { 389 } 390 } 391 392 private void breakpointIntConstantWithExceptionAndNativeTransition(int local) throws TestException { 393 try { 394 Method suspensionMethod = 395 StackTrace002Debuggee.class.getDeclaredMethod("breakpointIntConstantWithException", 396 new Class<?>[]{int.class}); 397 suspensionMethod.invoke(this, local); 398 } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException e) { 399 throw new TestErrorException(e); 400 } catch (InvocationTargetException e) { 401 if (e.getTargetException() instanceof TestException) { 402 throw (TestException) e.getTargetException(); 403 } else { 404 throw new TestErrorException(e); 405 } 406 } 407 } 408 409 // Test long type. 410 public void runBreakpointLong(long param) { 411 breakpointLong(param); 412 breakpointLong(param); 413 } 414 415 public void breakpointLong(long param) { 416 logWriter.println("breakpointLong(param=" + param + ")"); 417 synchronizeWithTest(); 418 } 419 420 // Test float type. 421 public void runBreakpointFloat(float param) { 422 breakpointFloat(param); 423 breakpointFloat(param); 424 } 425 426 public void breakpointFloat(float param) { 427 logWriter.println("breakpointFloat(param=" + param + ")"); 428 synchronizeWithTest(); 429 } 430 431 // Test double type. 432 public void runBreakpointDouble(double param) { 433 breakpointDouble(param); 434 breakpointDouble(param); 435 } 436 437 public void breakpointDouble(double param) { 438 logWriter.println("breakpointDouble(param=" + param + ")"); 439 synchronizeWithTest(); 440 } 441 442 // Test java.lang.Object type. 443 public void runBreakpointObject(Object param) { 444 breakpointObject(param); 445 breakpointObject(param); 446 } 447 448 public void breakpointObject(Object param) { 449 logWriter.println("breakpointObject(param=\"" + param + "\")"); 450 synchronizeWithTest(); 451 } 452 453 // Test setting a java.lang.Object variable with a caught exception. 454 public void runBreakpointObjectWithException() { 455 Object local = OBJECT_PARAM_VALUE; 456 try { 457 breakpointObjectWithException(local); 458 } catch (TestException expected) { 459 } 460 try { 461 breakpointObjectWithException(local); 462 } catch (TestException expected) { 463 } 464 } 465 466 public void breakpointObjectWithException(Object param) throws TestException { 467 logWriter.println("breakpointObjectWithException(param=" + param + ")"); 468 synchronizeWithTest(); 469 throw new TestException(); 470 } 471 472 // Test setting a java.lang.Object variable with a caught exception in the callee. 473 public void runBreakpointObjectWithExceptionInCallee() { 474 Object local = OBJECT_PARAM_VALUE; 475 breakpointObjectWithCaughtException(local); 476 breakpointObjectWithCaughtException(local); 477 } 478 479 // Test setting a java.lang.Object variable with a caught exception in the caller. 480 // Because the frame will be unwound after throwing the exception, setting the 481 // variable has no effect. 482 public void runBreakpointObjectWithExceptionInCaller() { 483 // Call twice to remain compatible with the test expecting 2 suspensions. 484 try { 485 runBreakpointObjectWithExceptionInCallerImpl(); 486 } catch (TestException expected) { 487 } 488 try { 489 runBreakpointObjectWithExceptionInCallerImpl(); 490 } catch (TestException expected) { 491 } 492 } 493 494 public void runBreakpointObjectWithExceptionInCallerImpl() throws TestException { 495 Object local = OBJECT_PARAM_VALUE; 496 // We're going to throw in the callee and the exception is caught in our caller so we 497 // won't execute the current frame anymore. 498 breakpointObjectWithException(local); 499 } 500 501 private void breakpointObjectWithCaughtException(Object param) { 502 try { 503 breakpointObjectWithException(param); 504 } catch (TestException expected) { 505 } 506 } 507 508 // Test setting a java.lang.Object variable with a caught exception with a native 509 // transition (using reflect). 510 public void runBreakpointObjectWithExceptionAndNativeTransition() { 511 Object local = OBJECT_PARAM_VALUE; 512 try { 513 breakpointObjectWithExceptionAndNativeTransition(local); 514 } catch (TestException expected) { 515 } 516 try { 517 breakpointObjectWithExceptionAndNativeTransition(local); 518 } catch (TestException expected) { 519 } 520 } 521 522 private void breakpointObjectWithExceptionAndNativeTransition(Object local) 523 throws TestException { 524 try { 525 Method suspensionMethod = 526 StackTrace002Debuggee.class.getDeclaredMethod("breakpointObjectWithException", 527 new Class<?>[]{Object.class}); 528 suspensionMethod.invoke(this, local); 529 } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException e) { 530 throw new TestErrorException(e); 531 } catch (InvocationTargetException e) { 532 if (e.getTargetException() instanceof TestException) { 533 throw (TestException) e.getTargetException(); 534 } else { 535 throw new TestErrorException(e); 536 } 537 } 538 } 539 540 // Test array type. 541 public void runBreakpointArray(int[] param) { 542 breakpointArray(param); 543 breakpointArray(param); 544 } 545 546 public void breakpointArray(int[] param) { 547 logWriter.println("breakpointArray(param=\"" + param + "\")"); 548 synchronizeWithTest(); 549 } 550 551 // Test java.lang.Class type. 552 public void runBreakpointClass(Class<?> param) { 553 breakpointClass(param); 554 breakpointClass(param); 555 } 556 557 public void breakpointClass(Class<?> param) { 558 logWriter.println("breakpointClass(param=\"" + param + "\")"); 559 synchronizeWithTest(); 560 } 561 562 // Test java.lang.ClassLoader type. 563 public void runBreakpointClassLoader(ClassLoader param) { 564 breakpointClassLoader(param); 565 breakpointClassLoader(param); 566 } 567 568 public void breakpointClassLoader(ClassLoader param) { 569 logWriter.println("breakpointClassLoader(param=\"" + param + "\")"); 570 synchronizeWithTest(); 571 } 572 573 // Test java.lang.String type. 574 public void runBreakpointString(String param) { 575 breakpointString(param); 576 breakpointString(param); 577 } 578 579 public void breakpointString(String param) { 580 logWriter.println("breakpointString(param=\"" + param + "\")"); 581 synchronizeWithTest(); 582 } 583 584 // Test java.lang.Thread type. 585 public void runBreakpointThread(Thread param) { 586 breakpointThread(param); 587 breakpointThread(param); 588 } 589 590 public void breakpointThread(Thread param) { 591 logWriter.println("breakpointThread(param=\"" + param + "\")"); 592 synchronizeWithTest(); 593 } 594 595 // Test java.lang.ThreadGroup type. 596 public void runBreakpointThreadGroup(ThreadGroup param) { 597 breakpointThreadGroup(param); 598 breakpointThreadGroup(param); 599 } 600 601 public void breakpointThreadGroup(ThreadGroup param) { 602 logWriter.println("breakpointThreadGroup(param=\"" + param + "\")"); 603 synchronizeWithTest(); 604 } 605 606 private void synchronizeWithTest() { 607 // Sends thread's name so the test can find its thread id. 608 synchronizer.sendMessage(Thread.currentThread().getName()); 609 610 // Wait for the test to signal us after its checks. 611 synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE); 612 } 613}