1 package measurements.suites; 2 3 import java.lang.reflect.Field ; 4 import java.lang.reflect.Method ; 5 6 import junit.framework.Test; 7 import ch.ethz.inf.util.junit.PerformanceTest; 8 import ch.ethz.inf.util.junit.PerformanceTestSuite; 9 import ch.ethz.jvmai.*; 10 11 31 public class JoinPointMeasurements1 extends PerformanceTest { 32 33 public boolean useProse = false; 34 public boolean checkAssert = true; 35 36 protected JVMAspectInterface aspectInterface; 37 protected TestHook hook; 38 39 public void localMethod() { } 41 public void localMethodLongO(Object ob1, Object ob2) { } 42 public void localMethodLongI(int ob1, int ob2) { } 43 public void localMethodLongL(long ob1, long ob2) { } 44 public void localMethodLongD(double ob1, double ob2) { } 45 46 private void privatelocalMethod() { } 48 private void privatelocalMethodLongO(Object ob1, Object ob2) { } 49 private void privatelocalMethodLongI(int ob1, int ob2) { } 50 private void privatelocalMethodLongL(long ob1, long ob2) { } 51 private void privatelocalMethodLongD(double ob1, double ob2) { } 52 53 protected JoinPointTestInterface obInterface = new JoinPointTestClass(); 55 56 protected JoinPointTestClass obSync = new JoinPointTestClass(); 58 59 public int theField = 0; 60 61 public void theFieldAccess(int runs) 64 { 65 int n = 0; 66 67 startChronometer(); 68 for (int i = 0; i < RUNS; i++) n = this.theField; 69 stopChronometer(); 70 } 71 72 public void theFieldModification(int runs) 75 { 76 startChronometer(); 77 for (int i = 0; i < RUNS; i++) this.theField = i; 78 stopChronometer(); 79 } 80 81 protected Method method; 83 protected Method methodLongO; 84 protected Method methodLongI; 85 protected Method methodLongL; 86 protected Method methodLongD; 87 88 protected Method syncMethod; 90 protected Method syncMethodLongO; 91 protected Method syncMethodLongI; 92 protected Method syncMethodLongL; 93 protected Method syncMethodLongD; 94 95 protected Method interfaceMethod; 97 protected Method interfaceMethodLongO; 98 protected Method interfaceMethodLongI; 99 protected Method interfaceMethodLongL; 100 protected Method interfaceMethodLongD; 101 102 protected Method staticMethod; 104 protected Method staticMethodLongO; 105 protected Method staticMethodLongI; 106 protected Method staticMethodLongL; 107 protected Method staticMethodLongD; 108 109 protected Method privateMethod; 111 protected Method privateMethodLongO; 112 protected Method privateMethodLongI; 113 protected Method privateMethodLongL; 114 protected Method privateMethodLongD; 115 116 protected Field field; 117 118 public class TestException extends Exception {}; 119 public TestException exception = new TestException(); 120 121 public static int fieldAccessCount; 122 public static int fieldModificationCount; 123 public static int methodEntryCount; 124 public static int methodExitCount; 125 public static int exceptionThrowCount; 126 public static int exceptionCatchCount; 127 128 public static class TestHook extends JoinPointHook 129 { 130 public void onFieldAccess(FieldAccessJoinPoint joinPoint) { fieldAccessCount++; } 131 public void onFieldModification(FieldModificationJoinPoint joinPoint) { fieldModificationCount++; } 132 public void onMethodEntry(MethodEntryJoinPoint joinPoint) { methodEntryCount++; } 133 public void onMethodExit(MethodExitJoinPoint joinPoint) { methodExitCount++; } 134 public void onExceptionThrow(ExceptionJoinPoint joinPoint) { exceptionThrowCount++; } 135 public void onExceptionCatch(ExceptionCatchJoinPoint joinPoint) { exceptionCatchCount++; } 136 public void onClassLoad(Class cls) {} 137 } 138 139 public JoinPointMeasurements1(String name) { 140 super(name); 141 RANGE = new int[] { 100000000 }; 142 143 String proseParam = System.getProperty("useprose"); 144 if (proseParam != null) useProse = true; 145 } 146 147 protected void setUp() throws Exception 148 { 149 if (useProse) 150 { 151 String providerName = System.getProperty("ch.ethz.prose.JVMAIProvider"); 152 Class providerClass = Class.forName(providerName); 153 Provider provider = (Provider) providerClass.newInstance(); 154 155 aspectInterface = provider.getAspectInterface(); 156 aspectInterface.startup(null, true); 157 158 hook = new TestHook(); 159 aspectInterface.setJoinPointHook(hook); 160 161 method = JoinPointMeasurements1.class.getDeclaredMethod("localMethod", new Class [] {}); 163 methodLongO = JoinPointMeasurements1.class.getDeclaredMethod("localMethodLongO", new Class [] {Object .class, Object .class}); 164 methodLongI = JoinPointMeasurements1.class.getDeclaredMethod("localMethodLongI", new Class [] {Integer.TYPE, Integer.TYPE}); 165 methodLongL = JoinPointMeasurements1.class.getDeclaredMethod("localMethodLongL", new Class [] {Long.TYPE, Long.TYPE}); 166 methodLongD = JoinPointMeasurements1.class.getDeclaredMethod("localMethodLongD", new Class [] {Double.TYPE, Double.TYPE}); 167 168 syncMethod = JoinPointTestClass.class.getDeclaredMethod("syncMethodShort", new Class [] {}); 170 syncMethodLongO = JoinPointTestClass.class.getDeclaredMethod("syncMethodLongO", new Class [] {Object .class, Object .class}); 171 syncMethodLongI = JoinPointTestClass.class.getDeclaredMethod("syncMethodLongI", new Class [] {Integer.TYPE, Integer.TYPE}); 172 syncMethodLongL = JoinPointTestClass.class.getDeclaredMethod("syncMethodLongL", new Class [] {Long.TYPE, Long.TYPE}); 173 syncMethodLongD = JoinPointTestClass.class.getDeclaredMethod("syncMethodLongD", new Class [] {Double.TYPE, Double.TYPE}); 174 175 interfaceMethod = JoinPointTestClass.class.getDeclaredMethod("interfaceMethodShort", new Class [] {}); 177 interfaceMethodLongO = JoinPointTestClass.class.getDeclaredMethod("interfaceMethodLongO", new Class [] {Object .class, Object .class}); 178 interfaceMethodLongI = JoinPointTestClass.class.getDeclaredMethod("interfaceMethodLongI", new Class [] {Integer.TYPE, Integer.TYPE}); 179 interfaceMethodLongL = JoinPointTestClass.class.getDeclaredMethod("interfaceMethodLongL", new Class [] {Long.TYPE, Long.TYPE}); 180 interfaceMethodLongD = JoinPointTestClass.class.getDeclaredMethod("interfaceMethodLongD", new Class [] {Double.TYPE, Double.TYPE}); 181 182 staticMethod = JoinPointTestClass.class.getDeclaredMethod("staticMethodShort", new Class [] {}); 184 staticMethodLongO = JoinPointTestClass.class.getDeclaredMethod("staticMethodLongO", new Class [] {Object .class, Object .class}); 185 staticMethodLongI = JoinPointTestClass.class.getDeclaredMethod("staticMethodLongI", new Class [] {Integer.TYPE, Integer.TYPE}); 186 staticMethodLongL = JoinPointTestClass.class.getDeclaredMethod("staticMethodLongL", new Class [] {Long.TYPE, Long.TYPE}); 187 staticMethodLongD = JoinPointTestClass.class.getDeclaredMethod("staticMethodLongD", new Class [] {Double.TYPE, Double.TYPE}); 188 189 privateMethod = JoinPointMeasurements1.class.getDeclaredMethod("privatelocalMethod", new Class [] {}); 191 privateMethodLongO = JoinPointMeasurements1.class.getDeclaredMethod("privatelocalMethodLongO", new Class [] {Object .class, Object .class}); 192 privateMethodLongI = JoinPointMeasurements1.class.getDeclaredMethod("privatelocalMethodLongI", new Class [] {Integer.TYPE, Integer.TYPE}); 193 privateMethodLongL = JoinPointMeasurements1.class.getDeclaredMethod("privatelocalMethodLongL", new Class [] {Long.TYPE, Long.TYPE}); 194 privateMethodLongD = JoinPointMeasurements1.class.getDeclaredMethod("privatelocalMethodLongD", new Class [] {Double.TYPE, Double.TYPE}); 195 196 field = JoinPointMeasurements1.class.getDeclaredField("theField"); 197 } 198 199 fieldAccessCount = 0; 200 fieldModificationCount = 0; 201 methodEntryCount = 0; 202 methodExitCount = 0; 203 exceptionThrowCount = 0; 204 exceptionCatchCount = 0; 205 } 206 207 protected void tearDown() 208 { 209 if (useProse) aspectInterface.teardown(); 210 } 211 212 214 public void testVirtualMethod_no_jp_NoArg() 216 { 217 startChronometer(); 218 for (int i = 0; i < RUNS; i++) localMethod(); 219 stopChronometer(); 220 } 221 222 public void testVirtualMethodEntry_jp_activated_locked_NoArg() 224 { 225 if (useProse) { 226 aspectInterface.suspendNotification(Thread.currentThread()); aspectInterface.setMethodEntryWatch(method, new Object ()); 228 aspectInterface.resumeNotification(Thread.currentThread()); aspectInterface.suspendNotification(Thread.currentThread()); 230 } 231 232 startChronometer(); 233 for (int i = 0; i < RUNS; i++) localMethod(); 234 stopChronometer(); 235 } 236 237 public void testVirtualMethodExit_jp_activated_locked_NoArg() 239 { 240 if (useProse) { 241 aspectInterface.suspendNotification(Thread.currentThread()); 242 aspectInterface.setMethodExitWatch(method, new Object ()); 243 aspectInterface.resumeNotification(Thread.currentThread()); 244 aspectInterface.suspendNotification(Thread.currentThread()); 245 } 246 247 startChronometer(); 248 for (int i = 0; i < RUNS; i++) localMethod(); 249 stopChronometer(); 250 } 251 252 public void testVirtualMethodEntry_jp_activated_NoArg() 254 { 255 if (useProse) { 256 aspectInterface.suspendNotification(Thread.currentThread()); 257 aspectInterface.setMethodEntryWatch(method, new Object ()); 258 aspectInterface.resumeNotification(Thread.currentThread()); 259 } 260 261 startChronometer(); 262 for (int i = 0; i < RUNS; i++) localMethod(); 263 stopChronometer(); 264 265 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 266 } 267 268 public void testVirtualMethodExit_jp_activated_NoArg() 270 { 271 if (useProse) { 272 aspectInterface.suspendNotification(Thread.currentThread()); 273 aspectInterface.setMethodExitWatch(method, new Object ()); 274 aspectInterface.resumeNotification(Thread.currentThread()); 275 } 276 277 startChronometer(); 278 for (int i = 0; i < RUNS; i++) localMethod(); 279 stopChronometer(); 280 281 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 282 } 283 284 286 public void testSyncVirtualMethod_no_jp_NoArg() 288 { 289 startChronometer(); 290 for (int i = 0; i < RUNS; i++) obSync.syncMethodShort(); 291 stopChronometer(); 292 } 293 294 public void testSyncVirtualMethodEntry_jp_activated_locked_NoArg() 296 { 297 if (useProse) { 298 aspectInterface.suspendNotification(Thread.currentThread()); aspectInterface.setMethodEntryWatch(syncMethod, new Object ()); 300 aspectInterface.resumeNotification(Thread.currentThread()); aspectInterface.suspendNotification(Thread.currentThread()); 302 } 303 304 startChronometer(); 305 for (int i = 0; i < RUNS; i++) obSync.syncMethodShort(); 306 stopChronometer(); 307 } 308 309 public void testSyncVirtualMethodExit_jp_activated_locked_NoArg() 311 { 312 if (useProse) { 313 aspectInterface.suspendNotification(Thread.currentThread()); 314 aspectInterface.setMethodExitWatch(syncMethod, new Object ()); 315 aspectInterface.resumeNotification(Thread.currentThread()); 316 aspectInterface.suspendNotification(Thread.currentThread()); 317 } 318 319 startChronometer(); 320 for (int i = 0; i < RUNS; i++) obSync.syncMethodShort(); 321 stopChronometer(); 322 } 323 324 public void testSyncVirtualMethodEntry_jp_activated_NoArg() 326 { 327 if (useProse) { 328 aspectInterface.suspendNotification(Thread.currentThread()); 329 aspectInterface.setMethodEntryWatch(syncMethod, new Object ()); 330 aspectInterface.resumeNotification(Thread.currentThread()); 331 } 332 333 startChronometer(); 334 for (int i = 0; i < RUNS; i++) obSync.syncMethodShort(); 335 stopChronometer(); 336 337 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 338 } 339 340 public void testSyncVirtualMethodExit_jp_activated_NoArg() 342 { 343 if (useProse) { 344 aspectInterface.suspendNotification(Thread.currentThread()); 345 aspectInterface.setMethodExitWatch(syncMethod, new Object ()); 346 aspectInterface.resumeNotification(Thread.currentThread()); 347 } 348 349 startChronometer(); 350 for (int i = 0; i < RUNS; i++) obSync.syncMethodShort(); 351 stopChronometer(); 352 353 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 354 } 355 356 358 public void testInterfaceMethod_no_jp_NoArg() 360 { 361 startChronometer(); 362 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodShort(); 363 stopChronometer(); 364 } 365 366 public void testInterfaceMethodEntry_jp_activated_locked_NoArg() 368 { 369 if (useProse) { 370 aspectInterface.suspendNotification(Thread.currentThread()); 371 aspectInterface.setMethodEntryWatch(interfaceMethod, new Object ()); 372 aspectInterface.resumeNotification(Thread.currentThread()); 373 aspectInterface.suspendNotification(Thread.currentThread()); 374 } 375 376 startChronometer(); 377 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodShort(); 378 stopChronometer(); 379 } 380 381 public void testInterfaceMethodExit_jp_activated_locked_NoArg() 383 { 384 if (useProse) { 385 aspectInterface.suspendNotification(Thread.currentThread()); 386 aspectInterface.setMethodExitWatch(interfaceMethod, new Object ()); 387 aspectInterface.resumeNotification(Thread.currentThread()); 388 aspectInterface.suspendNotification(Thread.currentThread()); 389 } 390 391 startChronometer(); 392 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodShort(); 393 stopChronometer(); 394 } 395 396 public void testInterfaceMethodEntry_jp_activated_NoArg() 398 { 399 if (useProse) { 400 aspectInterface.suspendNotification(Thread.currentThread()); 401 aspectInterface.setMethodEntryWatch(interfaceMethod, new Object ()); 402 aspectInterface.resumeNotification(Thread.currentThread()); 403 } 404 405 startChronometer(); 406 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodShort(); 407 stopChronometer(); 408 409 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 410 } 411 412 public void testInterfaceMethodExit_jp_activated_NoArg() 414 { 415 if (useProse) { 416 aspectInterface.suspendNotification(Thread.currentThread()); 417 aspectInterface.setMethodExitWatch(interfaceMethod, new Object ()); 418 aspectInterface.resumeNotification(Thread.currentThread()); 419 } 420 421 startChronometer(); 422 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodShort(); 423 stopChronometer(); 424 425 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 426 } 427 428 430 public void testStaticMethod_no_jp_NoArg() 432 { 433 startChronometer(); 434 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodShort(); 435 stopChronometer(); 436 } 437 438 public void testStaticMethodEntry_jp_activated_locked_NoArg() 440 { 441 if (useProse) { 442 aspectInterface.suspendNotification(Thread.currentThread()); 443 aspectInterface.setMethodEntryWatch(staticMethod, new Object ()); 444 aspectInterface.resumeNotification(Thread.currentThread()); 445 aspectInterface.suspendNotification(Thread.currentThread()); 446 } 447 448 startChronometer(); 449 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodShort(); 450 stopChronometer(); 451 } 452 453 public void testStaticMethodExit_jp_activated_locked_NoArg() 455 { 456 if (useProse) { 457 aspectInterface.suspendNotification(Thread.currentThread()); 458 aspectInterface.setMethodExitWatch(staticMethod, new Object ()); 459 aspectInterface.resumeNotification(Thread.currentThread()); 460 aspectInterface.suspendNotification(Thread.currentThread()); 461 } 462 463 startChronometer(); 464 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodShort(); 465 stopChronometer(); 466 } 467 468 public void testStaticMethodEntry_jp_activated_NoArg() 470 { 471 if (useProse) { 472 aspectInterface.suspendNotification(Thread.currentThread()); 473 aspectInterface.setMethodEntryWatch(staticMethod, new Object ()); 474 aspectInterface.resumeNotification(Thread.currentThread()); 475 } 476 477 startChronometer(); 478 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodShort(); 479 stopChronometer(); 480 481 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 482 } 483 484 public void testStaticMethodExit_jp_activated_NoArg() 486 { 487 if (useProse) { 488 aspectInterface.suspendNotification(Thread.currentThread()); 489 aspectInterface.setMethodExitWatch(staticMethod, new Object ()); 490 aspectInterface.resumeNotification(Thread.currentThread()); 491 } 492 493 startChronometer(); 494 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodShort(); 495 stopChronometer(); 496 497 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 498 } 499 500 502 public void testSpecialMethod_no_jp_NoArg() 504 { 505 startChronometer(); 506 for (int i = 0; i < RUNS; i++) privatelocalMethod(); 507 stopChronometer(); 508 } 509 510 public void testSpecialMethodEntry_jp_activated_locked_NoArg() 512 { 513 if (useProse) { 514 aspectInterface.suspendNotification(Thread.currentThread()); 515 aspectInterface.setMethodEntryWatch(privateMethod, new Object ()); 516 aspectInterface.resumeNotification(Thread.currentThread()); 517 aspectInterface.suspendNotification(Thread.currentThread()); 518 } 519 520 startChronometer(); 521 for (int i = 0; i < RUNS; i++) privatelocalMethod(); 522 stopChronometer(); 523 } 524 525 public void testSpecialMethodExit_jp_activated_locked_NoArg() 527 { 528 if (useProse) { 529 aspectInterface.suspendNotification(Thread.currentThread()); 530 aspectInterface.setMethodExitWatch(privateMethod, new Object ()); 531 aspectInterface.resumeNotification(Thread.currentThread()); 532 aspectInterface.suspendNotification(Thread.currentThread()); 533 } 534 535 startChronometer(); 536 for (int i = 0; i < RUNS; i++) privatelocalMethod(); 537 stopChronometer(); 538 } 539 540 public void testSpecialMethodEntry_jp_activated_NoArg() 542 { 543 if (useProse) { 544 aspectInterface.suspendNotification(Thread.currentThread()); 545 aspectInterface.setMethodEntryWatch(privateMethod, new Object ()); 546 aspectInterface.resumeNotification(Thread.currentThread()); 547 } 548 549 startChronometer(); 550 for (int i = 0; i < RUNS; i++) privatelocalMethod(); 551 stopChronometer(); 552 553 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 554 } 555 556 public void testSpecialMethodExit_jp_activated_NoArg() 558 { 559 if (useProse) { 560 aspectInterface.suspendNotification(Thread.currentThread()); 561 aspectInterface.setMethodExitWatch(privateMethod, new Object ()); 562 aspectInterface.resumeNotification(Thread.currentThread()); 563 } 564 565 startChronometer(); 566 for (int i = 0; i < RUNS; i++) privatelocalMethod(); 567 stopChronometer(); 568 569 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 570 } 571 572 574 public void testFieldAccess_no_jp_NoArg() 576 { 577 this.theFieldAccess(RUNS); 578 } 579 580 public void testFieldAccess_jp_activated_locked_NoArg() 582 { 583 if (useProse) { 584 aspectInterface.suspendNotification(Thread.currentThread()); 585 aspectInterface.setFieldAccessWatch(field, new Object ()); 586 aspectInterface.resumeNotification(Thread.currentThread()); 587 aspectInterface.suspendNotification(Thread.currentThread()); 588 } 589 590 this.theFieldAccess(RUNS); 591 } 592 593 public void testFieldAccess_jp_activated_NoArg() 595 { 596 if (useProse) { 597 aspectInterface.suspendNotification(Thread.currentThread()); 598 aspectInterface.setFieldAccessWatch(field, new Object ()); 599 aspectInterface.resumeNotification(Thread.currentThread()); 600 } 601 602 this.theFieldAccess(RUNS); 603 604 if (checkAssert) assertEquals("Hook notifications", RUNS, fieldAccessCount); 605 } 606 607 609 public void testFieldModification_no_jp_NoArg() 611 { 612 this.theFieldModification(RUNS); 613 } 614 615 public void testFieldModification_jp_activated_locked_NoArg() 617 { 618 if (useProse) { 619 aspectInterface.suspendNotification(Thread.currentThread()); 620 aspectInterface.setFieldModificationWatch(field, new Object ()); 621 aspectInterface.resumeNotification(Thread.currentThread()); 622 aspectInterface.suspendNotification(Thread.currentThread()); 623 } 624 625 this.theFieldModification(RUNS); 626 } 627 628 public void testFieldModification_jp_activated_NoArg() 630 { 631 if (useProse) { 632 aspectInterface.suspendNotification(Thread.currentThread()); 633 aspectInterface.setFieldModificationWatch(field, new Object ()); 634 aspectInterface.resumeNotification(Thread.currentThread()); 635 } 636 637 this.theFieldModification(RUNS); 638 639 if (checkAssert) assertEquals("Hook notifications", RUNS, fieldModificationCount); 640 } 641 642 644 public void exceptionThrow() throws TestException { 645 throw exception; 646 } 647 648 public void exceptionCatch() { 649 try { 650 exceptionThrow(); 651 } catch (TestException e) {} 652 } 653 654 656 public void testExceptionThrow_no_jp_NoArg() 658 { 659 TestException e = new TestException(); 661 662 startChronometer(); 663 for (int i = 0; i < RUNS; i++) exceptionCatch(); 664 stopChronometer(); 665 } 666 667 public void testExceptionThrow_jp_activated_locked_NoArg() 669 { 670 if (useProse) { 671 aspectInterface.suspendNotification(Thread.currentThread()); 672 aspectInterface.setExceptionThrowWatch(TestException.class, new Object ()); 673 aspectInterface.resumeNotification(Thread.currentThread()); 674 aspectInterface.suspendNotification(Thread.currentThread()); 675 } 676 677 TestException e = new TestException(); 679 680 startChronometer(); 681 for (int i = 0; i < RUNS; i++) exceptionCatch(); 682 stopChronometer(); 683 } 684 685 public void testExceptionThrow_jp_activated_NoArg() 687 { 688 if (useProse) { 689 aspectInterface.suspendNotification(Thread.currentThread()); 690 aspectInterface.setExceptionThrowWatch(TestException.class, new Object ()); 691 aspectInterface.resumeNotification(Thread.currentThread()); 692 } 693 694 TestException e = new TestException(); 696 697 startChronometer(); 698 for (int i = 0; i < RUNS; i++) exceptionCatch(); 699 stopChronometer(); 700 701 if (checkAssert) assertEquals("Hook notifications", RUNS, exceptionThrowCount); 702 } 703 704 706 public void testExceptionCatch_no_jp_NoArg() 708 { 709 TestException e = new TestException(); 711 712 startChronometer(); 713 for (int i = 0; i < RUNS; i++) exceptionCatch(); 714 stopChronometer(); 715 } 716 717 public void testExceptionCatch_jp_activated_locked_NoArg() { 719 if (useProse) { 720 aspectInterface.suspendNotification(Thread.currentThread()); 721 aspectInterface.setExceptionCatchWatch(TestException.class, new Object ()); 722 aspectInterface.resumeNotification(Thread.currentThread()); 723 aspectInterface.suspendNotification(Thread.currentThread()); 724 } 725 726 TestException e = new TestException(); 728 729 startChronometer(); 730 for (int i = 0; i < RUNS; i++) exceptionCatch(); 731 stopChronometer(); 732 } 733 734 public void testExceptionCatch_jp_activated_NoArg() 736 { 737 if (useProse) { 738 aspectInterface.suspendNotification(Thread.currentThread()); 739 aspectInterface.setExceptionCatchWatch(TestException.class, new Object ()); 740 aspectInterface.resumeNotification(Thread.currentThread()); 741 } 742 743 TestException e = new TestException(); 745 746 startChronometer(); 747 for (int i = 0; i < RUNS; i++) exceptionCatch(); 748 stopChronometer(); 749 750 if (checkAssert) assertEquals("Hook notifications", RUNS, exceptionCatchCount); 751 } 752 753 754 760 763 public void testVirtualMethod_LongO() 765 { 766 Object obj = new Object (); 767 startChronometer(); 768 for (int i = 0; i < RUNS; i++) localMethodLongO(obj, obj); 769 stopChronometer(); 770 } 771 804 public void testVirtualMethodEntry_jp_activated_LongO() 806 { 807 Object obj = new Object (); 808 if (useProse) { 809 aspectInterface.suspendNotification(Thread.currentThread()); 810 aspectInterface.setMethodEntryWatch(methodLongO, new Object ()); 811 aspectInterface.resumeNotification(Thread.currentThread()); 812 } 813 814 startChronometer(); 815 for (int i = 0; i < RUNS; i++) localMethodLongO(obj, obj); 816 stopChronometer(); 817 818 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 819 } 820 821 public void testVirtualMethodExit_jp_activated_LongO() 823 { 824 Object obj = new Object (); 825 if (useProse) { 826 aspectInterface.suspendNotification(Thread.currentThread()); 827 aspectInterface.setMethodExitWatch(methodLongO, new Object ()); 828 aspectInterface.resumeNotification(Thread.currentThread()); 829 } 830 831 startChronometer(); 832 for (int i = 0; i < RUNS; i++) localMethodLongO(obj, obj); 833 stopChronometer(); 834 835 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 836 } 837 838 840 public void testSyncVirtualMethod_LongO() 842 { 843 Object obj = new Object (); 844 startChronometer(); 845 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongO(obj, obj); 846 stopChronometer(); 847 } 848 881 public void testSyncVirtualMethodEntry_jp_activated_LongO() 883 { 884 Object obj = new Object (); 885 if (useProse) { 886 aspectInterface.suspendNotification(Thread.currentThread()); 887 aspectInterface.setMethodEntryWatch(syncMethodLongO, new Object ()); 888 aspectInterface.resumeNotification(Thread.currentThread()); 889 } 890 891 startChronometer(); 892 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongO(obj, obj); 893 stopChronometer(); 894 895 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 896 } 897 898 public void testSyncVirtualMethodExit_jp_activated_LongO() 900 { 901 Object obj = new Object (); 902 if (useProse) { 903 aspectInterface.suspendNotification(Thread.currentThread()); 904 aspectInterface.setMethodExitWatch(syncMethodLongO, new Object ()); 905 aspectInterface.resumeNotification(Thread.currentThread()); 906 } 907 908 startChronometer(); 909 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongO(obj, obj); 910 stopChronometer(); 911 912 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 913 } 914 915 917 public void testInterfaceMethod_LongO() 919 { 920 Object obj = new Object (); 921 startChronometer(); 922 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongO(obj, obj); 923 stopChronometer(); 924 } 925 958 public void testInterfaceMethodEntry_jp_activated_LongO() 960 { 961 Object obj = new Object (); 962 if (useProse) { 963 aspectInterface.suspendNotification(Thread.currentThread()); 964 aspectInterface.setMethodEntryWatch(interfaceMethodLongO, new Object ()); 965 aspectInterface.resumeNotification(Thread.currentThread()); 966 } 967 968 startChronometer(); 969 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongO(obj, obj); 970 stopChronometer(); 971 972 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 973 } 974 975 public void testInterfaceMethodExit_jp_activated_LongO() 977 { 978 Object obj = new Object (); 979 if (useProse) { 980 aspectInterface.suspendNotification(Thread.currentThread()); 981 aspectInterface.setMethodExitWatch(interfaceMethodLongO, new Object ()); 982 aspectInterface.resumeNotification(Thread.currentThread()); 983 } 984 985 startChronometer(); 986 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongO(obj, obj); 987 stopChronometer(); 988 989 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 990 } 991 992 994 public void testStaticMethod_LongO() 996 { 997 Object obj = new Object (); 998 startChronometer(); 999 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongO(obj, obj); 1000 stopChronometer(); 1001 } 1002 1035 public void testStaticMethodEntry_jp_activated_LongO() 1037 { 1038 Object obj = new Object (); 1039 if (useProse) { 1040 aspectInterface.suspendNotification(Thread.currentThread()); 1041 aspectInterface.setMethodEntryWatch(staticMethodLongO, new Object ()); 1042 aspectInterface.resumeNotification(Thread.currentThread()); 1043 } 1044 1045 startChronometer(); 1046 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongO(obj, obj); 1047 stopChronometer(); 1048 1049 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1050 } 1051 1052 public void testStaticMethodExit_jp_activated_LongO() 1054 { 1055 Object obj = new Object (); 1056 if (useProse) { 1057 aspectInterface.suspendNotification(Thread.currentThread()); 1058 aspectInterface.setMethodExitWatch(staticMethodLongO, new Object ()); 1059 aspectInterface.resumeNotification(Thread.currentThread()); 1060 } 1061 1062 startChronometer(); 1063 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongO(obj, obj); 1064 stopChronometer(); 1065 1066 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 1067 } 1068 1069 1071 public void testSpecialMethod_LongO() 1073 { 1074 Object obj = new Object (); 1075 startChronometer(); 1076 for (int i = 0; i < RUNS; i++) privatelocalMethodLongO(obj, obj); 1077 stopChronometer(); 1078 } 1079 1112 public void testSpecialMethodEntry_jp_activated_LongO() 1114 { 1115 Object obj = new Object (); 1116 if (useProse) { 1117 aspectInterface.suspendNotification(Thread.currentThread()); 1118 aspectInterface.setMethodEntryWatch(privateMethodLongO, new Object ()); 1119 aspectInterface.resumeNotification(Thread.currentThread()); 1120 } 1121 1122 startChronometer(); 1123 for (int i = 0; i < RUNS; i++) privatelocalMethodLongO(obj, obj); 1124 stopChronometer(); 1125 1126 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1127 } 1128 1129 public void testSpecialMethodExit_jp_activated_LongO() 1131 { 1132 Object obj = new Object (); 1133 if (useProse) { 1134 aspectInterface.suspendNotification(Thread.currentThread()); 1135 aspectInterface.setMethodExitWatch(privateMethodLongO, new Object ()); 1136 aspectInterface.resumeNotification(Thread.currentThread()); 1137 } 1138 1139 startChronometer(); 1140 for (int i = 0; i < RUNS; i++) privatelocalMethodLongO(obj, obj); 1141 stopChronometer(); 1142 1143 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 1144 } 1145 1146 1149 1150 1153 public void testVirtualMethod_LongI() 1155 { 1156 int obj = 1; 1157 startChronometer(); 1158 for (int i = 0; i < RUNS; i++) localMethodLongI(obj, obj); 1159 stopChronometer(); 1160 } 1161 1194 public void testVirtualMethodEntry_jp_activated_LongI() 1196 { 1197 int obj = 1; 1198 if (useProse) { 1199 aspectInterface.suspendNotification(Thread.currentThread()); 1200 aspectInterface.setMethodEntryWatch(methodLongI, new Object ()); 1201 aspectInterface.resumeNotification(Thread.currentThread()); 1202 } 1203 1204 startChronometer(); 1205 for (int i = 0; i < RUNS; i++) localMethodLongI(obj, obj); 1206 stopChronometer(); 1207 1208 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1209 } 1210 1211 public void testVirtualMethodExit_jp_activated_LongI() 1213 { 1214 int obj = 1; 1215 if (useProse) { 1216 aspectInterface.suspendNotification(Thread.currentThread()); 1217 aspectInterface.setMethodExitWatch(methodLongI, new Object ()); 1218 aspectInterface.resumeNotification(Thread.currentThread()); 1219 } 1220 1221 startChronometer(); 1222 for (int i = 0; i < RUNS; i++) localMethodLongI(obj, obj); 1223 stopChronometer(); 1224 1225 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 1226 } 1227 1228 1230 public void testSyncVirtualMethod_LongI() 1232 { 1233 int obj = 1; 1234 startChronometer(); 1235 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongI(obj, obj); 1236 stopChronometer(); 1237 } 1238 1271 public void testSyncVirtualMethodEntry_jp_activated_LongI() 1273 { 1274 int obj = 1; 1275 if (useProse) { 1276 aspectInterface.suspendNotification(Thread.currentThread()); 1277 aspectInterface.setMethodEntryWatch(syncMethodLongI, new Object ()); 1278 aspectInterface.resumeNotification(Thread.currentThread()); 1279 } 1280 1281 startChronometer(); 1282 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongI(obj, obj); 1283 stopChronometer(); 1284 1285 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1286 } 1287 1288 public void testSyncVirtualMethodExit_jp_activated_LongI() 1290 { 1291 int obj = 1; 1292 if (useProse) { 1293 aspectInterface.suspendNotification(Thread.currentThread()); 1294 aspectInterface.setMethodExitWatch(syncMethodLongI, new Object ()); 1295 aspectInterface.resumeNotification(Thread.currentThread()); 1296 } 1297 1298 startChronometer(); 1299 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongI(obj, obj); 1300 stopChronometer(); 1301 1302 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 1303 } 1304 1305 1307 public void testInterfaceMethod_LongI() 1309 { 1310 int obj = 1; 1311 startChronometer(); 1312 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongI(obj, obj); 1313 stopChronometer(); 1314 } 1315 1348 public void testInterfaceMethodEntry_jp_activated_LongI() 1350 { 1351 int obj = 1; 1352 if (useProse) { 1353 aspectInterface.suspendNotification(Thread.currentThread()); 1354 aspectInterface.setMethodEntryWatch(interfaceMethodLongI, new Object ()); 1355 aspectInterface.resumeNotification(Thread.currentThread()); 1356 } 1357 1358 startChronometer(); 1359 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongI(obj, obj); 1360 stopChronometer(); 1361 1362 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1363 } 1364 1365 public void testInterfaceMethodExit_jp_activated_LongI() 1367 { 1368 int obj = 1; 1369 if (useProse) { 1370 aspectInterface.suspendNotification(Thread.currentThread()); 1371 aspectInterface.setMethodExitWatch(interfaceMethodLongI, new Object ()); 1372 aspectInterface.resumeNotification(Thread.currentThread()); 1373 } 1374 1375 startChronometer(); 1376 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongI(obj, obj); 1377 stopChronometer(); 1378 1379 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 1380 } 1381 1382 1384 public void testStaticMethod_LongI() 1386 { 1387 int obj = 1; 1388 startChronometer(); 1389 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongI(obj, obj); 1390 stopChronometer(); 1391 } 1392 1425 public void testStaticMethodEntry_jp_activated_LongI() 1427 { 1428 int obj = 1; 1429 if (useProse) { 1430 aspectInterface.suspendNotification(Thread.currentThread()); 1431 aspectInterface.setMethodEntryWatch(staticMethodLongI, new Object ()); 1432 aspectInterface.resumeNotification(Thread.currentThread()); 1433 } 1434 1435 startChronometer(); 1436 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongI(obj, obj); 1437 stopChronometer(); 1438 1439 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1440 } 1441 1442 public void testStaticMethodExit_jp_activated_LongI() 1444 { 1445 int obj = 1; 1446 if (useProse) { 1447 aspectInterface.suspendNotification(Thread.currentThread()); 1448 aspectInterface.setMethodExitWatch(staticMethodLongI, new Object ()); 1449 aspectInterface.resumeNotification(Thread.currentThread()); 1450 } 1451 1452 startChronometer(); 1453 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongI(obj, obj); 1454 stopChronometer(); 1455 1456 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 1457 } 1458 1459 1461 public void testSpecialMethod_LongI() 1463 { 1464 int obj = 1; 1465 startChronometer(); 1466 for (int i = 0; i < RUNS; i++) privatelocalMethodLongI(obj, obj); 1467 stopChronometer(); 1468 } 1469 1502 public void testSpecialMethodEntry_jp_activated_LongI() 1504 { 1505 int obj = 1; 1506 if (useProse) { 1507 aspectInterface.suspendNotification(Thread.currentThread()); 1508 aspectInterface.setMethodEntryWatch(privateMethodLongI, new Object ()); 1509 aspectInterface.resumeNotification(Thread.currentThread()); 1510 } 1511 1512 startChronometer(); 1513 for (int i = 0; i < RUNS; i++) privatelocalMethodLongI(obj, obj); 1514 stopChronometer(); 1515 1516 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1517 } 1518 1519 public void testSpecialMethodExit_jp_activated_LongI() 1521 { 1522 int obj = 1; 1523 if (useProse) { 1524 aspectInterface.suspendNotification(Thread.currentThread()); 1525 aspectInterface.setMethodExitWatch(privateMethodLongI, new Object ()); 1526 aspectInterface.resumeNotification(Thread.currentThread()); 1527 } 1528 1529 startChronometer(); 1530 for (int i = 0; i < RUNS; i++) privatelocalMethodLongI(obj, obj); 1531 stopChronometer(); 1532 1533 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 1534 } 1535 1536 1539 1540 1543 public void testVirtualMethod_LongL() 1545 { 1546 long obj = 1; 1547 startChronometer(); 1548 for (int i = 0; i < RUNS; i++) localMethodLongL(obj, obj); 1549 stopChronometer(); 1550 } 1551 1584 public void testVirtualMethodEntry_jp_activated_LongL() 1586 { 1587 long obj = 1; 1588 if (useProse) { 1589 aspectInterface.suspendNotification(Thread.currentThread()); 1590 aspectInterface.setMethodEntryWatch(methodLongL, new Object ()); 1591 aspectInterface.resumeNotification(Thread.currentThread()); 1592 } 1593 1594 startChronometer(); 1595 for (int i = 0; i < RUNS; i++) localMethodLongL(obj, obj); 1596 stopChronometer(); 1597 1598 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1599 } 1600 1601 public void testVirtualMethodExit_jp_activated_LongL() 1603 { 1604 long obj = 1; 1605 if (useProse) { 1606 aspectInterface.suspendNotification(Thread.currentThread()); 1607 aspectInterface.setMethodExitWatch(methodLongL, new Object ()); 1608 aspectInterface.resumeNotification(Thread.currentThread()); 1609 } 1610 1611 startChronometer(); 1612 for (int i = 0; i < RUNS; i++) localMethodLongL(obj, obj); 1613 stopChronometer(); 1614 1615 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 1616 } 1617 1618 1620 public void testSyncVirtualMethod_LongL() 1622 { 1623 long obj = 1; 1624 startChronometer(); 1625 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongL(obj, obj); 1626 stopChronometer(); 1627 } 1628 1661 public void testSyncVirtualMethodEntry_jp_activated_LongL() 1663 { 1664 long obj = 1; 1665 if (useProse) { 1666 aspectInterface.suspendNotification(Thread.currentThread()); 1667 aspectInterface.setMethodEntryWatch(syncMethodLongL, new Object ()); 1668 aspectInterface.resumeNotification(Thread.currentThread()); 1669 } 1670 1671 startChronometer(); 1672 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongL(obj, obj); 1673 stopChronometer(); 1674 1675 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1676 } 1677 1678 public void testSyncVirtualMethodExit_jp_activated_LongL() 1680 { 1681 long obj = 1; 1682 if (useProse) { 1683 aspectInterface.suspendNotification(Thread.currentThread()); 1684 aspectInterface.setMethodExitWatch(syncMethodLongL, new Object ()); 1685 aspectInterface.resumeNotification(Thread.currentThread()); 1686 } 1687 1688 startChronometer(); 1689 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongL(obj, obj); 1690 stopChronometer(); 1691 1692 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 1693 } 1694 1695 1697 public void testInterfaceMethod_LongL() 1699 { 1700 long obj = 1; 1701 startChronometer(); 1702 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongL(obj, obj); 1703 stopChronometer(); 1704 } 1705 1737 public void testInterfaceMethodEntry_jp_activated_LongL() 1739 { 1740 long obj = 1; 1741 if (useProse) { 1742 aspectInterface.suspendNotification(Thread.currentThread()); 1743 aspectInterface.setMethodEntryWatch(interfaceMethodLongL, new Object ()); 1744 aspectInterface.resumeNotification(Thread.currentThread()); 1745 } 1746 1747 startChronometer(); 1748 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongL(obj, obj); 1749 stopChronometer(); 1750 1751 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1752 } 1753 1754 public void testInterfaceMethodExit_jp_activated_LongL() 1756 { 1757 long obj = 1; 1758 if (useProse) { 1759 aspectInterface.suspendNotification(Thread.currentThread()); 1760 aspectInterface.setMethodExitWatch(interfaceMethodLongL, new Object ()); 1761 aspectInterface.resumeNotification(Thread.currentThread()); 1762 } 1763 1764 startChronometer(); 1765 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongL(obj, obj); 1766 stopChronometer(); 1767 1768 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 1769 } 1770 1771 1773 public void testStaticMethod_LongL() 1775 { 1776 long obj = 1; 1777 startChronometer(); 1778 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongL(obj, obj); 1779 stopChronometer(); 1780 } 1781 1814 public void testStaticMethodEntry_jp_activated_LongL() 1816 { 1817 long obj = 1; 1818 if (useProse) { 1819 aspectInterface.suspendNotification(Thread.currentThread()); 1820 aspectInterface.setMethodEntryWatch(staticMethodLongL, new Object ()); 1821 aspectInterface.resumeNotification(Thread.currentThread()); 1822 } 1823 1824 startChronometer(); 1825 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongL(obj, obj); 1826 stopChronometer(); 1827 1828 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1829 } 1830 1831 public void testStaticMethodExit_jp_activated_LongL() 1833 { 1834 long obj = 1; 1835 if (useProse) { 1836 aspectInterface.suspendNotification(Thread.currentThread()); 1837 aspectInterface.setMethodExitWatch(staticMethodLongL, new Object ()); 1838 aspectInterface.resumeNotification(Thread.currentThread()); 1839 } 1840 1841 startChronometer(); 1842 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongL(obj, obj); 1843 stopChronometer(); 1844 1845 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 1846 } 1847 1848 1850 public void testSpecialMethod_LongL() 1852 { 1853 long obj = 1; 1854 startChronometer(); 1855 for (int i = 0; i < RUNS; i++) privatelocalMethodLongL(obj, obj); 1856 stopChronometer(); 1857 } 1858 1891 public void testSpecialMethodEntry_jp_activated_LongL() 1893 { 1894 long obj = 1; 1895 if (useProse) { 1896 aspectInterface.suspendNotification(Thread.currentThread()); 1897 aspectInterface.setMethodEntryWatch(privateMethodLongL, new Object ()); 1898 aspectInterface.resumeNotification(Thread.currentThread()); 1899 } 1900 1901 startChronometer(); 1902 for (int i = 0; i < RUNS; i++) privatelocalMethodLongL(obj, obj); 1903 stopChronometer(); 1904 1905 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1906 } 1907 1908 public void testSpecialMethodExit_jp_activated_LongL() 1910 { 1911 long obj = 1; 1912 if (useProse) { 1913 aspectInterface.suspendNotification(Thread.currentThread()); 1914 aspectInterface.setMethodExitWatch(privateMethodLongL, new Object ()); 1915 aspectInterface.resumeNotification(Thread.currentThread()); 1916 } 1917 1918 startChronometer(); 1919 for (int i = 0; i < RUNS; i++) privatelocalMethodLongL(obj, obj); 1920 stopChronometer(); 1921 1922 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 1923 } 1924 1925 1928 1929 1932 public void testVirtualMethod_LongD() 1934 { 1935 double obj = 10.1; 1936 startChronometer(); 1937 for (int i = 0; i < RUNS; i++) localMethodLongD(obj, obj); 1938 stopChronometer(); 1939 } 1940 1973 public void testVirtualMethodEntry_jp_activated_LongD() 1975 { 1976 double obj = 10.1; 1977 if (useProse) { 1978 aspectInterface.suspendNotification(Thread.currentThread()); 1979 aspectInterface.setMethodEntryWatch(methodLongD, new Object ()); 1980 aspectInterface.resumeNotification(Thread.currentThread()); 1981 } 1982 1983 startChronometer(); 1984 for (int i = 0; i < RUNS; i++) localMethodLongD(obj, obj); 1985 stopChronometer(); 1986 1987 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 1988 } 1989 1990 public void testVirtualMethodExit_jp_activated_LongD() 1992 { 1993 double obj = 10.1; 1994 if (useProse) { 1995 aspectInterface.suspendNotification(Thread.currentThread()); 1996 aspectInterface.setMethodExitWatch(methodLongD, new Object ()); 1997 aspectInterface.resumeNotification(Thread.currentThread()); 1998 } 1999 2000 startChronometer(); 2001 for (int i = 0; i < RUNS; i++) localMethodLongD(obj, obj); 2002 stopChronometer(); 2003 2004 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 2005 } 2006 2007 2008 2010 public void testSyncVirtualMethod_LongD() 2012 { 2013 double obj = 10.1; 2014 startChronometer(); 2015 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongD(obj, obj); 2016 stopChronometer(); 2017 } 2018 2051 public void testSyncVirtualMethodEntry_jp_activated_LongD() 2053 { 2054 double obj = 10.1; 2055 if (useProse) { 2056 aspectInterface.suspendNotification(Thread.currentThread()); 2057 aspectInterface.setMethodEntryWatch(syncMethodLongD, new Object ()); 2058 aspectInterface.resumeNotification(Thread.currentThread()); 2059 } 2060 2061 startChronometer(); 2062 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongD(obj, obj); 2063 stopChronometer(); 2064 2065 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 2066 } 2067 2068 public void testSyncVirtualMethodExit_jp_activated_LongD() 2070 { 2071 double obj = 10.1; 2072 if (useProse) { 2073 aspectInterface.suspendNotification(Thread.currentThread()); 2074 aspectInterface.setMethodExitWatch(syncMethodLongD, new Object ()); 2075 aspectInterface.resumeNotification(Thread.currentThread()); 2076 } 2077 2078 startChronometer(); 2079 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongD(obj, obj); 2080 stopChronometer(); 2081 2082 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 2083 } 2084 2085 2087 public void testInterfaceMethod_LongD() 2089 { 2090 double obj = 10.1; 2091 startChronometer(); 2092 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongD(obj, obj); 2093 stopChronometer(); 2094 } 2095 2128 public void testInterfaceMethodEntry_jp_activated_LongD() 2130 { 2131 double obj = 10.1; 2132 if (useProse) { 2133 aspectInterface.suspendNotification(Thread.currentThread()); 2134 aspectInterface.setMethodEntryWatch(interfaceMethodLongD, new Object ()); 2135 aspectInterface.resumeNotification(Thread.currentThread()); 2136 } 2137 2138 startChronometer(); 2139 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongD(obj, obj); 2140 stopChronometer(); 2141 2142 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 2143 } 2144 2145 public void testInterfaceMethodExit_jp_activated_LongD() 2147 { 2148 double obj = 10.1; 2149 if (useProse) { 2150 aspectInterface.suspendNotification(Thread.currentThread()); 2151 aspectInterface.setMethodExitWatch(interfaceMethodLongD, new Object ()); 2152 aspectInterface.resumeNotification(Thread.currentThread()); 2153 } 2154 2155 startChronometer(); 2156 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongD(obj, obj); 2157 stopChronometer(); 2158 2159 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 2160 } 2161 2162 2164 public void testStaticMethod_LongD() 2166 { 2167 double obj = 10.1; 2168 startChronometer(); 2169 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongD(obj, obj); 2170 stopChronometer(); 2171 } 2172 2205 public void testStaticMethodEntry_jp_activated_LongD() 2207 { 2208 double obj = 10.1; 2209 if (useProse) { 2210 aspectInterface.suspendNotification(Thread.currentThread()); 2211 aspectInterface.setMethodEntryWatch(staticMethodLongD, new Object ()); 2212 aspectInterface.resumeNotification(Thread.currentThread()); 2213 } 2214 2215 startChronometer(); 2216 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongD(obj, obj); 2217 stopChronometer(); 2218 2219 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 2220 } 2221 2222 public void testStaticMethodExit_jp_activated_LongD() 2224 { 2225 double obj = 10.1; 2226 if (useProse) { 2227 aspectInterface.suspendNotification(Thread.currentThread()); 2228 aspectInterface.setMethodExitWatch(staticMethodLongD, new Object ()); 2229 aspectInterface.resumeNotification(Thread.currentThread()); 2230 } 2231 2232 startChronometer(); 2233 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongD(obj, obj); 2234 stopChronometer(); 2235 2236 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 2237 } 2238 2239 2241 public void testSpecialMethod_LongD() 2243 { 2244 double obj = 10.1; 2245 startChronometer(); 2246 for (int i = 0; i < RUNS; i++) privatelocalMethodLongD(obj, obj); 2247 stopChronometer(); 2248 } 2249 2282 public void testSpecialMethodEntry_jp_activated_LongD() 2284 { 2285 double obj = 10.1; 2286 if (useProse) { 2287 aspectInterface.suspendNotification(Thread.currentThread()); 2288 aspectInterface.setMethodEntryWatch(privateMethodLongD, new Object ()); 2289 aspectInterface.resumeNotification(Thread.currentThread()); 2290 } 2291 2292 startChronometer(); 2293 for (int i = 0; i < RUNS; i++) privatelocalMethodLongD(obj, obj); 2294 stopChronometer(); 2295 2296 if (checkAssert) assertEquals("Hook notifications", RUNS, methodEntryCount); 2297 } 2298 2299 public void testSpecialMethodExit_jp_activated_LongD() 2301 { 2302 double obj = 10.1; 2303 if (useProse) { 2304 aspectInterface.suspendNotification(Thread.currentThread()); 2305 aspectInterface.setMethodExitWatch(privateMethodLongD, new Object ()); 2306 aspectInterface.resumeNotification(Thread.currentThread()); 2307 } 2308 2309 startChronometer(); 2310 for (int i = 0; i < RUNS; i++) privatelocalMethodLongD(obj, obj); 2311 stopChronometer(); 2312 2313 if (checkAssert) assertEquals("Hook notifications", RUNS, methodExitCount); 2314 } 2315 2316 2319 public static Test suite() { 2320 return new PerformanceTestSuite(JoinPointMeasurements1.class); 2321 } 2322 2323} | Popular Tags |