Source code: measurements/suites/JVMAIMeasurement.java
1 // $Id: JVMAIMeasurement.java,v 1.1.1.1 2003/07/02 15:30:46 apopovic Exp $
2 // =====================================================================
3 //
4 // (history at end)
5 //
6
7 package measurements.suites;
8
9 import java.lang.reflect.Field;
10 import java.lang.reflect.Method;
11
12 import junit.framework.Assert;
13 import junit.framework.Test;
14 import ch.ethz.inf.iks.jvmai.jvmdi.FieldAccessJoinPointImpl;
15 import ch.ethz.jvmai.ExceptionJoinPoint;
16 import ch.ethz.jvmai.ExceptionCatchJoinPoint;
17 import ch.ethz.jvmai.FieldAccessJoinPoint;
18 import ch.ethz.jvmai.FieldModificationJoinPoint;
19 import ch.ethz.jvmai.JVMAspectInterface;
20 import ch.ethz.jvmai.JoinPointHook;
21 import ch.ethz.jvmai.MethodEntryJoinPoint;
22 import ch.ethz.jvmai.MethodExitJoinPoint;
23 import ch.ethz.jvmai.Provider;
24 import ch.ethz.inf.util.junit.PerformanceTest;
25 import ch.ethz.inf.util.junit.PerformanceTestSuite;
26
27 /**
28 * Performance testcase for measuring the dispatching speed of the debugger.
29 * <p>
30 * In this testcase,the column <code>RUNS</code> (the fifths)
31 * represents the time needed to breakpoint a method RUNS times.
32 * No additional functionality is called in the dispatch.
33 *
34 * @version $Revision: 1.1.1.1 $
35 * @author Andrei Popovici
36 */
37 public class JVMAIMeasurement extends PerformanceTest {
38
39 // fixture
40
41
42 public void theMethodToCall() { }
43 public int theFieldToAccess = 0;
44
45 public static class TestHook extends JoinPointHook
46 {
47 public void onFieldAccess (FieldAccessJoinPoint joinPoint) { }
48 public void onFieldModification(FieldModificationJoinPoint joinPoint) { }
49 public void onMethodEntry (MethodEntryJoinPoint joinPoint) { }
50 public void onMethodExit (MethodExitJoinPoint joinPoint) { }
51 public void onExceptionThrow (ExceptionJoinPoint joinPoint) { }
52 public void onExceptionCatch (ExceptionCatchJoinPoint joinPoint) { } //angy
53 public void onClassLoad (Class cls) { }
54 }
55
56 final boolean useProse;
57
58 /**
59 * Construct test with given name.
60 * @param name test name
61 */
62 public JVMAIMeasurement(String name)
63 {
64 super(name);
65 String proseParam = System.getProperty("useprose");
66 if(proseParam==null)
67 useProse = isDebuggerEnabled();
68 else
69 useProse = proseParam.toUpperCase().equals("TRUE");
70
71 if(useProse)
72 {
73 // we either do RVM or use the debugger
74 if (isDebuggerEnabled())
75 RANGE = new int[]{ 10000};
76 else
77 RANGE = new int[]{ 1000000};
78 }
79 else
80 RANGE = new int[]{ 10000000 };
81
82 }
83
84 JVMAspectInterface aspectInterface;
85
86 Method method;
87 Field field;
88 Method interfaceMethod;
89 TestHook hook;
90
91 protected void setUp()
92 {
93
94 hook = new TestHook();
95 // call every method at least once ...
96 hook.onFieldAccess(null);
97 hook.onFieldModification(null);
98 hook.onMethodEntry(null);
99 hook.onMethodExit(null);
100 this.theMethodToCall();
101 int n = this.theFieldToAccess;
102 this.theFieldToAccess = 1;
103
104 if (!useProse) return;
105 try
106 {
107 String providerName = System.getProperty("ch.ethz.prose.JVMAIProvider");
108 Class providerClass = Class.forName(providerName);
109 Provider provider = (Provider)providerClass.newInstance();
110
111 aspectInterface = provider.getAspectInterface();
112
113 aspectInterface.startup(new String[]{"ch.ethz.prose."},true);
114
115 method = JVMAIMeasurement.class.getDeclaredMethod("theMethodToCall",new Class[]{});
116 interfaceMethod = TestClass1.class.getDeclaredMethod("interfaceMethodLong",
117 new Class[]{Object.class,
118 Object.class});
119 field = JVMAIMeasurement.class.getDeclaredField("theFieldToAccess");
120
121 // call every method at least once ...
122 aspectInterface.setJoinPointHook(hook);
123 aspectInterface.setMethodEntryWatch(method,new Object());
124 aspectInterface.setMethodExitWatch(method,new Object());
125 aspectInterface.setFieldAccessWatch(field,new Object());
126 aspectInterface.setFieldModificationWatch(field,new Object());
127 aspectInterface.clearMethodEntryWatch(method);
128 aspectInterface.clearMethodExitWatch(method);
129 aspectInterface.clearFieldAccessWatch(field);
130 aspectInterface.clearFieldModificationWatch(field);
131 aspectInterface.setJoinPointHook(null);
132 aspectInterface.suspendNotification(Thread.currentThread());
133 aspectInterface.resumeNotification(Thread.currentThread());
134
135 }
136 catch (Exception e)
137 {
138 Assert.fail("loading provider or initializing aspect-interface failed");
139 }
140 }
141
142 protected void tearDown()
143 {
144 }
145
146 public void testHook()
147 {
148 FieldAccessJoinPoint joinPoint = new FieldAccessJoinPointImpl(null,null);
149 JoinPointHook jpHook = hook;
150 // call every method at least once ...
151 jpHook.onFieldAccess(null);
152 jpHook.onFieldModification(null);
153 jpHook.onMethodEntry(null);
154 jpHook.onMethodExit(null);
155 startChronometer();
156 for(int i =0; i<RUNS; i++)
157 jpHook.onFieldAccess(joinPoint);
158 stopChronometer();
159 }
160
161 public void testEmptyFieldAccess()
162 {
163 int n = 0;
164
165 startChronometer();
166 for(int i =0; i<RUNS; i++)
167 n = 0;
168 stopChronometer();
169 }
170
171 public void testDoubleField()
172 {
173 startChronometer();
174 for(int i =0; i<RUNS; i++)
175 this.theFieldToAccess = this.theFieldToAccess;
176 stopChronometer();
177 }
178
179 //#####################################################################################################################
180
181 public void testMethod()
182 {
183 startChronometer();
184 for(int i =0; i<RUNS; i++)
185 this.theMethodToCall();
186 stopChronometer();
187 }
188
189 public void testMethod_Hook()
190 {
191 if(useProse)
192 {
193 aspectInterface.setJoinPointHook(hook);
194 }
195
196 startChronometer();
197 for(int i =0; i<RUNS; i++)
198 this.theMethodToCall();
199 stopChronometer();
200
201 if(useProse)
202 {
203 aspectInterface.setJoinPointHook(null);
204 }
205
206 }
207
208 public void testMethod_Suspended()
209 {
210 if(useProse)
211 {
212 aspectInterface.suspendNotification(Thread.currentThread());
213 }
214
215 startChronometer();
216 for(int i =0; i<RUNS; i++)
217 this.theMethodToCall();
218 stopChronometer();
219
220 if(useProse)
221 {
222 aspectInterface.resumeNotification(Thread.currentThread());
223 }
224 }
225
226 public void testMethod_HookSuspended()
227 {
228 if(useProse)
229 {
230 aspectInterface.suspendNotification(Thread.currentThread());
231 aspectInterface.setJoinPointHook(hook);
232 }
233
234 startChronometer();
235 for(int i =0; i<RUNS; i++)
236 this.theMethodToCall();
237 stopChronometer();
238
239 if(useProse)
240 {
241 aspectInterface.resumeNotification(Thread.currentThread());
242 aspectInterface.setJoinPointHook(null);
243 }
244 }
245
246 //#####################################################################################################################
247
248 public void testMethodEntryWatch()
249 {
250 if(useProse)
251 {
252 aspectInterface.setMethodEntryWatch(method,new Object());
253 }
254
255 startChronometer();
256 for(int i =0; i<RUNS; i++)
257 this.theMethodToCall();
258 stopChronometer();
259
260 if(useProse)
261 {
262 aspectInterface.clearMethodEntryWatch(method);
263 }
264
265 }
266
267 public void testMethodEntryWatch_Hook()
268 {
269 if(useProse)
270 {
271 aspectInterface.setMethodEntryWatch(method,new Object());
272 aspectInterface.setJoinPointHook(hook);
273 }
274
275 startChronometer();
276 for(int i =0; i<RUNS; i++)
277 this.theMethodToCall();
278 stopChronometer();
279
280 if(useProse)
281 {
282 aspectInterface.clearMethodEntryWatch(method);
283 aspectInterface.setJoinPointHook(null);
284 }
285 }
286
287 public void testMethodEntryWatch_Suspended()
288 {
289 if(useProse)
290 {
291 aspectInterface.setMethodEntryWatch(method,new Object());
292 aspectInterface.suspendNotification(Thread.currentThread());
293 }
294
295 startChronometer();
296 for(int i =0; i<RUNS; i++)
297 this.theMethodToCall();
298 stopChronometer();
299
300 if(useProse)
301 {
302 aspectInterface.clearMethodEntryWatch(method);
303 aspectInterface.resumeNotification(Thread.currentThread());
304 }
305 }
306
307 public void testMethodEntryWatch_HookSuspended()
308 {
309 if(useProse)
310 {
311 aspectInterface.setMethodEntryWatch(method,new Object());
312 aspectInterface.suspendNotification(Thread.currentThread());
313 aspectInterface.setJoinPointHook(hook);
314 }
315
316 startChronometer();
317 for(int i =0; i<RUNS; i++)
318 this.theMethodToCall();
319 stopChronometer();
320
321 if(useProse)
322 {
323 aspectInterface.clearMethodEntryWatch(method);
324 aspectInterface.resumeNotification(Thread.currentThread());
325 aspectInterface.setJoinPointHook(null);
326 }
327 }
328
329 //#####################################################################################################################
330
331 //#####################################################################################################################
332
333 public void testInterfaceMethod()
334 {
335 String x = "hello";
336 TestInterface obj = new TestClass1();
337 startChronometer();
338 for(int i =0; i<RUNS; i++)
339 obj.interfaceMethodLong(x,x);
340 stopChronometer();
341 }
342
343 public void testInterfaceEntryWatch()
344 {
345 String x = "hello";
346 TestInterface obj = new TestClass1();
347 if(useProse)
348 {
349 aspectInterface.setMethodEntryWatch(interfaceMethod,new Object());
350 }
351
352 startChronometer();
353 for(int i =0; i<RUNS; i++)
354 obj.interfaceMethodLong(x,x);
355 stopChronometer();
356
357 if(useProse)
358 {
359 aspectInterface.clearMethodEntryWatch(interfaceMethod);
360 }
361
362 }
363
364 public void testInterfaceEntryWatch_Hook()
365 {
366 String x = "hello";
367 TestInterface obj = new TestClass1();
368 if(useProse)
369 {
370 aspectInterface.setMethodEntryWatch(interfaceMethod,new Object());
371 aspectInterface.setJoinPointHook(hook);
372 }
373
374 startChronometer();
375 for(int i =0; i<RUNS; i++)
376 obj.interfaceMethodLong(x,x);
377 stopChronometer();
378
379 if(useProse)
380 {
381 aspectInterface.clearMethodEntryWatch(interfaceMethod);
382 aspectInterface.setJoinPointHook(null);
383 }
384 }
385
386 public void testInterfaceEntryWatch_Suspended()
387 {
388 String x = "hello";
389 TestInterface obj = new TestClass1();
390 if(useProse)
391 {
392 aspectInterface.setMethodEntryWatch(interfaceMethod,new Object());
393 aspectInterface.suspendNotification(Thread.currentThread());
394 }
395
396 startChronometer();
397 for(int i =0; i<RUNS; i++)
398 obj.interfaceMethodLong(x,x);
399 stopChronometer();
400
401 if(useProse)
402 {
403 aspectInterface.clearMethodEntryWatch(interfaceMethod);
404 aspectInterface.resumeNotification(Thread.currentThread());
405 }
406 }
407
408 public void testInterfaceEntryWatch_HookSuspended()
409 {
410 String x = "hello";
411 TestInterface obj = new TestClass1();
412 if(useProse)
413 {
414 aspectInterface.setMethodEntryWatch(interfaceMethod,new Object());
415 aspectInterface.suspendNotification(Thread.currentThread());
416 aspectInterface.setJoinPointHook(hook);
417 }
418
419 startChronometer();
420 for(int i =0; i<RUNS; i++)
421 obj.interfaceMethodLong(x,x);
422 stopChronometer();
423
424 if(useProse)
425 {
426 aspectInterface.clearMethodEntryWatch(interfaceMethod);
427 aspectInterface.resumeNotification(Thread.currentThread());
428 aspectInterface.setJoinPointHook(null);
429 }
430 }
431
432 public void testInterfaceExitWatch()
433 {
434 String x = "hello";
435 TestInterface obj = new TestClass1();
436 if(useProse)
437 {
438 aspectInterface.setMethodExitWatch(interfaceMethod,new Object());
439 }
440
441 startChronometer();
442 for(int i =0; i<RUNS; i++)
443 obj.interfaceMethodLong(x,x);
444 stopChronometer();
445
446 if(useProse)
447 {
448 aspectInterface.clearMethodExitWatch(interfaceMethod);
449 }
450
451 }
452
453 public void testInterfaceExitWatch_Hook()
454 {
455 String x = "hello";
456 TestInterface obj = new TestClass1();
457 if(useProse)
458 {
459 aspectInterface.setMethodExitWatch(interfaceMethod,new Object());
460 aspectInterface.setJoinPointHook(hook);
461 }
462
463 startChronometer();
464 for(int i =0; i<RUNS; i++)
465 obj.interfaceMethodLong(x,x);
466 stopChronometer();
467
468 if(useProse)
469 {
470 aspectInterface.clearMethodExitWatch(interfaceMethod);
471 aspectInterface.setJoinPointHook(null);
472 }
473 }
474
475 public void testInterfaceExitWatch_Suspended()
476 {
477 String x = "hello";
478 TestInterface obj = new TestClass1();
479 if(useProse)
480 {
481 aspectInterface.setMethodExitWatch(interfaceMethod,new Object());
482 aspectInterface.suspendNotification(Thread.currentThread());
483 }
484
485 startChronometer();
486 for(int i =0; i<RUNS; i++)
487 obj.interfaceMethodLong(x,x);
488 stopChronometer();
489
490 if(useProse)
491 {
492 aspectInterface.clearMethodExitWatch(interfaceMethod);
493 aspectInterface.resumeNotification(Thread.currentThread());
494 }
495 }
496
497 public void testInterfaceExitWatch_HookSuspended()
498 {
499 String x = "hello";
500 TestInterface obj = new TestClass1();
501 if(useProse)
502 {
503 aspectInterface.setMethodExitWatch(interfaceMethod,new Object());
504 aspectInterface.suspendNotification(Thread.currentThread());
505 aspectInterface.setJoinPointHook(hook);
506 }
507
508 startChronometer();
509 for(int i =0; i<RUNS; i++)
510 obj.interfaceMethodLong(x,x);
511 stopChronometer();
512
513 if(useProse)
514 {
515 aspectInterface.clearMethodExitWatch(interfaceMethod);
516 aspectInterface.resumeNotification(Thread.currentThread());
517 aspectInterface.setJoinPointHook(null);
518 }
519 }
520
521 //#####################################################################################################################
522 public void testMethodExitWatch()
523 {
524 if(useProse)
525 {
526 aspectInterface.setMethodExitWatch(method,new Object());
527 }
528
529 startChronometer();
530 for(int i =0; i<RUNS; i++)
531 this.theMethodToCall();
532 stopChronometer();
533
534 if(useProse)
535 {
536 aspectInterface.clearMethodExitWatch(method);
537 }
538
539 }
540
541 public void testMethodExitWatch_Hook()
542 {
543 if(useProse)
544 {
545 aspectInterface.setMethodExitWatch(method,new Object());
546 aspectInterface.setJoinPointHook(hook);
547 }
548
549 startChronometer();
550 for(int i =0; i<RUNS; i++)
551 this.theMethodToCall();
552 stopChronometer();
553
554 if(useProse)
555 {
556 aspectInterface.clearMethodExitWatch(method);
557 aspectInterface.setJoinPointHook(null);
558 }
559 }
560
561 public void testMethodExitWatch_Suspended()
562 {
563 if(useProse)
564 {
565 aspectInterface.setMethodExitWatch(method,new Object());
566 aspectInterface.suspendNotification(Thread.currentThread());
567 }
568
569 startChronometer();
570 for(int i =0; i<RUNS; i++)
571 this.theMethodToCall();
572 stopChronometer();
573
574 if(useProse)
575 {
576 aspectInterface.clearMethodExitWatch(method);
577 aspectInterface.resumeNotification(Thread.currentThread());
578 }
579 }
580
581 public void testMethodExitWatch_HookSuspended()
582 {
583 if(useProse)
584 {
585 aspectInterface.setMethodExitWatch(method,new Object());
586 aspectInterface.suspendNotification(Thread.currentThread());
587 aspectInterface.setJoinPointHook(hook);
588 }
589
590 startChronometer();
591 for(int i =0; i<RUNS; i++)
592 this.theMethodToCall();
593 stopChronometer();
594
595 if(useProse)
596 {
597 aspectInterface.clearMethodExitWatch(method);
598 aspectInterface.resumeNotification(Thread.currentThread());
599 aspectInterface.setJoinPointHook(null);
600 }
601 }
602 //#####################################################################################################################
603
604 public void testFieldAccess()
605 {
606 int n = 0;
607
608 startChronometer();
609 for(int i =0; i<RUNS; i++)
610 n = this.theFieldToAccess;
611 stopChronometer();
612 }
613
614 public void testFieldAccess_Hook()
615 {
616 if(useProse)
617 {
618 aspectInterface.setJoinPointHook(hook);
619 }
620 int n = 0;
621
622 startChronometer();
623 for(int i =0; i<RUNS; i++)
624 n = this.theFieldToAccess;
625 stopChronometer();
626
627 if(useProse)
628 {
629 aspectInterface.setJoinPointHook(null);
630 }
631 }
632
633 public void testFieldAccess_Suspended()
634 {
635 if(useProse)
636 {
637 aspectInterface.suspendNotification(Thread.currentThread());
638 }
639 int n = 0;
640
641 startChronometer();
642 for(int i =0; i<RUNS; i++)
643 n = this.theFieldToAccess;
644 stopChronometer();
645
646 if(useProse)
647 {
648 aspectInterface.resumeNotification(Thread.currentThread());
649 }
650 }
651
652 public void testFieldAccess_HookSuspended()
653 {
654 if(useProse)
655 {
656 aspectInterface.suspendNotification(Thread.currentThread());
657 aspectInterface.setJoinPointHook(hook);
658 }
659 int n = 0;
660
661 startChronometer();
662 for(int i =0; i<RUNS; i++)
663 n = this.theFieldToAccess;
664 stopChronometer();
665
666 if(useProse)
667 {
668 aspectInterface.resumeNotification(Thread.currentThread());
669 aspectInterface.setJoinPointHook(null);
670 }
671 }
672
673 //#####################################################################################################################
674
675 public void testFieldModification()
676 {
677 startChronometer();
678 for(int i =0; i<RUNS; i++)
679 this.theFieldToAccess = 1;
680 stopChronometer();
681 }
682
683 public void testFieldModification_Hook()
684 {
685 if(useProse)
686 {
687 aspectInterface.setJoinPointHook(hook);
688 }
689
690 startChronometer();
691 for(int i =0; i<RUNS; i++)
692 this.theFieldToAccess = 1;
693 stopChronometer();
694
695 if(useProse)
696 {
697 aspectInterface.setJoinPointHook(null);
698 }
699 }
700
701 public void testFieldModification_Suspended()
702 {
703 if(useProse)
704 {
705 aspectInterface.suspendNotification(Thread.currentThread());
706 }
707
708 startChronometer();
709 for(int i =0; i<RUNS; i++)
710 this.theFieldToAccess = 1;
711 stopChronometer();
712
713 if(useProse)
714 {
715 aspectInterface.resumeNotification(Thread.currentThread());
716 }
717 }
718
719 public void testFieldModification_HookSuspended()
720 {
721 if(useProse)
722 {
723 aspectInterface.suspendNotification(Thread.currentThread());
724 aspectInterface.setJoinPointHook(hook);
725 }
726
727 startChronometer();
728 for(int i =0; i<RUNS; i++)
729 this.theFieldToAccess = 1;
730 stopChronometer();
731
732 if(useProse)
733 {
734 aspectInterface.resumeNotification(Thread.currentThread());
735 aspectInterface.setJoinPointHook(null);
736 }
737 }
738
739 //#####################################################################################################################
740
741 public void testFieldAccessWatch()
742 {
743 if(useProse)
744 {
745 aspectInterface.setFieldAccessWatch(field,new Object());
746 }
747 int n = 0;
748
749 startChronometer();
750 for(int i =0; i<RUNS; i++)
751 n = this.theFieldToAccess;
752 stopChronometer();
753
754 if(useProse)
755 {
756 aspectInterface.clearFieldAccessWatch(field);
757 }
758 }
759
760 public void testFieldAccessWatch_Hook()
761 {
762 if(useProse)
763 {
764 aspectInterface.setFieldAccessWatch(field,new Object());
765 aspectInterface.setJoinPointHook(hook);
766 }
767 int n = 0;
768
769 startChronometer();
770 for(int i =0; i<RUNS; i++)
771 n = this.theFieldToAccess;
772 stopChronometer();
773
774 if(useProse)
775 {
776 aspectInterface.clearFieldAccessWatch(field);
777 aspectInterface.setJoinPointHook(null);
778 }
779 }
780
781 public void testFieldAccessWatch_Suspended()
782 {
783 if(useProse)
784 {
785 aspectInterface.setFieldAccessWatch(field,new Object());
786 aspectInterface.suspendNotification(Thread.currentThread());
787 }
788 int n = 0;
789
790 startChronometer();
791 for(int i =0; i<RUNS; i++)
792 n = this.theFieldToAccess;
793 stopChronometer();
794
795 if(useProse)
796 {
797 aspectInterface.clearFieldAccessWatch(field);
798 aspectInterface.resumeNotification(Thread.currentThread());
799 }
800 }
801
802 public void testFieldAccessWatch_HookSuspended()
803 {
804 if(useProse)
805 {
806 aspectInterface.setFieldAccessWatch(field,new Object());
807 aspectInterface.suspendNotification(Thread.currentThread());
808 aspectInterface.setJoinPointHook(hook);
809 }
810 int n = 0;
811
812 startChronometer();
813 for(int i =0; i<RUNS; i++)
814 n = this.theFieldToAccess;
815 stopChronometer();
816
817 if(useProse)
818 {
819 aspectInterface.clearFieldAccessWatch(field);
820 aspectInterface.resumeNotification(Thread.currentThread());
821 aspectInterface.setJoinPointHook(null);
822 }
823 }
824
825 //#####################################################################################################################
826
827 public void testFieldModificationWatch()
828 {
829 if(useProse)
830 {
831 aspectInterface.setFieldModificationWatch(field,new Object());
832 }
833
834 startChronometer();
835 for(int i =0; i<RUNS; i++)
836 this.theFieldToAccess = 1;
837 stopChronometer();
838
839 if(useProse)
840 {
841 aspectInterface.clearFieldModificationWatch(field);
842 }
843 }
844
845 public void testFieldModificationWatch_Hook()
846 {
847 if(useProse)
848 {
849 aspectInterface.setFieldModificationWatch(field,new Object());
850 aspectInterface.setJoinPointHook(hook);
851 }
852
853 startChronometer();
854 for(int i =0; i<RUNS; i++)
855 this.theFieldToAccess = 1;
856 stopChronometer();
857
858 if(useProse)
859 {
860 aspectInterface.clearFieldModificationWatch(field);
861 aspectInterface.setJoinPointHook(null);
862 }
863 }
864
865 public void testFieldModificationWatch_Suspended()
866 {
867 if(useProse)
868 {
869 aspectInterface.setFieldModificationWatch(field,new Object());
870 aspectInterface.suspendNotification(Thread.currentThread());
871 }
872
873 startChronometer();
874 for(int i =0; i<RUNS; i++)
875 this.theFieldToAccess = 1;
876 stopChronometer();
877
878 if(useProse)
879 {
880 aspectInterface.clearFieldModificationWatch(field);
881 aspectInterface.resumeNotification(Thread.currentThread());
882 }
883 }
884
885 public void test1FieldModificationWatch_HookSuspended()
886 {
887 if(useProse)
888 {
889 aspectInterface.setFieldModificationWatch(field,new Object());
890 aspectInterface.suspendNotification(Thread.currentThread());
891 aspectInterface.setJoinPointHook(hook);
892 }
893
894 startChronometer();
895 for(int i =0; i<RUNS; i++)
896 this.theFieldToAccess = 1;
897 stopChronometer();
898
899 if(useProse)
900 {
901 aspectInterface.clearFieldModificationWatch(field);
902 aspectInterface.resumeNotification(Thread.currentThread());
903 aspectInterface.setJoinPointHook(null);
904 }
905 }
906
907 //#####################################################################################################################
908
909 /**
910 * Test suite.
911 * @return test instance
912 */
913 public static Test suite()
914 {
915 return new PerformanceTestSuite(JVMAIMeasurement.class);
916 }
917
918 }
919
920
921 //======================================================================
922 //
923 // $Log: JVMAIMeasurement.java,v $
924 // Revision 1.1.1.1 2003/07/02 15:30:46 apopovic
925 // Imported from ETH Zurich
926 //
927 // Revision 1.13 2003/07/02 12:42:40 anicoara
928 // Added CatchJoinPoint Functionality (Requests, Join-Points, Filters, CatchCuts, Tests)
929 //
930 // Revision 1.12 2003/05/05 14:03:02 popovici
931 // renaming from runes to prose
932 //
933 // Revision 1.11 2003/03/04 18:36:00 popovici
934 // Organization of imprts
935 //
936 // Revision 1.10 2003/03/04 11:26:12 popovici
937 // Important refactorization step (march):
938 // - removal of 'JoinPointEvents'; JoinPoints now have the same function as events
939 // - reimplementation of the JVMAIDebuggerAspectInterface (better performance, coding conventions, removal of ProseVM
940 // structures
941 //
942 // Revision 1.9 2002/10/17 17:05:49 pschoch
943 // Added throw capabability to JVMAI
944 //
945 // Revision 1.8 2002/05/06 09:08:11 popovici
946 // all _test now real test cases; JVMAI measurement enhanced with interface testing
947 //
948 // Revision 1.7 2002/03/18 12:47:25 popovici
949 // *** empty log message ***
950 //
951 // Revision 1.6 2002/03/11 11:02:53 smarkwal
952 // JVMInfoInterface and JoinPointHook changed to abstract classes
953 //
954 // Revision 1.5 2002/02/28 17:37:12 smarkwal
955 // precompilation of TestHook-methods ensured.
956 //
957 // Revision 1.4 2002/02/21 12:55:47 popovici
958 // null aop tags replaced with Object aop tags to let tests run with both rvm & runes
959 //
960 // Revision 1.3 2002/02/15 12:29:31 smarkwal
961 // doesn't rely anymore on Provider.getProvider(). test testEmtpy removed.
962 //
963 // Revision 1.2 2002/02/11 12:16:48 smarkwal
964 // many more tests added
965 //
966 // Revision 1.1 2002/02/05 11:24:12 smarkwal
967 // JVMDIMeasurement renamed to JVMAIMeasurement, JVMDI-based code replaced by JVMAI
968 //
969 // Revision 1.1.1.1 2001/11/29 18:13:34 popovici
970 // Sources from runes
971 //
972 // Revision 1.1.2.3 2001/11/21 11:56:42 popovici
973 //
974 // -The sun.tools.agent and ch.ethz.inf.util.JVMDIUtil functionality
975 // replaced with the iks.jvmdi package. References to this old
976 // functionality replaced throughout the code.
977 // -Partial reimplementation of the ch.ethz.inf.iks.runes classes,
978 // part of their functionality moved to the ch.ethz.prose.reflect
979 // abstract classes. New classes and functionality added to the
980 // ch.ethz.prose.reflect package, partially to reflect the
981 // more stable features taken from the iks.runes packages, partially
982 // to reflect the structure of the VM (constant pool, etc). Functionality in
983 // ch.ethz.prose.crosscut and the junit classes adapted to use the
984 // new form of the ch.ethz.prose.reflect package
985 //
986 // Revision 1.1.2.2 2001/02/22 16:23:32 popovici
987 // ProseSystem.setup replaced with startup; teardown introduced
988 //
989 // Revision 1.1.2.1 2001/01/22 07:28:20 popovici
990 // Initial Revision
991 //