1 package measurements.suites; 2 3 import junit.framework.Test; 4 import junit.framework.Assert; 5 import ch.ethz.inf.util.junit.PerformanceTest; 6 import ch.ethz.inf.util.junit.PerformanceTestSuite; 7 import ch.ethz.prose.ProseSystem; 8 import ch.ethz.prose.DefaultAspect; 9 import ch.ethz.prose.Aspect; 10 import ch.ethz.prose.crosscut.Crosscut; 11 import ch.ethz.prose.crosscut.MethodCut; 12 import ch.ethz.prose.crosscut.REST; 13 import ch.ethz.prose.filter.PointCutter; 14 import ch.ethz.prose.filter.Executions; 15 import ch.ethz.prose.filter.Within; 16 import ch.ethz.jvmai.MethodEntryJoinPoint; 17 import ch.ethz.jvmai.MethodExitJoinPoint; 18 19 20 21 41 public class JoinPointMeasurements1_micro extends PerformanceTest { 42 43 public boolean useProse = false; 44 public boolean checkAssert = true; 45 46 public static int counter=0; 47 48 public void localMethod() { } 50 public void localMethodLongO(Object ob1, Object ob2) { } 51 public void localMethodLongI(int ob1, int ob2) { } 52 public void localMethodLongL(long ob1, long ob2) { } 53 public void localMethodLongD(double ob1, double ob2) { } 54 55 private void privatelocalMethod() { } 57 private void privatelocalMethodLongO(Object ob1, Object ob2) { } 58 private void privatelocalMethodLongI(int ob1, int ob2) { } 59 private void privatelocalMethodLongL(long ob1, long ob2) { } 60 private void privatelocalMethodLongD(double ob1, double ob2) { } 61 62 protected JoinPointTestInterface obInterface = new JoinPointTestClass(); 64 65 protected JoinPointTestClass obSync = new JoinPointTestClass(); 67 68 69 public class MethodEntryAspect_1 extends DefaultAspect 71 { 72 public Crosscut c1 = new MethodCut() 73 { 74 public void METHOD_ARGS(JoinPointMeasurements1_micro target, REST args) 76 { 77 counter++; 78 } 79 80 protected PointCutter pointCutter() 82 { 83 return ( (Executions.before()) . AND 84 ( 85 ( (Within.method("^localMethod.*")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR 86 ( (Within.method("^privatelocalMethod.*")) . AND (Within.type("JoinPointMeasurements1_micro")) ) 87 99 ) 100 ); 101 } 102 }; 103 } 104 105 public class MethodExitAspect_1 extends DefaultAspect 107 { 108 public Crosscut c2 = new MethodCut() 109 { 110 public void METHOD_ARGS(JoinPointMeasurements1_micro target, REST args) 112 { 113 counter++; 114 } 115 116 protected PointCutter pointCutter() 118 { 119 return ( (Executions.after()) . AND 120 ( 121 ( (Within.method("^localMethod.*")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR 122 ( (Within.method("^privatelocalMethod.*")) . AND (Within.type("JoinPointMeasurements1_micro")) ) 123 135 ) 136 ); 137 } 138 }; 139 } 140 141 public class MethodEntryAspect_2 extends DefaultAspect 143 { 144 public Crosscut c3 = new MethodCut() 145 { 146 public void METHOD_ARGS(JoinPointTestClass target, REST args) 148 { 149 counter++; 150 } 151 152 protected PointCutter pointCutter() 154 { 155 return ( (Executions.before()) . AND 156 ( 157 ( (Within.method("^interfaceMethod.*")) . AND (Within.type("JoinPointTestClass")) ) . OR 158 ( (Within.method("^syncMethod.*")) . AND (Within.type("JoinPointTestClass")) ) . OR 159 ( (Within.method("^staticMethod.*")) . AND (Within.type("JoinPointTestClass")) ) 160 ) 161 ); 162 } 163 }; 164 } 165 166 public class MethodExitAspect_2 extends DefaultAspect 168 { 169 public Crosscut c4 = new MethodCut() 170 { 171 public void METHOD_ARGS(JoinPointTestClass target, REST args) 173 { 174 counter++; 175 } 176 177 protected PointCutter pointCutter() 179 { 180 return ( (Executions.after()) . AND 181 ( 182 ( (Within.method("^interfaceMethod.*")) . AND (Within.type("JoinPointTestClass")) ) . OR 183 ( (Within.method("^syncMethod.*")) . AND (Within.type("JoinPointTestClass")) ) . OR 184 ( (Within.method("^staticMethod.*")) . AND (Within.type("JoinPointTestClass")) ) 185 ) 186 ); 187 } 188 }; 189 } 190 191 Aspect aspect1; Aspect aspect2; Aspect aspect3; Aspect aspect4; 196 197 public JoinPointMeasurements1_micro(String name) { 198 super(name); 199 RANGE = new int[] { 10000 }; 202 204 String proseParam = System.getProperty("useprose"); 205 if (proseParam != null) useProse = true; 206 } 207 208 protected void setUp() throws Exception 209 { 210 211 if (!useProse) return; 212 213 try { 214 ProseSystem.startup(); 215 } catch (Exception e) { 216 Assert.fail("ProseSystem.startup() failed"); 217 } 218 219 aspect1 = new MethodEntryAspect_1(); 220 aspect2 = new MethodExitAspect_1(); 221 aspect3 = new MethodEntryAspect_2(); 222 aspect4 = new MethodExitAspect_2(); 223 224 counter=0; 225 } 226 227 protected void tearDown() 228 { 229 if (!useProse) return; 230 231 try { 232 ProseSystem.teardown(); 233 } catch (Exception e) { 234 Assert.fail("ProseSystem.teardown() failed"); 235 } 236 } 237 238 248 public void testVirtualMethodEntry_jp_activated_NoArg() 250 { 251 if (useProse) ProseSystem.getAspectManager().insert(aspect1); 252 253 startChronometer(); 254 for (int i = 0; i < RUNS; i++) localMethod(); 255 stopChronometer(); 256 257 if (useProse) ProseSystem.getAspectManager().withdraw(aspect1); 258 259 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 260 } 261 262 public void testVirtualMethodExit_jp_activated_NoArg() 264 { 265 if (useProse) ProseSystem.getAspectManager().insert(aspect2); 266 267 startChronometer(); 268 for (int i = 0; i < RUNS; i++) localMethod(); 269 stopChronometer(); 270 271 if (useProse) ProseSystem.getAspectManager().withdraw(aspect2); 272 273 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 274 } 275 276 286 public void testSyncVirtualMethodEntry_jp_activated_NoArg() 288 { 289 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 290 291 startChronometer(); 292 for (int i = 0; i < RUNS; i++) obSync.syncMethodShort(); 293 stopChronometer(); 294 295 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 296 297 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 298 } 299 300 public void testSyncVirtualMethodExit_jp_activated_NoArg() 302 { 303 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 304 305 startChronometer(); 306 for (int i = 0; i < RUNS; i++) obSync.syncMethodShort(); 307 stopChronometer(); 308 309 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 310 311 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 312 } 313 314 324 public void testInterfaceMethodEntry_jp_activated_NoArg() 326 { 327 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 328 329 startChronometer(); 330 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodShort(); 331 stopChronometer(); 332 333 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 334 335 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 336 } 337 338 public void testInterfaceMethodExit_jp_activated_NoArg() 340 { 341 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 342 343 startChronometer(); 344 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodShort(); 345 stopChronometer(); 346 347 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 348 349 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 350 } 351 352 362 public void testStaticMethodEntry_jp_activated_NoArg() 364 { 365 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 366 367 startChronometer(); 368 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodShort(); 369 stopChronometer(); 370 371 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 372 373 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 374 } 375 376 public void testStaticMethodExit_jp_activated_NoArg() 378 { 379 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 380 381 startChronometer(); 382 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodShort(); 383 stopChronometer(); 384 385 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 386 387 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 388 } 389 390 400 public void testSpecialMethodEntry_jp_activated_NoArg() 402 { 403 if (useProse) ProseSystem.getAspectManager().insert(aspect1); 404 405 startChronometer(); 406 for (int i = 0; i < RUNS; i++) privatelocalMethod(); 407 stopChronometer(); 408 409 if (useProse) ProseSystem.getAspectManager().withdraw(aspect1); 410 411 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 412 } 413 414 public void testSpecialMethodExit_jp_activated_NoArg() 416 { 417 if (useProse) ProseSystem.getAspectManager().insert(aspect2); 418 419 startChronometer(); 420 for (int i = 0; i < RUNS; i++) privatelocalMethod(); 421 stopChronometer(); 422 423 if (useProse) ProseSystem.getAspectManager().withdraw(aspect2); 424 425 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 426 } 427 428 434 446 public void testVirtualMethodEntry_jp_activated_LongO() 448 { 449 Object obj = new Object (); 450 451 if (useProse) ProseSystem.getAspectManager().insert(aspect1); 452 453 startChronometer(); 454 for (int i = 0; i < RUNS; i++) localMethodLongO(obj, obj); 455 stopChronometer(); 456 457 if (useProse) ProseSystem.getAspectManager().withdraw(aspect1); 458 459 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 460 } 461 462 public void testVirtualMethodExit_jp_activated_LongO() 464 { 465 Object obj = new Object (); 466 467 if (useProse) ProseSystem.getAspectManager().insert(aspect2); 468 469 startChronometer(); 470 for (int i = 0; i < RUNS; i++) localMethodLongO(obj, obj); 471 stopChronometer(); 472 473 if (useProse) ProseSystem.getAspectManager().withdraw(aspect2); 474 475 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 476 } 477 478 489 public void testSyncVirtualMethodEntry_jp_activated_LongO() 491 { 492 Object obj = new Object (); 493 494 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 495 496 startChronometer(); 497 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongO(obj, obj); 498 stopChronometer(); 499 500 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 501 502 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 503 } 504 505 public void testSyncVirtualMethodExit_jp_activated_LongO() 507 { 508 Object obj = new Object (); 509 510 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 511 512 startChronometer(); 513 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongO(obj, obj); 514 stopChronometer(); 515 516 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 517 518 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 519 } 520 521 532 public void testInterfaceMethodEntry_jp_activated_LongO() 534 { 535 Object obj = new Object (); 536 537 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 538 539 startChronometer(); 540 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongO(obj, obj); 541 stopChronometer(); 542 543 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 544 545 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 546 } 547 548 public void testInterfaceMethodExit_jp_activated_LongO() 550 { 551 Object obj = new Object (); 552 553 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 554 555 startChronometer(); 556 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongO(obj, obj); 557 stopChronometer(); 558 559 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 560 561 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 562 } 563 564 575 public void testStaticMethodEntry_jp_activated_LongO() 577 { 578 Object obj = new Object (); 579 580 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 581 582 startChronometer(); 583 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongO(obj, obj); 584 stopChronometer(); 585 586 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 587 588 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 589 } 590 591 public void testStaticMethodExit_jp_activated_LongO() 593 { 594 Object obj = new Object (); 595 596 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 597 598 startChronometer(); 599 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongO(obj, obj); 600 stopChronometer(); 601 602 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 603 604 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 605 } 606 607 618 public void testSpecialMethodEntry_jp_activated_LongO() 620 { 621 Object obj = new Object (); 622 623 if (useProse) ProseSystem.getAspectManager().insert(aspect1); 624 625 startChronometer(); 626 for (int i = 0; i < RUNS; i++) privatelocalMethodLongO(obj, obj); 627 stopChronometer(); 628 629 if (useProse) ProseSystem.getAspectManager().withdraw(aspect1); 630 631 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 632 } 633 634 public void testSpecialMethodExit_jp_activated_LongO() 636 { 637 Object obj = new Object (); 638 639 if (useProse) ProseSystem.getAspectManager().insert(aspect2); 640 641 startChronometer(); 642 for (int i = 0; i < RUNS; i++) privatelocalMethodLongO(obj, obj); 643 stopChronometer(); 644 645 if (useProse) ProseSystem.getAspectManager().withdraw(aspect2); 646 647 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 648 } 649 650 653 654 666 public void testVirtualMethodEntry_jp_activated_LongI() 668 { 669 int obj = 1; 670 671 if (useProse) ProseSystem.getAspectManager().insert(aspect1); 672 673 startChronometer(); 674 for (int i = 0; i < RUNS; i++) localMethodLongI(obj, obj); 675 stopChronometer(); 676 677 if (useProse) ProseSystem.getAspectManager().withdraw(aspect1); 678 679 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 680 } 681 682 public void testVirtualMethodExit_jp_activated_LongI() 684 { 685 int obj = 1; 686 687 if (useProse) ProseSystem.getAspectManager().insert(aspect2); 688 689 startChronometer(); 690 for (int i = 0; i < RUNS; i++) localMethodLongI(obj, obj); 691 stopChronometer(); 692 693 if (useProse) ProseSystem.getAspectManager().withdraw(aspect2); 694 695 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 696 } 697 698 709 public void testSyncVirtualMethodEntry_jp_activated_LongI() 711 { 712 int obj = 1; 713 714 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 715 716 startChronometer(); 717 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongI(obj, obj); 718 stopChronometer(); 719 720 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 721 722 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 723 } 724 725 public void testSyncVirtualMethodExit_jp_activated_LongI() 727 { 728 int obj = 1; 729 730 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 731 732 startChronometer(); 733 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongI(obj, obj); 734 stopChronometer(); 735 736 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 737 738 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 739 } 740 741 752 public void testInterfaceMethodEntry_jp_activated_LongI() 754 { 755 int obj = 1; 756 757 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 758 759 startChronometer(); 760 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongI(obj, obj); 761 stopChronometer(); 762 763 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 764 765 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 766 } 767 768 public void testInterfaceMethodExit_jp_activated_LongI() 770 { 771 int obj = 1; 772 773 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 774 775 startChronometer(); 776 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongI(obj, obj); 777 stopChronometer(); 778 779 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 780 781 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 782 } 783 784 795 public void testStaticMethodEntry_jp_activated_LongI() 797 { 798 int obj = 1; 799 800 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 801 802 startChronometer(); 803 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongI(obj, obj); 804 stopChronometer(); 805 806 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 807 808 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 809 } 810 811 public void testStaticMethodExit_jp_activated_LongI() 813 { 814 int obj = 1; 815 816 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 817 818 startChronometer(); 819 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongI(obj, obj); 820 stopChronometer(); 821 822 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 823 824 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 825 } 826 827 838 public void testSpecialMethodEntry_jp_activated_LongI() 840 { 841 int obj = 1; 842 843 if (useProse) ProseSystem.getAspectManager().insert(aspect1); 844 845 startChronometer(); 846 for (int i = 0; i < RUNS; i++) privatelocalMethodLongI(obj, obj); 847 stopChronometer(); 848 849 if (useProse) ProseSystem.getAspectManager().withdraw(aspect1); 850 851 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 852 } 853 854 public void testSpecialMethodExit_jp_activated_LongI() 856 { 857 int obj = 1; 858 859 if (useProse) ProseSystem.getAspectManager().insert(aspect2); 860 861 startChronometer(); 862 for (int i = 0; i < RUNS; i++) privatelocalMethodLongI(obj, obj); 863 stopChronometer(); 864 865 if (useProse) ProseSystem.getAspectManager().withdraw(aspect2); 866 867 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 868 } 869 870 873 874 886 public void testVirtualMethodEntry_jp_activated_LongL() 888 { 889 long obj = 1; 890 891 if (useProse) ProseSystem.getAspectManager().insert(aspect1); 892 893 startChronometer(); 894 for (int i = 0; i < RUNS; i++) localMethodLongL(obj, obj); 895 stopChronometer(); 896 897 if (useProse) ProseSystem.getAspectManager().withdraw(aspect1); 898 899 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 900 } 901 902 public void testVirtualMethodExit_jp_activated_LongL() 904 { 905 long obj = 1; 906 907 if (useProse) ProseSystem.getAspectManager().insert(aspect2); 908 909 startChronometer(); 910 for (int i = 0; i < RUNS; i++) localMethodLongL(obj, obj); 911 stopChronometer(); 912 913 if (useProse) ProseSystem.getAspectManager().withdraw(aspect2); 914 915 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 916 } 917 918 929 public void testSyncVirtualMethodEntry_jp_activated_LongL() 931 { 932 long obj = 1; 933 934 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 935 936 startChronometer(); 937 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongL(obj, obj); 938 stopChronometer(); 939 940 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 941 942 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 943 } 944 945 public void testSyncVirtualMethodExit_jp_activated_LongL() 947 { 948 long obj = 1; 949 950 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 951 952 startChronometer(); 953 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongL(obj, obj); 954 stopChronometer(); 955 956 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 957 958 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 959 } 960 961 972 public void testInterfaceMethodEntry_jp_activated_LongL() 974 { 975 long obj = 1; 976 977 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 978 979 startChronometer(); 980 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongL(obj, obj); 981 stopChronometer(); 982 983 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 984 985 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 986 } 987 988 public void testInterfaceMethodExit_jp_activated_LongL() 990 { 991 long obj = 1; 992 993 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 994 995 startChronometer(); 996 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongL(obj, obj); 997 stopChronometer(); 998 999 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 1000 1001 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1002 } 1003 1004 1015 public void testStaticMethodEntry_jp_activated_LongL() 1017 { 1018 long obj = 1; 1019 1020 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 1021 1022 startChronometer(); 1023 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongL(obj, obj); 1024 stopChronometer(); 1025 1026 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 1027 1028 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1029 } 1030 1031 public void testStaticMethodExit_jp_activated_LongL() 1033 { 1034 long obj = 1; 1035 1036 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 1037 1038 startChronometer(); 1039 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongL(obj, obj); 1040 stopChronometer(); 1041 1042 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 1043 1044 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1045 } 1046 1047 1058 public void testSpecialMethodEntry_jp_activated_LongL() 1060 { 1061 long obj = 1; 1062 1063 if (useProse) ProseSystem.getAspectManager().insert(aspect1); 1064 1065 startChronometer(); 1066 for (int i = 0; i < RUNS; i++) privatelocalMethodLongL(obj, obj); 1067 stopChronometer(); 1068 1069 if (useProse) ProseSystem.getAspectManager().withdraw(aspect1); 1070 1071 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1072 } 1073 1074 public void testSpecialMethodExit_jp_activated_LongL() 1076 { 1077 long obj = 1; 1078 1079 if (useProse) ProseSystem.getAspectManager().insert(aspect2); 1080 1081 startChronometer(); 1082 for (int i = 0; i < RUNS; i++) privatelocalMethodLongL(obj, obj); 1083 stopChronometer(); 1084 1085 if (useProse) ProseSystem.getAspectManager().withdraw(aspect2); 1086 1087 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1088 } 1089 1090 1093 1094 1106 public void testVirtualMethodEntry_jp_activated_LongD() 1108 { 1109 double obj = 10.1; 1110 1111 if (useProse) ProseSystem.getAspectManager().insert(aspect1); 1112 1113 startChronometer(); 1114 for (int i = 0; i < RUNS; i++) localMethodLongD(obj, obj); 1115 stopChronometer(); 1116 1117 if (useProse) ProseSystem.getAspectManager().withdraw(aspect1); 1118 1119 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1120 } 1121 1122 public void testVirtualMethodExit_jp_activated_LongD() 1124 { 1125 double obj = 10.1; 1126 1127 if (useProse) ProseSystem.getAspectManager().insert(aspect2); 1128 1129 startChronometer(); 1130 for (int i = 0; i < RUNS; i++) localMethodLongD(obj, obj); 1131 stopChronometer(); 1132 1133 if (useProse) ProseSystem.getAspectManager().withdraw(aspect2); 1134 1135 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1136 } 1137 1138 1139 1150 public void testSyncVirtualMethodEntry_jp_activated_LongD() 1152 { 1153 double obj = 10.1; 1154 1155 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 1156 1157 startChronometer(); 1158 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongD(obj, obj); 1159 stopChronometer(); 1160 1161 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 1162 1163 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1164 } 1165 1166 public void testSyncVirtualMethodExit_jp_activated_LongD() 1168 { 1169 double obj = 10.1; 1170 1171 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 1172 1173 startChronometer(); 1174 for (int i = 0; i < RUNS; i++) obSync.syncMethodLongD(obj, obj); 1175 stopChronometer(); 1176 1177 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 1178 1179 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1180 } 1181 1182 1193 public void testInterfaceMethodEntry_jp_activated_LongD() 1195 { 1196 double obj = 10.1; 1197 1198 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 1199 1200 startChronometer(); 1201 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongD(obj, obj); 1202 stopChronometer(); 1203 1204 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 1205 1206 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1207 } 1208 1209 public void testInterfaceMethodExit_jp_activated_LongD() 1211 { 1212 double obj = 10.1; 1213 1214 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 1215 1216 startChronometer(); 1217 for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongD(obj, obj); 1218 stopChronometer(); 1219 1220 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 1221 1222 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1223 } 1224 1225 1236 public void testStaticMethodEntry_jp_activated_LongD() 1238 { 1239 double obj = 10.1; 1240 1241 if (useProse) ProseSystem.getAspectManager().insert(aspect3); 1242 1243 startChronometer(); 1244 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongD(obj, obj); 1245 stopChronometer(); 1246 1247 if (useProse) ProseSystem.getAspectManager().withdraw(aspect3); 1248 1249 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1250 } 1251 1252 public void testStaticMethodExit_jp_activated_LongD() 1254 { 1255 double obj = 10.1; 1256 1257 if (useProse) ProseSystem.getAspectManager().insert(aspect4); 1258 1259 startChronometer(); 1260 for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongD(obj, obj); 1261 stopChronometer(); 1262 1263 if (useProse) ProseSystem.getAspectManager().withdraw(aspect4); 1264 1265 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1266 } 1267 1268 1279 public void testSpecialMethodEntry_jp_activated_LongD() 1281 { 1282 double obj = 10.1; 1283 1284 if (useProse) ProseSystem.getAspectManager().insert(aspect1); 1285 1286 startChronometer(); 1287 for (int i = 0; i < RUNS; i++) privatelocalMethodLongD(obj, obj); 1288 stopChronometer(); 1289 1290 if (useProse) ProseSystem.getAspectManager().withdraw(aspect1); 1291 1292 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1293 } 1294 1295 public void testSpecialMethodExit_jp_activated_LongD() 1297 { 1298 double obj = 10.1; 1299 1300 if (useProse) ProseSystem.getAspectManager().insert(aspect2); 1301 1302 startChronometer(); 1303 for (int i = 0; i < RUNS; i++) privatelocalMethodLongD(obj, obj); 1304 stopChronometer(); 1305 1306 if (useProse) ProseSystem.getAspectManager().withdraw(aspect2); 1307 1308 if (checkAssert) assertEquals("Hook notifications", RUNS, counter); 1309 } 1310 1311 1314 public static Test suite() { 1315 return new PerformanceTestSuite(JoinPointMeasurements1_micro.class); 1316 } 1317 1318} | Popular Tags |