0001: package measurements.suites;
0002:
0003: import java.lang.reflect.Field;
0004: import java.lang.reflect.Method;
0005:
0006: import junit.framework.Test;
0007: import ch.ethz.inf.util.junit.PerformanceTest;
0008: import ch.ethz.inf.util.junit.PerformanceTestSuite;
0009: import ch.ethz.jvmai.*;
0010:
0011: /**
0012: * JoinPoint micro-measurements.
0013: *
0014: * Performance micro-measurements tests for method boundaries,
0015: * fields accesses and modifications, exception handlers:
0016: *
0017: * 1) INVOKEVIRTUAL -> invoke a normal method
0018: * 2) SYNC INVOKEVIRTUAL -> invoke a normal but synchronized method
0019: * 3) INVOKEINTERFACE -> invoke a method through an interface
0020: * 4) INVOKESPECIAL -> invoke a private method
0021: * 5) INVOKESTATIC -> invoke a static method
0022: * 6) GETFIELD -> used when a field has been read
0023: * 7) PUTFIELD -> used when a field has been write
0024: * 8) Exception Catch
0025: * 9) Exception Throw
0026: *
0027: * Each test is executed "RUNS" times.
0028: *
0029: * @author Angela Nicoara
0030: */
0031: public class JoinPointMeasurements1 extends PerformanceTest {
0032:
0033: public boolean useProse = false;
0034: public boolean checkAssert = true;
0035:
0036: protected JVMAspectInterface aspectInterface;
0037: protected TestHook hook;
0038:
0039: // INVOKEVIRTUAL
0040: public void localMethod() {
0041: }
0042:
0043: public void localMethodLongO(Object ob1, Object ob2) {
0044: }
0045:
0046: public void localMethodLongI(int ob1, int ob2) {
0047: }
0048:
0049: public void localMethodLongL(long ob1, long ob2) {
0050: }
0051:
0052: public void localMethodLongD(double ob1, double ob2) {
0053: }
0054:
0055: // INVOKESPECIAL
0056: private void privatelocalMethod() {
0057: }
0058:
0059: private void privatelocalMethodLongO(Object ob1, Object ob2) {
0060: }
0061:
0062: private void privatelocalMethodLongI(int ob1, int ob2) {
0063: }
0064:
0065: private void privatelocalMethodLongL(long ob1, long ob2) {
0066: }
0067:
0068: private void privatelocalMethodLongD(double ob1, double ob2) {
0069: }
0070:
0071: // INVOKEINTERFACE
0072: protected JoinPointTestInterface obInterface = new JoinPointTestClass();
0073:
0074: // SYNC INVOKEVIRTUAL
0075: protected JoinPointTestClass obSync = new JoinPointTestClass();
0076:
0077: public int theField = 0;
0078:
0079: // GETFIELD
0080: // In case of the advice weaver the field that is accessed or modified has to be in a method
0081: public void theFieldAccess(int runs) {
0082: int n = 0;
0083:
0084: startChronometer();
0085: for (int i = 0; i < RUNS; i++)
0086: n = this .theField;
0087: stopChronometer();
0088: }
0089:
0090: // PUTFIELD
0091: // In case of the advice weaver the field that is accessed or modified has to be in a method
0092: public void theFieldModification(int runs) {
0093: startChronometer();
0094: for (int i = 0; i < RUNS; i++)
0095: this .theField = i;
0096: stopChronometer();
0097: }
0098:
0099: // INVOKEVIRTUAL
0100: protected Method method;
0101: protected Method methodLongO;
0102: protected Method methodLongI;
0103: protected Method methodLongL;
0104: protected Method methodLongD;
0105:
0106: // SYNC INVOKEVIRTUAL
0107: protected Method syncMethod;
0108: protected Method syncMethodLongO;
0109: protected Method syncMethodLongI;
0110: protected Method syncMethodLongL;
0111: protected Method syncMethodLongD;
0112:
0113: // INVOKEINTERFACE
0114: protected Method interfaceMethod;
0115: protected Method interfaceMethodLongO;
0116: protected Method interfaceMethodLongI;
0117: protected Method interfaceMethodLongL;
0118: protected Method interfaceMethodLongD;
0119:
0120: // INVOKESTATIC
0121: protected Method staticMethod;
0122: protected Method staticMethodLongO;
0123: protected Method staticMethodLongI;
0124: protected Method staticMethodLongL;
0125: protected Method staticMethodLongD;
0126:
0127: // INVOKESPECIAL
0128: protected Method privateMethod;
0129: protected Method privateMethodLongO;
0130: protected Method privateMethodLongI;
0131: protected Method privateMethodLongL;
0132: protected Method privateMethodLongD;
0133:
0134: protected Field field;
0135:
0136: public class TestException extends Exception {
0137: };
0138:
0139: public TestException exception = new TestException();
0140:
0141: public static int fieldAccessCount;
0142: public static int fieldModificationCount;
0143: public static int methodEntryCount;
0144: public static int methodExitCount;
0145: public static int exceptionThrowCount;
0146: public static int exceptionCatchCount;
0147:
0148: public static class TestHook extends JoinPointHook {
0149: public void onFieldAccess(FieldAccessJoinPoint joinPoint) {
0150: fieldAccessCount++;
0151: }
0152:
0153: public void onFieldModification(
0154: FieldModificationJoinPoint joinPoint) {
0155: fieldModificationCount++;
0156: }
0157:
0158: public void onMethodEntry(MethodEntryJoinPoint joinPoint) {
0159: methodEntryCount++;
0160: }
0161:
0162: public void onMethodExit(MethodExitJoinPoint joinPoint) {
0163: methodExitCount++;
0164: }
0165:
0166: public void onExceptionThrow(ExceptionJoinPoint joinPoint) {
0167: exceptionThrowCount++;
0168: }
0169:
0170: public void onExceptionCatch(ExceptionCatchJoinPoint joinPoint) {
0171: exceptionCatchCount++;
0172: }
0173:
0174: public void onClassLoad(Class cls) {
0175: }
0176:
0177: public void onConstructor(ConstructorJoinPoint joinPoint) {
0178: }
0179: }
0180:
0181: public JoinPointMeasurements1(String name) {
0182: super (name);
0183: RANGE = new int[] { 100000000 };
0184:
0185: String proseParam = System.getProperty("useprose");
0186: if (proseParam != null)
0187: useProse = true;
0188: }
0189:
0190: protected void setUp() throws Exception {
0191: if (useProse) {
0192: String providerName = System
0193: .getProperty("ch.ethz.prose.JVMAIProvider");
0194: Class providerClass = Class.forName(providerName);
0195: Provider provider = (Provider) providerClass.newInstance();
0196:
0197: aspectInterface = provider.getAspectInterface();
0198: aspectInterface.startup(null, true);
0199:
0200: hook = new TestHook();
0201: aspectInterface.setJoinPointHook(hook);
0202:
0203: // INVOKEVIRTUAL
0204: method = JoinPointMeasurements1.class.getDeclaredMethod(
0205: "localMethod", new Class[] {});
0206: methodLongO = JoinPointMeasurements1.class
0207: .getDeclaredMethod("localMethodLongO", new Class[] {
0208: Object.class, Object.class });
0209: methodLongI = JoinPointMeasurements1.class
0210: .getDeclaredMethod("localMethodLongI", new Class[] {
0211: Integer.TYPE, Integer.TYPE });
0212: methodLongL = JoinPointMeasurements1.class
0213: .getDeclaredMethod("localMethodLongL", new Class[] {
0214: Long.TYPE, Long.TYPE });
0215: methodLongD = JoinPointMeasurements1.class
0216: .getDeclaredMethod("localMethodLongD", new Class[] {
0217: Double.TYPE, Double.TYPE });
0218:
0219: // SYNC INVOKEVIRTUAL
0220: syncMethod = JoinPointTestClass.class.getDeclaredMethod(
0221: "syncMethodShort", new Class[] {});
0222: syncMethodLongO = JoinPointTestClass.class
0223: .getDeclaredMethod("syncMethodLongO", new Class[] {
0224: Object.class, Object.class });
0225: syncMethodLongI = JoinPointTestClass.class
0226: .getDeclaredMethod("syncMethodLongI", new Class[] {
0227: Integer.TYPE, Integer.TYPE });
0228: syncMethodLongL = JoinPointTestClass.class
0229: .getDeclaredMethod("syncMethodLongL", new Class[] {
0230: Long.TYPE, Long.TYPE });
0231: syncMethodLongD = JoinPointTestClass.class
0232: .getDeclaredMethod("syncMethodLongD", new Class[] {
0233: Double.TYPE, Double.TYPE });
0234:
0235: // INVOKEINTERFACE
0236: interfaceMethod = JoinPointTestClass.class
0237: .getDeclaredMethod("interfaceMethodShort",
0238: new Class[] {});
0239: interfaceMethodLongO = JoinPointTestClass.class
0240: .getDeclaredMethod("interfaceMethodLongO",
0241: new Class[] { Object.class, Object.class });
0242: interfaceMethodLongI = JoinPointTestClass.class
0243: .getDeclaredMethod("interfaceMethodLongI",
0244: new Class[] { Integer.TYPE, Integer.TYPE });
0245: interfaceMethodLongL = JoinPointTestClass.class
0246: .getDeclaredMethod("interfaceMethodLongL",
0247: new Class[] { Long.TYPE, Long.TYPE });
0248: interfaceMethodLongD = JoinPointTestClass.class
0249: .getDeclaredMethod("interfaceMethodLongD",
0250: new Class[] { Double.TYPE, Double.TYPE });
0251:
0252: // INVOKESTATIC
0253: staticMethod = JoinPointTestClass.class.getDeclaredMethod(
0254: "staticMethodShort", new Class[] {});
0255: staticMethodLongO = JoinPointTestClass.class
0256: .getDeclaredMethod("staticMethodLongO",
0257: new Class[] { Object.class, Object.class });
0258: staticMethodLongI = JoinPointTestClass.class
0259: .getDeclaredMethod("staticMethodLongI",
0260: new Class[] { Integer.TYPE, Integer.TYPE });
0261: staticMethodLongL = JoinPointTestClass.class
0262: .getDeclaredMethod("staticMethodLongL",
0263: new Class[] { Long.TYPE, Long.TYPE });
0264: staticMethodLongD = JoinPointTestClass.class
0265: .getDeclaredMethod("staticMethodLongD",
0266: new Class[] { Double.TYPE, Double.TYPE });
0267:
0268: // INVOKESPECIAL
0269: privateMethod = JoinPointMeasurements1.class
0270: .getDeclaredMethod("privatelocalMethod",
0271: new Class[] {});
0272: privateMethodLongO = JoinPointMeasurements1.class
0273: .getDeclaredMethod("privatelocalMethodLongO",
0274: new Class[] { Object.class, Object.class });
0275: privateMethodLongI = JoinPointMeasurements1.class
0276: .getDeclaredMethod("privatelocalMethodLongI",
0277: new Class[] { Integer.TYPE, Integer.TYPE });
0278: privateMethodLongL = JoinPointMeasurements1.class
0279: .getDeclaredMethod("privatelocalMethodLongL",
0280: new Class[] { Long.TYPE, Long.TYPE });
0281: privateMethodLongD = JoinPointMeasurements1.class
0282: .getDeclaredMethod("privatelocalMethodLongD",
0283: new Class[] { Double.TYPE, Double.TYPE });
0284:
0285: field = JoinPointMeasurements1.class
0286: .getDeclaredField("theField");
0287: }
0288:
0289: fieldAccessCount = 0;
0290: fieldModificationCount = 0;
0291: methodEntryCount = 0;
0292: methodExitCount = 0;
0293: exceptionThrowCount = 0;
0294: exceptionCatchCount = 0;
0295: }
0296:
0297: protected void tearDown() {
0298: if (useProse)
0299: aspectInterface.teardown();
0300: }
0301:
0302: //=====================================================
0303:
0304: // 1) INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
0305: public void testVirtualMethod_no_jp_NoArg() {
0306: startChronometer();
0307: for (int i = 0; i < RUNS; i++)
0308: localMethod();
0309: stopChronometer();
0310: }
0311:
0312: // 2) INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
0313: public void testVirtualMethodEntry_jp_activated_locked_NoArg() {
0314: if (useProse) {
0315: aspectInterface.suspendNotification(Thread.currentThread()); //suspend all the events(notifications) before the watch(es) has been set
0316: aspectInterface.setMethodEntryWatch(method, new Object());
0317: aspectInterface.resumeNotification(Thread.currentThread()); //advice weaving: all the joinpoints are activated atomically
0318: aspectInterface.suspendNotification(Thread.currentThread());
0319: }
0320:
0321: startChronometer();
0322: for (int i = 0; i < RUNS; i++)
0323: localMethod();
0324: stopChronometer();
0325: }
0326:
0327: // 2) INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
0328: public void testVirtualMethodExit_jp_activated_locked_NoArg() {
0329: if (useProse) {
0330: aspectInterface.suspendNotification(Thread.currentThread());
0331: aspectInterface.setMethodExitWatch(method, new Object());
0332: aspectInterface.resumeNotification(Thread.currentThread());
0333: aspectInterface.suspendNotification(Thread.currentThread());
0334: }
0335:
0336: startChronometer();
0337: for (int i = 0; i < RUNS; i++)
0338: localMethod();
0339: stopChronometer();
0340: }
0341:
0342: // 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
0343: public void testVirtualMethodEntry_jp_activated_NoArg() {
0344: if (useProse) {
0345: aspectInterface.suspendNotification(Thread.currentThread());
0346: aspectInterface.setMethodEntryWatch(method, new Object());
0347: aspectInterface.resumeNotification(Thread.currentThread());
0348: }
0349:
0350: startChronometer();
0351: for (int i = 0; i < RUNS; i++)
0352: localMethod();
0353: stopChronometer();
0354:
0355: if (checkAssert)
0356: assertEquals("Hook notifications", RUNS, methodEntryCount);
0357: }
0358:
0359: // 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
0360: public void testVirtualMethodExit_jp_activated_NoArg() {
0361: if (useProse) {
0362: aspectInterface.suspendNotification(Thread.currentThread());
0363: aspectInterface.setMethodExitWatch(method, new Object());
0364: aspectInterface.resumeNotification(Thread.currentThread());
0365: }
0366:
0367: startChronometer();
0368: for (int i = 0; i < RUNS; i++)
0369: localMethod();
0370: stopChronometer();
0371:
0372: if (checkAssert)
0373: assertEquals("Hook notifications", RUNS, methodExitCount);
0374: }
0375:
0376: //=====================================================
0377:
0378: // 1) SYNC INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
0379: public void testSyncVirtualMethod_no_jp_NoArg() {
0380: startChronometer();
0381: for (int i = 0; i < RUNS; i++)
0382: obSync.syncMethodShort();
0383: stopChronometer();
0384: }
0385:
0386: // 2) SYNC INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
0387: public void testSyncVirtualMethodEntry_jp_activated_locked_NoArg() {
0388: if (useProse) {
0389: aspectInterface.suspendNotification(Thread.currentThread()); //suspend all the events(notifications) before the watch(es) has been set
0390: aspectInterface.setMethodEntryWatch(syncMethod,
0391: new Object());
0392: aspectInterface.resumeNotification(Thread.currentThread()); //advice weaving: all the joinpoints are activated atomically
0393: aspectInterface.suspendNotification(Thread.currentThread());
0394: }
0395:
0396: startChronometer();
0397: for (int i = 0; i < RUNS; i++)
0398: obSync.syncMethodShort();
0399: stopChronometer();
0400: }
0401:
0402: // 2) SYNC INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
0403: public void testSyncVirtualMethodExit_jp_activated_locked_NoArg() {
0404: if (useProse) {
0405: aspectInterface.suspendNotification(Thread.currentThread());
0406: aspectInterface
0407: .setMethodExitWatch(syncMethod, new Object());
0408: aspectInterface.resumeNotification(Thread.currentThread());
0409: aspectInterface.suspendNotification(Thread.currentThread());
0410: }
0411:
0412: startChronometer();
0413: for (int i = 0; i < RUNS; i++)
0414: obSync.syncMethodShort();
0415: stopChronometer();
0416: }
0417:
0418: // 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
0419: public void testSyncVirtualMethodEntry_jp_activated_NoArg() {
0420: if (useProse) {
0421: aspectInterface.suspendNotification(Thread.currentThread());
0422: aspectInterface.setMethodEntryWatch(syncMethod,
0423: new Object());
0424: aspectInterface.resumeNotification(Thread.currentThread());
0425: }
0426:
0427: startChronometer();
0428: for (int i = 0; i < RUNS; i++)
0429: obSync.syncMethodShort();
0430: stopChronometer();
0431:
0432: if (checkAssert)
0433: assertEquals("Hook notifications", RUNS, methodEntryCount);
0434: }
0435:
0436: // 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
0437: public void testSyncVirtualMethodExit_jp_activated_NoArg() {
0438: if (useProse) {
0439: aspectInterface.suspendNotification(Thread.currentThread());
0440: aspectInterface
0441: .setMethodExitWatch(syncMethod, new Object());
0442: aspectInterface.resumeNotification(Thread.currentThread());
0443: }
0444:
0445: startChronometer();
0446: for (int i = 0; i < RUNS; i++)
0447: obSync.syncMethodShort();
0448: stopChronometer();
0449:
0450: if (checkAssert)
0451: assertEquals("Hook notifications", RUNS, methodExitCount);
0452: }
0453:
0454: //=====================================================
0455:
0456: // 1) INVOKEINTERFACE - no call to weaver because the joinpoint isn't activated
0457: public void testInterfaceMethod_no_jp_NoArg() {
0458: startChronometer();
0459: for (int i = 0; i < RUNS; i++)
0460: obInterface.interfaceMethodShort();
0461: stopChronometer();
0462: }
0463:
0464: // 2) INVOKEINTERFACE - no call to weaver because joinpoint is activated but locked
0465: public void testInterfaceMethodEntry_jp_activated_locked_NoArg() {
0466: if (useProse) {
0467: aspectInterface.suspendNotification(Thread.currentThread());
0468: aspectInterface.setMethodEntryWatch(interfaceMethod,
0469: new Object());
0470: aspectInterface.resumeNotification(Thread.currentThread());
0471: aspectInterface.suspendNotification(Thread.currentThread());
0472: }
0473:
0474: startChronometer();
0475: for (int i = 0; i < RUNS; i++)
0476: obInterface.interfaceMethodShort();
0477: stopChronometer();
0478: }
0479:
0480: // 2) INVOKEINTERFACE - no call to weaver because joinpoint is activated but locked
0481: public void testInterfaceMethodExit_jp_activated_locked_NoArg() {
0482: if (useProse) {
0483: aspectInterface.suspendNotification(Thread.currentThread());
0484: aspectInterface.setMethodExitWatch(interfaceMethod,
0485: new Object());
0486: aspectInterface.resumeNotification(Thread.currentThread());
0487: aspectInterface.suspendNotification(Thread.currentThread());
0488: }
0489:
0490: startChronometer();
0491: for (int i = 0; i < RUNS; i++)
0492: obInterface.interfaceMethodShort();
0493: stopChronometer();
0494: }
0495:
0496: // 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
0497: public void testInterfaceMethodEntry_jp_activated_NoArg() {
0498: if (useProse) {
0499: aspectInterface.suspendNotification(Thread.currentThread());
0500: aspectInterface.setMethodEntryWatch(interfaceMethod,
0501: new Object());
0502: aspectInterface.resumeNotification(Thread.currentThread());
0503: }
0504:
0505: startChronometer();
0506: for (int i = 0; i < RUNS; i++)
0507: obInterface.interfaceMethodShort();
0508: stopChronometer();
0509:
0510: if (checkAssert)
0511: assertEquals("Hook notifications", RUNS, methodEntryCount);
0512: }
0513:
0514: // 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
0515: public void testInterfaceMethodExit_jp_activated_NoArg() {
0516: if (useProse) {
0517: aspectInterface.suspendNotification(Thread.currentThread());
0518: aspectInterface.setMethodExitWatch(interfaceMethod,
0519: new Object());
0520: aspectInterface.resumeNotification(Thread.currentThread());
0521: }
0522:
0523: startChronometer();
0524: for (int i = 0; i < RUNS; i++)
0525: obInterface.interfaceMethodShort();
0526: stopChronometer();
0527:
0528: if (checkAssert)
0529: assertEquals("Hook notifications", RUNS, methodExitCount);
0530: }
0531:
0532: //=====================================================
0533:
0534: // 1) INVOKESTATIC - no call to weaver because the joinpoint isn't activated
0535: public void testStaticMethod_no_jp_NoArg() {
0536: startChronometer();
0537: for (int i = 0; i < RUNS; i++)
0538: JoinPointTestClass.staticMethodShort();
0539: stopChronometer();
0540: }
0541:
0542: // 2) INVOKESTATIC - no call to weaver because joinpoint is activated but locked
0543: public void testStaticMethodEntry_jp_activated_locked_NoArg() {
0544: if (useProse) {
0545: aspectInterface.suspendNotification(Thread.currentThread());
0546: aspectInterface.setMethodEntryWatch(staticMethod,
0547: new Object());
0548: aspectInterface.resumeNotification(Thread.currentThread());
0549: aspectInterface.suspendNotification(Thread.currentThread());
0550: }
0551:
0552: startChronometer();
0553: for (int i = 0; i < RUNS; i++)
0554: JoinPointTestClass.staticMethodShort();
0555: stopChronometer();
0556: }
0557:
0558: // 2) INVOKESTATIC - no call to weaver because joinpoint is activated but locked
0559: public void testStaticMethodExit_jp_activated_locked_NoArg() {
0560: if (useProse) {
0561: aspectInterface.suspendNotification(Thread.currentThread());
0562: aspectInterface.setMethodExitWatch(staticMethod,
0563: new Object());
0564: aspectInterface.resumeNotification(Thread.currentThread());
0565: aspectInterface.suspendNotification(Thread.currentThread());
0566: }
0567:
0568: startChronometer();
0569: for (int i = 0; i < RUNS; i++)
0570: JoinPointTestClass.staticMethodShort();
0571: stopChronometer();
0572: }
0573:
0574: // 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
0575: public void testStaticMethodEntry_jp_activated_NoArg() {
0576: if (useProse) {
0577: aspectInterface.suspendNotification(Thread.currentThread());
0578: aspectInterface.setMethodEntryWatch(staticMethod,
0579: new Object());
0580: aspectInterface.resumeNotification(Thread.currentThread());
0581: }
0582:
0583: startChronometer();
0584: for (int i = 0; i < RUNS; i++)
0585: JoinPointTestClass.staticMethodShort();
0586: stopChronometer();
0587:
0588: if (checkAssert)
0589: assertEquals("Hook notifications", RUNS, methodEntryCount);
0590: }
0591:
0592: // 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
0593: public void testStaticMethodExit_jp_activated_NoArg() {
0594: if (useProse) {
0595: aspectInterface.suspendNotification(Thread.currentThread());
0596: aspectInterface.setMethodExitWatch(staticMethod,
0597: new Object());
0598: aspectInterface.resumeNotification(Thread.currentThread());
0599: }
0600:
0601: startChronometer();
0602: for (int i = 0; i < RUNS; i++)
0603: JoinPointTestClass.staticMethodShort();
0604: stopChronometer();
0605:
0606: if (checkAssert)
0607: assertEquals("Hook notifications", RUNS, methodExitCount);
0608: }
0609:
0610: //=====================================================
0611:
0612: // 1) INVOKESPECIAL - no call to weaver because the joinpoint isn't activated
0613: public void testSpecialMethod_no_jp_NoArg() {
0614: startChronometer();
0615: for (int i = 0; i < RUNS; i++)
0616: privatelocalMethod();
0617: stopChronometer();
0618: }
0619:
0620: // 2) INVOKESPECIAL - no call to weaver because joinpoint is activated but locked
0621: public void testSpecialMethodEntry_jp_activated_locked_NoArg() {
0622: if (useProse) {
0623: aspectInterface.suspendNotification(Thread.currentThread());
0624: aspectInterface.setMethodEntryWatch(privateMethod,
0625: new Object());
0626: aspectInterface.resumeNotification(Thread.currentThread());
0627: aspectInterface.suspendNotification(Thread.currentThread());
0628: }
0629:
0630: startChronometer();
0631: for (int i = 0; i < RUNS; i++)
0632: privatelocalMethod();
0633: stopChronometer();
0634: }
0635:
0636: // 2) INVOKESPECIAL - no call to weaver because joinpoint is activated but locked
0637: public void testSpecialMethodExit_jp_activated_locked_NoArg() {
0638: if (useProse) {
0639: aspectInterface.suspendNotification(Thread.currentThread());
0640: aspectInterface.setMethodExitWatch(privateMethod,
0641: new Object());
0642: aspectInterface.resumeNotification(Thread.currentThread());
0643: aspectInterface.suspendNotification(Thread.currentThread());
0644: }
0645:
0646: startChronometer();
0647: for (int i = 0; i < RUNS; i++)
0648: privatelocalMethod();
0649: stopChronometer();
0650: }
0651:
0652: // 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
0653: public void testSpecialMethodEntry_jp_activated_NoArg() {
0654: if (useProse) {
0655: aspectInterface.suspendNotification(Thread.currentThread());
0656: aspectInterface.setMethodEntryWatch(privateMethod,
0657: new Object());
0658: aspectInterface.resumeNotification(Thread.currentThread());
0659: }
0660:
0661: startChronometer();
0662: for (int i = 0; i < RUNS; i++)
0663: privatelocalMethod();
0664: stopChronometer();
0665:
0666: if (checkAssert)
0667: assertEquals("Hook notifications", RUNS, methodEntryCount);
0668: }
0669:
0670: // 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
0671: public void testSpecialMethodExit_jp_activated_NoArg() {
0672: if (useProse) {
0673: aspectInterface.suspendNotification(Thread.currentThread());
0674: aspectInterface.setMethodExitWatch(privateMethod,
0675: new Object());
0676: aspectInterface.resumeNotification(Thread.currentThread());
0677: }
0678:
0679: startChronometer();
0680: for (int i = 0; i < RUNS; i++)
0681: privatelocalMethod();
0682: stopChronometer();
0683:
0684: if (checkAssert)
0685: assertEquals("Hook notifications", RUNS, methodExitCount);
0686: }
0687:
0688: //=====================================================
0689:
0690: // 1) GETFIELD - no call to weaver because the joinpoint isn't activated
0691: public void testFieldAccess_no_jp_NoArg() {
0692: this .theFieldAccess(RUNS);
0693: }
0694:
0695: // 2) GETFIELD - no call to weaver because joinpoint is activated but locked
0696: public void testFieldAccess_jp_activated_locked_NoArg() {
0697: if (useProse) {
0698: aspectInterface.suspendNotification(Thread.currentThread());
0699: aspectInterface.setFieldAccessWatch(field, new Object());
0700: aspectInterface.resumeNotification(Thread.currentThread());
0701: aspectInterface.suspendNotification(Thread.currentThread());
0702: }
0703:
0704: this .theFieldAccess(RUNS);
0705: }
0706:
0707: // 3) GETFIELD - call to empty weaver because of on active, unlocked joinpoint
0708: public void testFieldAccess_jp_activated_NoArg() {
0709: if (useProse) {
0710: aspectInterface.suspendNotification(Thread.currentThread());
0711: aspectInterface.setFieldAccessWatch(field, new Object());
0712: aspectInterface.resumeNotification(Thread.currentThread());
0713: }
0714:
0715: this .theFieldAccess(RUNS);
0716:
0717: if (checkAssert)
0718: assertEquals("Hook notifications", RUNS, fieldAccessCount);
0719: }
0720:
0721: //=====================================================
0722:
0723: // 1) PUTFIELD - no call to weaver because the joinpoint isn't activated
0724: public void testFieldModification_no_jp_NoArg() {
0725: this .theFieldModification(RUNS);
0726: }
0727:
0728: // 2) PUTFIELD - no call to weaver because joinpoint is activated but locked
0729: public void testFieldModification_jp_activated_locked_NoArg() {
0730: if (useProse) {
0731: aspectInterface.suspendNotification(Thread.currentThread());
0732: aspectInterface.setFieldModificationWatch(field,
0733: new Object());
0734: aspectInterface.resumeNotification(Thread.currentThread());
0735: aspectInterface.suspendNotification(Thread.currentThread());
0736: }
0737:
0738: this .theFieldModification(RUNS);
0739: }
0740:
0741: // 3) PUTFIELD - call to empty weaver because of on active, unlocked joinpoint
0742: public void testFieldModification_jp_activated_NoArg() {
0743: if (useProse) {
0744: aspectInterface.suspendNotification(Thread.currentThread());
0745: aspectInterface.setFieldModificationWatch(field,
0746: new Object());
0747: aspectInterface.resumeNotification(Thread.currentThread());
0748: }
0749:
0750: this .theFieldModification(RUNS);
0751:
0752: if (checkAssert)
0753: assertEquals("Hook notifications", RUNS,
0754: fieldModificationCount);
0755: }
0756:
0757: //=====================================================
0758:
0759: public void exceptionThrow() throws TestException {
0760: throw exception;
0761: }
0762:
0763: public void exceptionCatch() {
0764: try {
0765: exceptionThrow();
0766: } catch (TestException e) {
0767: }
0768: }
0769:
0770: //=====================================================
0771:
0772: // 1) THROW - no call to weaver because the joinpoint isn't activated
0773: public void testExceptionThrow_no_jp_NoArg() {
0774: //RUNS = 1000000;
0775: TestException e = new TestException();
0776:
0777: startChronometer();
0778: for (int i = 0; i < RUNS; i++)
0779: exceptionCatch();
0780: stopChronometer();
0781: }
0782:
0783: // 2) THROW - no call to weaver because joinpoint is activated but locked
0784: public void testExceptionThrow_jp_activated_locked_NoArg() {
0785: if (useProse) {
0786: aspectInterface.suspendNotification(Thread.currentThread());
0787: aspectInterface.setExceptionThrowWatch(TestException.class,
0788: new Object());
0789: aspectInterface.resumeNotification(Thread.currentThread());
0790: aspectInterface.suspendNotification(Thread.currentThread());
0791: }
0792:
0793: //RUNS = 1000000;
0794: TestException e = new TestException();
0795:
0796: startChronometer();
0797: for (int i = 0; i < RUNS; i++)
0798: exceptionCatch();
0799: stopChronometer();
0800: }
0801:
0802: // 3) THROW - call to empty weaver because of on active, unlocked joinpoint
0803: public void testExceptionThrow_jp_activated_NoArg() {
0804: if (useProse) {
0805: aspectInterface.suspendNotification(Thread.currentThread());
0806: aspectInterface.setExceptionThrowWatch(TestException.class,
0807: new Object());
0808: aspectInterface.resumeNotification(Thread.currentThread());
0809: }
0810:
0811: //RUNS = 1000000;
0812: TestException e = new TestException();
0813:
0814: startChronometer();
0815: for (int i = 0; i < RUNS; i++)
0816: exceptionCatch();
0817: stopChronometer();
0818:
0819: if (checkAssert)
0820: assertEquals("Hook notifications", RUNS,
0821: exceptionThrowCount);
0822: }
0823:
0824: //=====================================================
0825:
0826: // 1) CATCH - no call to weaver because the joinpoint isn't activated
0827: public void testExceptionCatch_no_jp_NoArg() {
0828: //RUNS = 1000000;
0829: TestException e = new TestException();
0830:
0831: startChronometer();
0832: for (int i = 0; i < RUNS; i++)
0833: exceptionCatch();
0834: stopChronometer();
0835: }
0836:
0837: // 2) CATCH - no call to weaver because joinpoint is activated but locked
0838: public void testExceptionCatch_jp_activated_locked_NoArg() {
0839: if (useProse) {
0840: aspectInterface.suspendNotification(Thread.currentThread());
0841: aspectInterface.setExceptionCatchWatch(TestException.class,
0842: new Object());
0843: aspectInterface.resumeNotification(Thread.currentThread());
0844: aspectInterface.suspendNotification(Thread.currentThread());
0845: }
0846:
0847: //RUNS = 1000000;
0848: TestException e = new TestException();
0849:
0850: startChronometer();
0851: for (int i = 0; i < RUNS; i++)
0852: exceptionCatch();
0853: stopChronometer();
0854: }
0855:
0856: // 3) CATCH - call to empty weaver because of on active, unlocked joinpoint
0857: public void testExceptionCatch_jp_activated_NoArg() {
0858: if (useProse) {
0859: aspectInterface.suspendNotification(Thread.currentThread());
0860: aspectInterface.setExceptionCatchWatch(TestException.class,
0861: new Object());
0862: aspectInterface.resumeNotification(Thread.currentThread());
0863: }
0864:
0865: //RUNS = 1000000;
0866: TestException e = new TestException();
0867:
0868: startChronometer();
0869: for (int i = 0; i < RUNS; i++)
0870: exceptionCatch();
0871: stopChronometer();
0872:
0873: if (checkAssert)
0874: assertEquals("Hook notifications", RUNS,
0875: exceptionCatchCount);
0876: }
0877:
0878: //=====================================================
0879: //=====================================================
0880: //=====================================================
0881: //=====================================================
0882: //=====================================================
0883:
0884: // Method arguments: (Object, Object)
0885: //=====================================================
0886:
0887: // 1) INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
0888: public void testVirtualMethod_LongO() {
0889: Object obj = new Object();
0890: startChronometer();
0891: for (int i = 0; i < RUNS; i++)
0892: localMethodLongO(obj, obj);
0893: stopChronometer();
0894: }
0895:
0896: /*
0897: // 2) INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
0898: public void testVirtualMethodEntry_jp_activated_locked_LongO()
0899: {
0900: Object obj = new Object();
0901: if (useProse) {
0902: aspectInterface.suspendNotification(Thread.currentThread());
0903: aspectInterface.setMethodEntryWatch(methodLongO, new Object());
0904: aspectInterface.resumeNotification(Thread.currentThread());
0905: aspectInterface.suspendNotification(Thread.currentThread());
0906: }
0907:
0908: startChronometer();
0909: for (int i = 0; i < RUNS; i++) localMethodLongO(obj, obj);
0910: stopChronometer();
0911: }
0912:
0913: // 2) INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
0914: public void testVirtualMethodExit_jp_activated_locked_LongO()
0915: {
0916: Object obj = new Object();
0917: if (useProse) {
0918: aspectInterface.suspendNotification(Thread.currentThread());
0919: aspectInterface.setMethodExitWatch(methodLongO, new Object());
0920: aspectInterface.resumeNotification(Thread.currentThread());
0921: aspectInterface.suspendNotification(Thread.currentThread());
0922: }
0923:
0924: startChronometer();
0925: for (int i = 0; i < RUNS; i++) localMethodLongO(obj, obj);
0926: stopChronometer();
0927: }
0928: */
0929: // 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
0930: public void testVirtualMethodEntry_jp_activated_LongO() {
0931: Object obj = new Object();
0932: if (useProse) {
0933: aspectInterface.suspendNotification(Thread.currentThread());
0934: aspectInterface.setMethodEntryWatch(methodLongO,
0935: new Object());
0936: aspectInterface.resumeNotification(Thread.currentThread());
0937: }
0938:
0939: startChronometer();
0940: for (int i = 0; i < RUNS; i++)
0941: localMethodLongO(obj, obj);
0942: stopChronometer();
0943:
0944: if (checkAssert)
0945: assertEquals("Hook notifications", RUNS, methodEntryCount);
0946: }
0947:
0948: // 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
0949: public void testVirtualMethodExit_jp_activated_LongO() {
0950: Object obj = new Object();
0951: if (useProse) {
0952: aspectInterface.suspendNotification(Thread.currentThread());
0953: aspectInterface.setMethodExitWatch(methodLongO,
0954: new Object());
0955: aspectInterface.resumeNotification(Thread.currentThread());
0956: }
0957:
0958: startChronometer();
0959: for (int i = 0; i < RUNS; i++)
0960: localMethodLongO(obj, obj);
0961: stopChronometer();
0962:
0963: if (checkAssert)
0964: assertEquals("Hook notifications", RUNS, methodExitCount);
0965: }
0966:
0967: //=====================================================
0968:
0969: // 1) SYNC INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
0970: public void testSyncVirtualMethod_LongO() {
0971: Object obj = new Object();
0972: startChronometer();
0973: for (int i = 0; i < RUNS; i++)
0974: obSync.syncMethodLongO(obj, obj);
0975: stopChronometer();
0976: }
0977:
0978: /*
0979: // 2) SYNC INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
0980: public void testSyncVirtualMethodEntry_jp_activated_locked_LongO()
0981: {
0982: Object obj = new Object();
0983: if (useProse) {
0984: aspectInterface.suspendNotification(Thread.currentThread());
0985: aspectInterface.setMethodEntryWatch(syncMethodLongO, new Object());
0986: aspectInterface.resumeNotification(Thread.currentThread());
0987: aspectInterface.suspendNotification(Thread.currentThread());
0988: }
0989:
0990: startChronometer();
0991: for (int i = 0; i < RUNS; i++) obSync.syncMethodLongO(obj, obj);
0992: stopChronometer();
0993: }
0994:
0995: // 2) SYNC INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
0996: public void testSyncVirtualMethodExit_jp_activated_locked_LongO()
0997: {
0998: Object obj = new Object();
0999: if (useProse) {
1000: aspectInterface.suspendNotification(Thread.currentThread());
1001: aspectInterface.setMethodExitWatch(syncMethodLongO, new Object());
1002: aspectInterface.resumeNotification(Thread.currentThread());
1003: aspectInterface.suspendNotification(Thread.currentThread());
1004: }
1005:
1006: startChronometer();
1007: for (int i = 0; i < RUNS; i++) obSync.syncMethodLongO(obj, obj);
1008: stopChronometer();
1009: }
1010: */
1011: // 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
1012: public void testSyncVirtualMethodEntry_jp_activated_LongO() {
1013: Object obj = new Object();
1014: if (useProse) {
1015: aspectInterface.suspendNotification(Thread.currentThread());
1016: aspectInterface.setMethodEntryWatch(syncMethodLongO,
1017: new Object());
1018: aspectInterface.resumeNotification(Thread.currentThread());
1019: }
1020:
1021: startChronometer();
1022: for (int i = 0; i < RUNS; i++)
1023: obSync.syncMethodLongO(obj, obj);
1024: stopChronometer();
1025:
1026: if (checkAssert)
1027: assertEquals("Hook notifications", RUNS, methodEntryCount);
1028: }
1029:
1030: // 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
1031: public void testSyncVirtualMethodExit_jp_activated_LongO() {
1032: Object obj = new Object();
1033: if (useProse) {
1034: aspectInterface.suspendNotification(Thread.currentThread());
1035: aspectInterface.setMethodExitWatch(syncMethodLongO,
1036: new Object());
1037: aspectInterface.resumeNotification(Thread.currentThread());
1038: }
1039:
1040: startChronometer();
1041: for (int i = 0; i < RUNS; i++)
1042: obSync.syncMethodLongO(obj, obj);
1043: stopChronometer();
1044:
1045: if (checkAssert)
1046: assertEquals("Hook notifications", RUNS, methodExitCount);
1047: }
1048:
1049: //=====================================================
1050:
1051: // 1) INVOKEINTERFACE - no call to weaver because the joinpoint isn't activated
1052: public void testInterfaceMethod_LongO() {
1053: Object obj = new Object();
1054: startChronometer();
1055: for (int i = 0; i < RUNS; i++)
1056: obInterface.interfaceMethodLongO(obj, obj);
1057: stopChronometer();
1058: }
1059:
1060: /*
1061: // 2) INVOKEINTERFACE - no call to weaver because joinpoint is activated but locked
1062: public void testInterfaceMethodEntry_jp_activated_locked_LongO()
1063: {
1064: Object obj = new Object();
1065: if (useProse) {
1066: aspectInterface.suspendNotification(Thread.currentThread());
1067: aspectInterface.setMethodEntryWatch(interfaceMethodLongO, new Object());
1068: aspectInterface.resumeNotification(Thread.currentThread());
1069: aspectInterface.suspendNotification(Thread.currentThread());
1070: }
1071:
1072: startChronometer();
1073: for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongO(obj, obj);
1074: stopChronometer();
1075: }
1076:
1077: // 2) INVOKEINTERFACE - no call to weaver because joinpoint is activated but locked
1078: public void testInterfaceMethodExit_jp_activated_locked_LongO()
1079: {
1080: Object obj = new Object();
1081: if (useProse) {
1082: aspectInterface.suspendNotification(Thread.currentThread());
1083: aspectInterface.setMethodExitWatch(interfaceMethodLongO, new Object());
1084: aspectInterface.resumeNotification(Thread.currentThread());
1085: aspectInterface.suspendNotification(Thread.currentThread());
1086: }
1087:
1088: startChronometer();
1089: for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongO(obj, obj);
1090: stopChronometer();
1091: }
1092: */
1093: // 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
1094: public void testInterfaceMethodEntry_jp_activated_LongO() {
1095: Object obj = new Object();
1096: if (useProse) {
1097: aspectInterface.suspendNotification(Thread.currentThread());
1098: aspectInterface.setMethodEntryWatch(interfaceMethodLongO,
1099: new Object());
1100: aspectInterface.resumeNotification(Thread.currentThread());
1101: }
1102:
1103: startChronometer();
1104: for (int i = 0; i < RUNS; i++)
1105: obInterface.interfaceMethodLongO(obj, obj);
1106: stopChronometer();
1107:
1108: if (checkAssert)
1109: assertEquals("Hook notifications", RUNS, methodEntryCount);
1110: }
1111:
1112: // 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
1113: public void testInterfaceMethodExit_jp_activated_LongO() {
1114: Object obj = new Object();
1115: if (useProse) {
1116: aspectInterface.suspendNotification(Thread.currentThread());
1117: aspectInterface.setMethodExitWatch(interfaceMethodLongO,
1118: new Object());
1119: aspectInterface.resumeNotification(Thread.currentThread());
1120: }
1121:
1122: startChronometer();
1123: for (int i = 0; i < RUNS; i++)
1124: obInterface.interfaceMethodLongO(obj, obj);
1125: stopChronometer();
1126:
1127: if (checkAssert)
1128: assertEquals("Hook notifications", RUNS, methodExitCount);
1129: }
1130:
1131: //=====================================================
1132:
1133: // 1) INVOKESTATIC - no call to weaver because the joinpoint isn't activated
1134: public void testStaticMethod_LongO() {
1135: Object obj = new Object();
1136: startChronometer();
1137: for (int i = 0; i < RUNS; i++)
1138: JoinPointTestClass.staticMethodLongO(obj, obj);
1139: stopChronometer();
1140: }
1141:
1142: /*
1143: // 2) INVOKESTATIC - no call to weaver because joinpoint is activated but locked
1144: public void testStaticMethodEntry_jp_activated_locked_LongO()
1145: {
1146: Object obj = new Object();
1147: if (useProse) {
1148: aspectInterface.suspendNotification(Thread.currentThread());
1149: aspectInterface.setMethodEntryWatch(staticMethodLongO, new Object());
1150: aspectInterface.resumeNotification(Thread.currentThread());
1151: aspectInterface.suspendNotification(Thread.currentThread());
1152: }
1153:
1154: startChronometer();
1155: for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongO(obj, obj);
1156: stopChronometer();
1157: }
1158:
1159: // 2) INVOKESTATIC - no call to weaver because joinpoint is activated but locked
1160: public void testStaticMethodExit_jp_activated_locked_LongO()
1161: {
1162: Object obj = new Object();
1163: if (useProse) {
1164: aspectInterface.suspendNotification(Thread.currentThread());
1165: aspectInterface.setMethodExitWatch(staticMethodLongO, new Object());
1166: aspectInterface.resumeNotification(Thread.currentThread());
1167: aspectInterface.suspendNotification(Thread.currentThread());
1168: }
1169:
1170: startChronometer();
1171: for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongO(obj, obj);
1172: stopChronometer();
1173: }
1174: */
1175: // 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
1176: public void testStaticMethodEntry_jp_activated_LongO() {
1177: Object obj = new Object();
1178: if (useProse) {
1179: aspectInterface.suspendNotification(Thread.currentThread());
1180: aspectInterface.setMethodEntryWatch(staticMethodLongO,
1181: new Object());
1182: aspectInterface.resumeNotification(Thread.currentThread());
1183: }
1184:
1185: startChronometer();
1186: for (int i = 0; i < RUNS; i++)
1187: JoinPointTestClass.staticMethodLongO(obj, obj);
1188: stopChronometer();
1189:
1190: if (checkAssert)
1191: assertEquals("Hook notifications", RUNS, methodEntryCount);
1192: }
1193:
1194: // 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
1195: public void testStaticMethodExit_jp_activated_LongO() {
1196: Object obj = new Object();
1197: if (useProse) {
1198: aspectInterface.suspendNotification(Thread.currentThread());
1199: aspectInterface.setMethodExitWatch(staticMethodLongO,
1200: new Object());
1201: aspectInterface.resumeNotification(Thread.currentThread());
1202: }
1203:
1204: startChronometer();
1205: for (int i = 0; i < RUNS; i++)
1206: JoinPointTestClass.staticMethodLongO(obj, obj);
1207: stopChronometer();
1208:
1209: if (checkAssert)
1210: assertEquals("Hook notifications", RUNS, methodExitCount);
1211: }
1212:
1213: //=====================================================
1214:
1215: // 1) INVOKESPECIAL - no call to weaver because the joinpoint isn't activated
1216: public void testSpecialMethod_LongO() {
1217: Object obj = new Object();
1218: startChronometer();
1219: for (int i = 0; i < RUNS; i++)
1220: privatelocalMethodLongO(obj, obj);
1221: stopChronometer();
1222: }
1223:
1224: /*
1225: // 2) INVOKESPECIAL - no call to weaver because joinpoint is activated but locked
1226: public void testSpecialMethodEntry_jp_activated_locked_LongO()
1227: {
1228: Object obj = new Object();
1229: if (useProse) {
1230: aspectInterface.suspendNotification(Thread.currentThread());
1231: aspectInterface.setMethodEntryWatch(privateMethodLongO, new Object());
1232: aspectInterface.resumeNotification(Thread.currentThread());
1233: aspectInterface.suspendNotification(Thread.currentThread());
1234: }
1235:
1236: startChronometer();
1237: for (int i = 0; i < RUNS; i++) privatelocalMethodLongO(obj, obj);
1238: stopChronometer();
1239: }
1240:
1241: // 2) INVOKESPECIAL - no call to weaver because joinpoint is activated but locked
1242: public void testSpecialMethodExit_jp_activated_locked_LongO()
1243: {
1244: Object obj = new Object();
1245: if (useProse) {
1246: aspectInterface.suspendNotification(Thread.currentThread());
1247: aspectInterface.setMethodExitWatch(privateMethodLongO, new Object());
1248: aspectInterface.resumeNotification(Thread.currentThread());
1249: aspectInterface.suspendNotification(Thread.currentThread());
1250: }
1251:
1252: startChronometer();
1253: for (int i = 0; i < RUNS; i++) privatelocalMethodLongO(obj, obj);
1254: stopChronometer();
1255: }
1256: */
1257: // 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
1258: public void testSpecialMethodEntry_jp_activated_LongO() {
1259: Object obj = new Object();
1260: if (useProse) {
1261: aspectInterface.suspendNotification(Thread.currentThread());
1262: aspectInterface.setMethodEntryWatch(privateMethodLongO,
1263: new Object());
1264: aspectInterface.resumeNotification(Thread.currentThread());
1265: }
1266:
1267: startChronometer();
1268: for (int i = 0; i < RUNS; i++)
1269: privatelocalMethodLongO(obj, obj);
1270: stopChronometer();
1271:
1272: if (checkAssert)
1273: assertEquals("Hook notifications", RUNS, methodEntryCount);
1274: }
1275:
1276: // 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
1277: public void testSpecialMethodExit_jp_activated_LongO() {
1278: Object obj = new Object();
1279: if (useProse) {
1280: aspectInterface.suspendNotification(Thread.currentThread());
1281: aspectInterface.setMethodExitWatch(privateMethodLongO,
1282: new Object());
1283: aspectInterface.resumeNotification(Thread.currentThread());
1284: }
1285:
1286: startChronometer();
1287: for (int i = 0; i < RUNS; i++)
1288: privatelocalMethodLongO(obj, obj);
1289: stopChronometer();
1290:
1291: if (checkAssert)
1292: assertEquals("Hook notifications", RUNS, methodExitCount);
1293: }
1294:
1295: //=====================================================
1296: //=====================================================
1297:
1298: // Method arguments: (int, int)
1299: //=====================================================
1300:
1301: // 1) INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
1302: public void testVirtualMethod_LongI() {
1303: int obj = 1;
1304: startChronometer();
1305: for (int i = 0; i < RUNS; i++)
1306: localMethodLongI(obj, obj);
1307: stopChronometer();
1308: }
1309:
1310: /*
1311: // 2) INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
1312: public void testVirtualMethodEntry_jp_activated_locked_LongI()
1313: {
1314: int obj = 1;
1315: if (useProse) {
1316: aspectInterface.suspendNotification(Thread.currentThread());
1317: aspectInterface.setMethodEntryWatch(methodLongI, new Object());
1318: aspectInterface.resumeNotification(Thread.currentThread());
1319: aspectInterface.suspendNotification(Thread.currentThread());
1320: }
1321:
1322: startChronometer();
1323: for (int i = 0; i < RUNS; i++) localMethodLongI(obj, obj);
1324: stopChronometer();
1325: }
1326:
1327: // 2) INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
1328: public void testVirtualMethodExit_jp_activated_locked_LongI()
1329: {
1330: int obj = 1;
1331: if (useProse) {
1332: aspectInterface.suspendNotification(Thread.currentThread());
1333: aspectInterface.setMethodExitWatch(methodLongI, new Object());
1334: aspectInterface.resumeNotification(Thread.currentThread());
1335: aspectInterface.suspendNotification(Thread.currentThread());
1336: }
1337:
1338: startChronometer();
1339: for (int i = 0; i < RUNS; i++) localMethodLongI(obj, obj);
1340: stopChronometer();
1341: }
1342: */
1343: // 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
1344: public void testVirtualMethodEntry_jp_activated_LongI() {
1345: int obj = 1;
1346: if (useProse) {
1347: aspectInterface.suspendNotification(Thread.currentThread());
1348: aspectInterface.setMethodEntryWatch(methodLongI,
1349: new Object());
1350: aspectInterface.resumeNotification(Thread.currentThread());
1351: }
1352:
1353: startChronometer();
1354: for (int i = 0; i < RUNS; i++)
1355: localMethodLongI(obj, obj);
1356: stopChronometer();
1357:
1358: if (checkAssert)
1359: assertEquals("Hook notifications", RUNS, methodEntryCount);
1360: }
1361:
1362: // 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
1363: public void testVirtualMethodExit_jp_activated_LongI() {
1364: int obj = 1;
1365: if (useProse) {
1366: aspectInterface.suspendNotification(Thread.currentThread());
1367: aspectInterface.setMethodExitWatch(methodLongI,
1368: new Object());
1369: aspectInterface.resumeNotification(Thread.currentThread());
1370: }
1371:
1372: startChronometer();
1373: for (int i = 0; i < RUNS; i++)
1374: localMethodLongI(obj, obj);
1375: stopChronometer();
1376:
1377: if (checkAssert)
1378: assertEquals("Hook notifications", RUNS, methodExitCount);
1379: }
1380:
1381: //=====================================================
1382:
1383: // 1) SYNC INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
1384: public void testSyncVirtualMethod_LongI() {
1385: int obj = 1;
1386: startChronometer();
1387: for (int i = 0; i < RUNS; i++)
1388: obSync.syncMethodLongI(obj, obj);
1389: stopChronometer();
1390: }
1391:
1392: /*
1393: // 2) SYNC INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
1394: public void testSyncVirtualMethodEntry_jp_activated_locked_LongI()
1395: {
1396: int obj = 1;
1397: if (useProse) {
1398: aspectInterface.suspendNotification(Thread.currentThread());
1399: aspectInterface.setMethodEntryWatch(syncMethodLongI, new Object());
1400: aspectInterface.resumeNotification(Thread.currentThread());
1401: aspectInterface.suspendNotification(Thread.currentThread());
1402: }
1403:
1404: startChronometer();
1405: for (int i = 0; i < RUNS; i++) obSync.syncMethodLongI(obj, obj);
1406: stopChronometer();
1407: }
1408:
1409: // 2) SYNC INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
1410: public void testSyncVirtualMethodExit_jp_activated_locked_LongI()
1411: {
1412: int obj = 1;
1413: if (useProse) {
1414: aspectInterface.suspendNotification(Thread.currentThread());
1415: aspectInterface.setMethodExitWatch(syncMethodLongI, new Object());
1416: aspectInterface.resumeNotification(Thread.currentThread());
1417: aspectInterface.suspendNotification(Thread.currentThread());
1418: }
1419:
1420: startChronometer();
1421: for (int i = 0; i < RUNS; i++) obSync.syncMethodLongI(obj, obj);
1422: stopChronometer();
1423: }
1424: */
1425: // 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
1426: public void testSyncVirtualMethodEntry_jp_activated_LongI() {
1427: int obj = 1;
1428: if (useProse) {
1429: aspectInterface.suspendNotification(Thread.currentThread());
1430: aspectInterface.setMethodEntryWatch(syncMethodLongI,
1431: new Object());
1432: aspectInterface.resumeNotification(Thread.currentThread());
1433: }
1434:
1435: startChronometer();
1436: for (int i = 0; i < RUNS; i++)
1437: obSync.syncMethodLongI(obj, obj);
1438: stopChronometer();
1439:
1440: if (checkAssert)
1441: assertEquals("Hook notifications", RUNS, methodEntryCount);
1442: }
1443:
1444: // 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
1445: public void testSyncVirtualMethodExit_jp_activated_LongI() {
1446: int obj = 1;
1447: if (useProse) {
1448: aspectInterface.suspendNotification(Thread.currentThread());
1449: aspectInterface.setMethodExitWatch(syncMethodLongI,
1450: new Object());
1451: aspectInterface.resumeNotification(Thread.currentThread());
1452: }
1453:
1454: startChronometer();
1455: for (int i = 0; i < RUNS; i++)
1456: obSync.syncMethodLongI(obj, obj);
1457: stopChronometer();
1458:
1459: if (checkAssert)
1460: assertEquals("Hook notifications", RUNS, methodExitCount);
1461: }
1462:
1463: //=====================================================
1464:
1465: // 1) INVOKEINTERFACE - no call to weaver because the joinpoint isn't activated
1466: public void testInterfaceMethod_LongI() {
1467: int obj = 1;
1468: startChronometer();
1469: for (int i = 0; i < RUNS; i++)
1470: obInterface.interfaceMethodLongI(obj, obj);
1471: stopChronometer();
1472: }
1473:
1474: /*
1475: // 2) INVOKEINTERFACE - no call to weaver because joinpoint is activated but locked
1476: public void testInterfaceMethodEntry_jp_activated_locked_LongI()
1477: {
1478: int obj = 1;
1479: if (useProse) {
1480: aspectInterface.suspendNotification(Thread.currentThread());
1481: aspectInterface.setMethodEntryWatch(interfaceMethodLongI, new Object());
1482: aspectInterface.resumeNotification(Thread.currentThread());
1483: aspectInterface.suspendNotification(Thread.currentThread());
1484: }
1485:
1486: startChronometer();
1487: for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongI(obj, obj);
1488: stopChronometer();
1489: }
1490:
1491: // 2) INVOKEINTERFACE - no call to weaver because joinpoint is activated but locked
1492: public void testInterfaceMethodExit_jp_activated_locked_LongI()
1493: {
1494: int obj = 1;
1495: if (useProse) {
1496: aspectInterface.suspendNotification(Thread.currentThread());
1497: aspectInterface.setMethodExitWatch(interfaceMethodLongI, new Object());
1498: aspectInterface.resumeNotification(Thread.currentThread());
1499: aspectInterface.suspendNotification(Thread.currentThread());
1500: }
1501:
1502: startChronometer();
1503: for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongI(obj, obj);
1504: stopChronometer();
1505: }
1506: */
1507: // 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
1508: public void testInterfaceMethodEntry_jp_activated_LongI() {
1509: int obj = 1;
1510: if (useProse) {
1511: aspectInterface.suspendNotification(Thread.currentThread());
1512: aspectInterface.setMethodEntryWatch(interfaceMethodLongI,
1513: new Object());
1514: aspectInterface.resumeNotification(Thread.currentThread());
1515: }
1516:
1517: startChronometer();
1518: for (int i = 0; i < RUNS; i++)
1519: obInterface.interfaceMethodLongI(obj, obj);
1520: stopChronometer();
1521:
1522: if (checkAssert)
1523: assertEquals("Hook notifications", RUNS, methodEntryCount);
1524: }
1525:
1526: // 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
1527: public void testInterfaceMethodExit_jp_activated_LongI() {
1528: int obj = 1;
1529: if (useProse) {
1530: aspectInterface.suspendNotification(Thread.currentThread());
1531: aspectInterface.setMethodExitWatch(interfaceMethodLongI,
1532: new Object());
1533: aspectInterface.resumeNotification(Thread.currentThread());
1534: }
1535:
1536: startChronometer();
1537: for (int i = 0; i < RUNS; i++)
1538: obInterface.interfaceMethodLongI(obj, obj);
1539: stopChronometer();
1540:
1541: if (checkAssert)
1542: assertEquals("Hook notifications", RUNS, methodExitCount);
1543: }
1544:
1545: //=====================================================
1546:
1547: // 1) INVOKESTATIC - no call to weaver because the joinpoint isn't activated
1548: public void testStaticMethod_LongI() {
1549: int obj = 1;
1550: startChronometer();
1551: for (int i = 0; i < RUNS; i++)
1552: JoinPointTestClass.staticMethodLongI(obj, obj);
1553: stopChronometer();
1554: }
1555:
1556: /*
1557: // 2) INVOKESTATIC - no call to weaver because joinpoint is activated but locked
1558: public void testStaticMethodEntry_jp_activated_locked_LongI()
1559: {
1560: int obj = 1;
1561: if (useProse) {
1562: aspectInterface.suspendNotification(Thread.currentThread());
1563: aspectInterface.setMethodEntryWatch(staticMethodLongI, new Object());
1564: aspectInterface.resumeNotification(Thread.currentThread());
1565: aspectInterface.suspendNotification(Thread.currentThread());
1566: }
1567:
1568: startChronometer();
1569: for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongI(obj, obj);
1570: stopChronometer();
1571: }
1572:
1573: // 2) INVOKESTATIC - no call to weaver because joinpoint is activated but locked
1574: public void testStaticMethodExit_jp_activated_locked_LongI()
1575: {
1576: int obj = 1;
1577: if (useProse) {
1578: aspectInterface.suspendNotification(Thread.currentThread());
1579: aspectInterface.setMethodExitWatch(staticMethodLongI, new Object());
1580: aspectInterface.resumeNotification(Thread.currentThread());
1581: aspectInterface.suspendNotification(Thread.currentThread());
1582: }
1583:
1584: startChronometer();
1585: for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongI(obj, obj);
1586: stopChronometer();
1587: }
1588: */
1589: // 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
1590: public void testStaticMethodEntry_jp_activated_LongI() {
1591: int obj = 1;
1592: if (useProse) {
1593: aspectInterface.suspendNotification(Thread.currentThread());
1594: aspectInterface.setMethodEntryWatch(staticMethodLongI,
1595: new Object());
1596: aspectInterface.resumeNotification(Thread.currentThread());
1597: }
1598:
1599: startChronometer();
1600: for (int i = 0; i < RUNS; i++)
1601: JoinPointTestClass.staticMethodLongI(obj, obj);
1602: stopChronometer();
1603:
1604: if (checkAssert)
1605: assertEquals("Hook notifications", RUNS, methodEntryCount);
1606: }
1607:
1608: // 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
1609: public void testStaticMethodExit_jp_activated_LongI() {
1610: int obj = 1;
1611: if (useProse) {
1612: aspectInterface.suspendNotification(Thread.currentThread());
1613: aspectInterface.setMethodExitWatch(staticMethodLongI,
1614: new Object());
1615: aspectInterface.resumeNotification(Thread.currentThread());
1616: }
1617:
1618: startChronometer();
1619: for (int i = 0; i < RUNS; i++)
1620: JoinPointTestClass.staticMethodLongI(obj, obj);
1621: stopChronometer();
1622:
1623: if (checkAssert)
1624: assertEquals("Hook notifications", RUNS, methodExitCount);
1625: }
1626:
1627: //=====================================================
1628:
1629: // 1) INVOKESPECIAL - no call to weaver because the joinpoint isn't activated
1630: public void testSpecialMethod_LongI() {
1631: int obj = 1;
1632: startChronometer();
1633: for (int i = 0; i < RUNS; i++)
1634: privatelocalMethodLongI(obj, obj);
1635: stopChronometer();
1636: }
1637:
1638: /*
1639: // 2) INVOKESPECIAL - no call to weaver because joinpoint is activated but locked
1640: public void testSpecialMethodEntry_jp_activated_locked_LongI()
1641: {
1642: int obj = 1;
1643: if (useProse) {
1644: aspectInterface.suspendNotification(Thread.currentThread());
1645: aspectInterface.setMethodEntryWatch(privateMethodLongI, new Object());
1646: aspectInterface.resumeNotification(Thread.currentThread());
1647: aspectInterface.suspendNotification(Thread.currentThread());
1648: }
1649:
1650: startChronometer();
1651: for (int i = 0; i < RUNS; i++) privatelocalMethodLongI(obj, obj);
1652: stopChronometer();
1653: }
1654:
1655: // 2) INVOKESPECIAL - no call to weaver because joinpoint is activated but locked
1656: public void testSpecialMethodExit_jp_activated_locked_LongI()
1657: {
1658: int obj = 1;
1659: if (useProse) {
1660: aspectInterface.suspendNotification(Thread.currentThread());
1661: aspectInterface.setMethodExitWatch(privateMethodLongI, new Object());
1662: aspectInterface.resumeNotification(Thread.currentThread());
1663: aspectInterface.suspendNotification(Thread.currentThread());
1664: }
1665:
1666: startChronometer();
1667: for (int i = 0; i < RUNS; i++) privatelocalMethodLongI(obj, obj);
1668: stopChronometer();
1669: }
1670: */
1671: // 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
1672: public void testSpecialMethodEntry_jp_activated_LongI() {
1673: int obj = 1;
1674: if (useProse) {
1675: aspectInterface.suspendNotification(Thread.currentThread());
1676: aspectInterface.setMethodEntryWatch(privateMethodLongI,
1677: new Object());
1678: aspectInterface.resumeNotification(Thread.currentThread());
1679: }
1680:
1681: startChronometer();
1682: for (int i = 0; i < RUNS; i++)
1683: privatelocalMethodLongI(obj, obj);
1684: stopChronometer();
1685:
1686: if (checkAssert)
1687: assertEquals("Hook notifications", RUNS, methodEntryCount);
1688: }
1689:
1690: // 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
1691: public void testSpecialMethodExit_jp_activated_LongI() {
1692: int obj = 1;
1693: if (useProse) {
1694: aspectInterface.suspendNotification(Thread.currentThread());
1695: aspectInterface.setMethodExitWatch(privateMethodLongI,
1696: new Object());
1697: aspectInterface.resumeNotification(Thread.currentThread());
1698: }
1699:
1700: startChronometer();
1701: for (int i = 0; i < RUNS; i++)
1702: privatelocalMethodLongI(obj, obj);
1703: stopChronometer();
1704:
1705: if (checkAssert)
1706: assertEquals("Hook notifications", RUNS, methodExitCount);
1707: }
1708:
1709: //=====================================================
1710: //=====================================================
1711:
1712: // Method arguments: (long, long)
1713: //=====================================================
1714:
1715: // 1) INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
1716: public void testVirtualMethod_LongL() {
1717: long obj = 1;
1718: startChronometer();
1719: for (int i = 0; i < RUNS; i++)
1720: localMethodLongL(obj, obj);
1721: stopChronometer();
1722: }
1723:
1724: /*
1725: // 2) INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
1726: public void testVirtualMethodEntry_jp_activated_locked_LongL()
1727: {
1728: long obj = 1;
1729: if (useProse) {
1730: aspectInterface.suspendNotification(Thread.currentThread());
1731: aspectInterface.setMethodEntryWatch(methodLongL, new Object());
1732: aspectInterface.resumeNotification(Thread.currentThread());
1733: aspectInterface.suspendNotification(Thread.currentThread());
1734: }
1735:
1736: startChronometer();
1737: for (int i = 0; i < RUNS; i++) localMethodLongL(obj, obj);
1738: stopChronometer();
1739: }
1740:
1741: // 2) INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
1742: public void testVirtualMethodExit_jp_activated_locked_LongL()
1743: {
1744: long obj = 1;
1745: if (useProse) {
1746: aspectInterface.suspendNotification(Thread.currentThread());
1747: aspectInterface.setMethodExitWatch(methodLongL, new Object());
1748: aspectInterface.resumeNotification(Thread.currentThread());
1749: aspectInterface.suspendNotification(Thread.currentThread());
1750: }
1751:
1752: startChronometer();
1753: for (int i = 0; i < RUNS; i++) localMethodLongL(obj, obj);
1754: stopChronometer();
1755: }
1756: */
1757: // 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
1758: public void testVirtualMethodEntry_jp_activated_LongL() {
1759: long obj = 1;
1760: if (useProse) {
1761: aspectInterface.suspendNotification(Thread.currentThread());
1762: aspectInterface.setMethodEntryWatch(methodLongL,
1763: new Object());
1764: aspectInterface.resumeNotification(Thread.currentThread());
1765: }
1766:
1767: startChronometer();
1768: for (int i = 0; i < RUNS; i++)
1769: localMethodLongL(obj, obj);
1770: stopChronometer();
1771:
1772: if (checkAssert)
1773: assertEquals("Hook notifications", RUNS, methodEntryCount);
1774: }
1775:
1776: // 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
1777: public void testVirtualMethodExit_jp_activated_LongL() {
1778: long obj = 1;
1779: if (useProse) {
1780: aspectInterface.suspendNotification(Thread.currentThread());
1781: aspectInterface.setMethodExitWatch(methodLongL,
1782: new Object());
1783: aspectInterface.resumeNotification(Thread.currentThread());
1784: }
1785:
1786: startChronometer();
1787: for (int i = 0; i < RUNS; i++)
1788: localMethodLongL(obj, obj);
1789: stopChronometer();
1790:
1791: if (checkAssert)
1792: assertEquals("Hook notifications", RUNS, methodExitCount);
1793: }
1794:
1795: //=====================================================
1796:
1797: // 1) SYNC INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
1798: public void testSyncVirtualMethod_LongL() {
1799: long obj = 1;
1800: startChronometer();
1801: for (int i = 0; i < RUNS; i++)
1802: obSync.syncMethodLongL(obj, obj);
1803: stopChronometer();
1804: }
1805:
1806: /*
1807: // 2) SYNC INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
1808: public void testSyncVirtualMethodEntry_jp_activated_locked_LongL()
1809: {
1810: long obj = 1;
1811: if (useProse) {
1812: aspectInterface.suspendNotification(Thread.currentThread());
1813: aspectInterface.setMethodEntryWatch(syncMethodLongL, new Object());
1814: aspectInterface.resumeNotification(Thread.currentThread());
1815: aspectInterface.suspendNotification(Thread.currentThread());
1816: }
1817:
1818: startChronometer();
1819: for (int i = 0; i < RUNS; i++) obSync.syncMethodLongL(obj, obj);
1820: stopChronometer();
1821: }
1822:
1823: // 2) SYNC INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
1824: public void testSyncVirtualMethodExit_jp_activated_locked_LongL()
1825: {
1826: long obj = 1;
1827: if (useProse) {
1828: aspectInterface.suspendNotification(Thread.currentThread());
1829: aspectInterface.setMethodExitWatch(syncMethodLongL, new Object());
1830: aspectInterface.resumeNotification(Thread.currentThread());
1831: aspectInterface.suspendNotification(Thread.currentThread());
1832: }
1833:
1834: startChronometer();
1835: for (int i = 0; i < RUNS; i++) obSync.syncMethodLongL(obj, obj);
1836: stopChronometer();
1837: }
1838: */
1839: // 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
1840: public void testSyncVirtualMethodEntry_jp_activated_LongL() {
1841: long obj = 1;
1842: if (useProse) {
1843: aspectInterface.suspendNotification(Thread.currentThread());
1844: aspectInterface.setMethodEntryWatch(syncMethodLongL,
1845: new Object());
1846: aspectInterface.resumeNotification(Thread.currentThread());
1847: }
1848:
1849: startChronometer();
1850: for (int i = 0; i < RUNS; i++)
1851: obSync.syncMethodLongL(obj, obj);
1852: stopChronometer();
1853:
1854: if (checkAssert)
1855: assertEquals("Hook notifications", RUNS, methodEntryCount);
1856: }
1857:
1858: // 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
1859: public void testSyncVirtualMethodExit_jp_activated_LongL() {
1860: long obj = 1;
1861: if (useProse) {
1862: aspectInterface.suspendNotification(Thread.currentThread());
1863: aspectInterface.setMethodExitWatch(syncMethodLongL,
1864: new Object());
1865: aspectInterface.resumeNotification(Thread.currentThread());
1866: }
1867:
1868: startChronometer();
1869: for (int i = 0; i < RUNS; i++)
1870: obSync.syncMethodLongL(obj, obj);
1871: stopChronometer();
1872:
1873: if (checkAssert)
1874: assertEquals("Hook notifications", RUNS, methodExitCount);
1875: }
1876:
1877: //=====================================================
1878:
1879: // 1) INVOKEINTERFACE - no call to weaver because the joinpoint isn't activated
1880: public void testInterfaceMethod_LongL() {
1881: long obj = 1;
1882: startChronometer();
1883: for (int i = 0; i < RUNS; i++)
1884: obInterface.interfaceMethodLongL(obj, obj);
1885: stopChronometer();
1886: }
1887:
1888: /*
1889: // 2) INVOKEINTERFACE - no call to weaver because joinpoint is activated but locked
1890: public void testInterfaceMethodEntry_jp_activated_locked_LongL()
1891: {
1892: long obj = 1;
1893: if (useProse) {
1894: aspectInterface.suspendNotification(Thread.currentThread());
1895: aspectInterface.setMethodEntryWatch(interfaceMethodLongL, new Object());
1896: aspectInterface.resumeNotification(Thread.currentThread());
1897: aspectInterface.suspendNotification(Thread.currentThread());
1898: }
1899:
1900: startChronometer();
1901: for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongL(obj, obj);
1902: stopChronometer();
1903: }
1904:
1905: // 2) INVOKEINTERFACE - no call to weaver because joinpoint is activated but locked
1906: public void testInterfaceMethodExit_jp_activated_locked_LongL()
1907: {
1908: long obj = 1;
1909: if (useProse) {
1910: aspectInterface.suspendNotification(Thread.currentThread());
1911: aspectInterface.setMethodExitWatch(interfaceMethodLongL, new Object());
1912: aspectInterface.resumeNotification(Thread.currentThread());
1913: }
1914:
1915: startChronometer();
1916: for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongL(obj, obj);
1917: stopChronometer();
1918: }
1919: */
1920: // 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
1921: public void testInterfaceMethodEntry_jp_activated_LongL() {
1922: long obj = 1;
1923: if (useProse) {
1924: aspectInterface.suspendNotification(Thread.currentThread());
1925: aspectInterface.setMethodEntryWatch(interfaceMethodLongL,
1926: new Object());
1927: aspectInterface.resumeNotification(Thread.currentThread());
1928: }
1929:
1930: startChronometer();
1931: for (int i = 0; i < RUNS; i++)
1932: obInterface.interfaceMethodLongL(obj, obj);
1933: stopChronometer();
1934:
1935: if (checkAssert)
1936: assertEquals("Hook notifications", RUNS, methodEntryCount);
1937: }
1938:
1939: // 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
1940: public void testInterfaceMethodExit_jp_activated_LongL() {
1941: long obj = 1;
1942: if (useProse) {
1943: aspectInterface.suspendNotification(Thread.currentThread());
1944: aspectInterface.setMethodExitWatch(interfaceMethodLongL,
1945: new Object());
1946: aspectInterface.resumeNotification(Thread.currentThread());
1947: }
1948:
1949: startChronometer();
1950: for (int i = 0; i < RUNS; i++)
1951: obInterface.interfaceMethodLongL(obj, obj);
1952: stopChronometer();
1953:
1954: if (checkAssert)
1955: assertEquals("Hook notifications", RUNS, methodExitCount);
1956: }
1957:
1958: //=====================================================
1959:
1960: // 1) INVOKESTATIC - no call to weaver because the joinpoint isn't activated
1961: public void testStaticMethod_LongL() {
1962: long obj = 1;
1963: startChronometer();
1964: for (int i = 0; i < RUNS; i++)
1965: JoinPointTestClass.staticMethodLongL(obj, obj);
1966: stopChronometer();
1967: }
1968:
1969: /*
1970: // 2) INVOKESTATIC - no call to weaver because joinpoint is activated but locked
1971: public void testStaticMethodEntry_jp_activated_locked_LongL()
1972: {
1973: long obj = 1;
1974: if (useProse) {
1975: aspectInterface.suspendNotification(Thread.currentThread());
1976: aspectInterface.setMethodEntryWatch(staticMethodLongL, new Object());
1977: aspectInterface.resumeNotification(Thread.currentThread());
1978: aspectInterface.suspendNotification(Thread.currentThread());
1979: }
1980:
1981: startChronometer();
1982: for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongL(obj, obj);
1983: stopChronometer();
1984: }
1985:
1986: // 2) INVOKESTATIC - no call to weaver because joinpoint is activated but locked
1987: public void testStaticMethodExit_jp_activated_locked_LongL()
1988: {
1989: long obj = 1;
1990: if (useProse) {
1991: aspectInterface.suspendNotification(Thread.currentThread());
1992: aspectInterface.setMethodExitWatch(staticMethodLongL, new Object());
1993: aspectInterface.resumeNotification(Thread.currentThread());
1994: aspectInterface.suspendNotification(Thread.currentThread());
1995: }
1996:
1997: startChronometer();
1998: for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongL(obj, obj);
1999: stopChronometer();
2000: }
2001: */
2002: // 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
2003: public void testStaticMethodEntry_jp_activated_LongL() {
2004: long obj = 1;
2005: if (useProse) {
2006: aspectInterface.suspendNotification(Thread.currentThread());
2007: aspectInterface.setMethodEntryWatch(staticMethodLongL,
2008: new Object());
2009: aspectInterface.resumeNotification(Thread.currentThread());
2010: }
2011:
2012: startChronometer();
2013: for (int i = 0; i < RUNS; i++)
2014: JoinPointTestClass.staticMethodLongL(obj, obj);
2015: stopChronometer();
2016:
2017: if (checkAssert)
2018: assertEquals("Hook notifications", RUNS, methodEntryCount);
2019: }
2020:
2021: // 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
2022: public void testStaticMethodExit_jp_activated_LongL() {
2023: long obj = 1;
2024: if (useProse) {
2025: aspectInterface.suspendNotification(Thread.currentThread());
2026: aspectInterface.setMethodExitWatch(staticMethodLongL,
2027: new Object());
2028: aspectInterface.resumeNotification(Thread.currentThread());
2029: }
2030:
2031: startChronometer();
2032: for (int i = 0; i < RUNS; i++)
2033: JoinPointTestClass.staticMethodLongL(obj, obj);
2034: stopChronometer();
2035:
2036: if (checkAssert)
2037: assertEquals("Hook notifications", RUNS, methodExitCount);
2038: }
2039:
2040: //=====================================================
2041:
2042: // 1) INVOKESPECIAL - no call to weaver because the joinpoint isn't activated
2043: public void testSpecialMethod_LongL() {
2044: long obj = 1;
2045: startChronometer();
2046: for (int i = 0; i < RUNS; i++)
2047: privatelocalMethodLongL(obj, obj);
2048: stopChronometer();
2049: }
2050:
2051: /*
2052: // 2) INVOKESPECIAL - no call to weaver because joinpoint is activated but locked
2053: public void testSpecialMethodEntry_jp_activated_locked_LongL()
2054: {
2055: long obj = 1;
2056: if (useProse) {
2057: aspectInterface.suspendNotification(Thread.currentThread());
2058: aspectInterface.setMethodEntryWatch(privateMethodLongL, new Object());
2059: aspectInterface.resumeNotification(Thread.currentThread());
2060: aspectInterface.suspendNotification(Thread.currentThread());
2061: }
2062:
2063: startChronometer();
2064: for (int i = 0; i < RUNS; i++) privatelocalMethodLongL(obj, obj);
2065: stopChronometer();
2066: }
2067:
2068: // 2) INVOKESPECIAL - no call to weaver because joinpoint is activated but locked
2069: public void testSpecialMethodExit_jp_activated_locked_LongL()
2070: {
2071: long obj = 1;
2072: if (useProse) {
2073: aspectInterface.suspendNotification(Thread.currentThread());
2074: aspectInterface.setMethodExitWatch(privateMethodLongL, new Object());
2075: aspectInterface.resumeNotification(Thread.currentThread());
2076: aspectInterface.suspendNotification(Thread.currentThread());
2077: }
2078:
2079: startChronometer();
2080: for (int i = 0; i < RUNS; i++) privatelocalMethodLongL(obj, obj);
2081: stopChronometer();
2082: }
2083: */
2084: // 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
2085: public void testSpecialMethodEntry_jp_activated_LongL() {
2086: long obj = 1;
2087: if (useProse) {
2088: aspectInterface.suspendNotification(Thread.currentThread());
2089: aspectInterface.setMethodEntryWatch(privateMethodLongL,
2090: new Object());
2091: aspectInterface.resumeNotification(Thread.currentThread());
2092: }
2093:
2094: startChronometer();
2095: for (int i = 0; i < RUNS; i++)
2096: privatelocalMethodLongL(obj, obj);
2097: stopChronometer();
2098:
2099: if (checkAssert)
2100: assertEquals("Hook notifications", RUNS, methodEntryCount);
2101: }
2102:
2103: // 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
2104: public void testSpecialMethodExit_jp_activated_LongL() {
2105: long obj = 1;
2106: if (useProse) {
2107: aspectInterface.suspendNotification(Thread.currentThread());
2108: aspectInterface.setMethodExitWatch(privateMethodLongL,
2109: new Object());
2110: aspectInterface.resumeNotification(Thread.currentThread());
2111: }
2112:
2113: startChronometer();
2114: for (int i = 0; i < RUNS; i++)
2115: privatelocalMethodLongL(obj, obj);
2116: stopChronometer();
2117:
2118: if (checkAssert)
2119: assertEquals("Hook notifications", RUNS, methodExitCount);
2120: }
2121:
2122: //=====================================================
2123: //=====================================================
2124:
2125: // Method arguments: (double, double)
2126: //=====================================================
2127:
2128: // 1) INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
2129: public void testVirtualMethod_LongD() {
2130: double obj = 10.1;
2131: startChronometer();
2132: for (int i = 0; i < RUNS; i++)
2133: localMethodLongD(obj, obj);
2134: stopChronometer();
2135: }
2136:
2137: /*
2138: // 2) INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
2139: public void testVirtualMethodEntry_jp_activated_locked_LongD()
2140: {
2141: double obj = 10.1;
2142: if (useProse) {
2143: aspectInterface.suspendNotification(Thread.currentThread());
2144: aspectInterface.setMethodEntryWatch(methodLongD, new Object());
2145: aspectInterface.resumeNotification(Thread.currentThread());
2146: aspectInterface.suspendNotification(Thread.currentThread());
2147: }
2148:
2149: startChronometer();
2150: for (int i = 0; i < RUNS; i++) localMethodLongD(obj, obj);
2151: stopChronometer();
2152: }
2153:
2154: // 2) INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
2155: public void testVirtualMethodExit_jp_activated_locked_LongD()
2156: {
2157: double obj = 10.1;
2158: if (useProse) {
2159: aspectInterface.suspendNotification(Thread.currentThread());
2160: aspectInterface.setMethodExitWatch(methodLongD, new Object());
2161: aspectInterface.resumeNotification(Thread.currentThread());
2162: aspectInterface.suspendNotification(Thread.currentThread());
2163: }
2164:
2165: startChronometer();
2166: for (int i = 0; i < RUNS; i++) localMethodLongD(obj, obj);
2167: stopChronometer();
2168: }
2169: */
2170: // 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
2171: public void testVirtualMethodEntry_jp_activated_LongD() {
2172: double obj = 10.1;
2173: if (useProse) {
2174: aspectInterface.suspendNotification(Thread.currentThread());
2175: aspectInterface.setMethodEntryWatch(methodLongD,
2176: new Object());
2177: aspectInterface.resumeNotification(Thread.currentThread());
2178: }
2179:
2180: startChronometer();
2181: for (int i = 0; i < RUNS; i++)
2182: localMethodLongD(obj, obj);
2183: stopChronometer();
2184:
2185: if (checkAssert)
2186: assertEquals("Hook notifications", RUNS, methodEntryCount);
2187: }
2188:
2189: // 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
2190: public void testVirtualMethodExit_jp_activated_LongD() {
2191: double obj = 10.1;
2192: if (useProse) {
2193: aspectInterface.suspendNotification(Thread.currentThread());
2194: aspectInterface.setMethodExitWatch(methodLongD,
2195: new Object());
2196: aspectInterface.resumeNotification(Thread.currentThread());
2197: }
2198:
2199: startChronometer();
2200: for (int i = 0; i < RUNS; i++)
2201: localMethodLongD(obj, obj);
2202: stopChronometer();
2203:
2204: if (checkAssert)
2205: assertEquals("Hook notifications", RUNS, methodExitCount);
2206: }
2207:
2208: //=====================================================
2209:
2210: // 1) SYNC INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
2211: public void testSyncVirtualMethod_LongD() {
2212: double obj = 10.1;
2213: startChronometer();
2214: for (int i = 0; i < RUNS; i++)
2215: obSync.syncMethodLongD(obj, obj);
2216: stopChronometer();
2217: }
2218:
2219: /*
2220: // 2) SYNC INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
2221: public void testSyncVirtualMethodEntry_jp_activated_locked_LongD()
2222: {
2223: double obj = 10.1;
2224: if (useProse) {
2225: aspectInterface.suspendNotification(Thread.currentThread());
2226: aspectInterface.setMethodEntryWatch(syncMethodLongD, new Object());
2227: aspectInterface.resumeNotification(Thread.currentThread());
2228: aspectInterface.suspendNotification(Thread.currentThread());
2229: }
2230:
2231: startChronometer();
2232: for (int i = 0; i < RUNS; i++) obSync.syncMethodLongD(obj, obj);
2233: stopChronometer();
2234: }
2235:
2236: // 2) SYNC INVOKEVIRTUAL - no call to weaver because joinpoint is activated but locked
2237: public void testSyncVirtualMethodExit_jp_activated_locked_LongD()
2238: {
2239: double obj = 10.1;
2240: if (useProse) {
2241: aspectInterface.suspendNotification(Thread.currentThread());
2242: aspectInterface.setMethodExitWatch(syncMethodLongD, new Object());
2243: aspectInterface.resumeNotification(Thread.currentThread());
2244: aspectInterface.suspendNotification(Thread.currentThread());
2245: }
2246:
2247: startChronometer();
2248: for (int i = 0; i < RUNS; i++) obSync.syncMethodLongD(obj, obj);
2249: stopChronometer();
2250: }
2251: */
2252: // 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
2253: public void testSyncVirtualMethodEntry_jp_activated_LongD() {
2254: double obj = 10.1;
2255: if (useProse) {
2256: aspectInterface.suspendNotification(Thread.currentThread());
2257: aspectInterface.setMethodEntryWatch(syncMethodLongD,
2258: new Object());
2259: aspectInterface.resumeNotification(Thread.currentThread());
2260: }
2261:
2262: startChronometer();
2263: for (int i = 0; i < RUNS; i++)
2264: obSync.syncMethodLongD(obj, obj);
2265: stopChronometer();
2266:
2267: if (checkAssert)
2268: assertEquals("Hook notifications", RUNS, methodEntryCount);
2269: }
2270:
2271: // 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
2272: public void testSyncVirtualMethodExit_jp_activated_LongD() {
2273: double obj = 10.1;
2274: if (useProse) {
2275: aspectInterface.suspendNotification(Thread.currentThread());
2276: aspectInterface.setMethodExitWatch(syncMethodLongD,
2277: new Object());
2278: aspectInterface.resumeNotification(Thread.currentThread());
2279: }
2280:
2281: startChronometer();
2282: for (int i = 0; i < RUNS; i++)
2283: obSync.syncMethodLongD(obj, obj);
2284: stopChronometer();
2285:
2286: if (checkAssert)
2287: assertEquals("Hook notifications", RUNS, methodExitCount);
2288: }
2289:
2290: //=====================================================
2291:
2292: // 1) INVOKEINTERFACE - no call to weaver because the joinpoint isn't activated
2293: public void testInterfaceMethod_LongD() {
2294: double obj = 10.1;
2295: startChronometer();
2296: for (int i = 0; i < RUNS; i++)
2297: obInterface.interfaceMethodLongD(obj, obj);
2298: stopChronometer();
2299: }
2300:
2301: /*
2302: // 2) INVOKEINTERFACE - no call to weaver because joinpoint is activated but locked
2303: public void testInterfaceMethodEntry_jp_activated_locked_LongD()
2304: {
2305: double obj = 10.1;
2306: if (useProse) {
2307: aspectInterface.suspendNotification(Thread.currentThread());
2308: aspectInterface.setMethodEntryWatch(interfaceMethodLongD, new Object());
2309: aspectInterface.resumeNotification(Thread.currentThread());
2310: aspectInterface.suspendNotification(Thread.currentThread());
2311: }
2312:
2313: startChronometer();
2314: for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongD(obj, obj);
2315: stopChronometer();
2316: }
2317:
2318: // 2) INVOKEINTERFACE - no call to weaver because joinpoint is activated but locked
2319: public void testInterfaceMethodExit_jp_activated_locked_LongD()
2320: {
2321: double obj = 10.1;
2322: if (useProse) {
2323: aspectInterface.suspendNotification(Thread.currentThread());
2324: aspectInterface.setMethodExitWatch(interfaceMethodLongD, new Object());
2325: aspectInterface.resumeNotification(Thread.currentThread());
2326: aspectInterface.suspendNotification(Thread.currentThread());
2327: }
2328:
2329: startChronometer();
2330: for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongD(obj, obj);
2331: stopChronometer();
2332: }
2333: */
2334: // 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
2335: public void testInterfaceMethodEntry_jp_activated_LongD() {
2336: double obj = 10.1;
2337: if (useProse) {
2338: aspectInterface.suspendNotification(Thread.currentThread());
2339: aspectInterface.setMethodEntryWatch(interfaceMethodLongD,
2340: new Object());
2341: aspectInterface.resumeNotification(Thread.currentThread());
2342: }
2343:
2344: startChronometer();
2345: for (int i = 0; i < RUNS; i++)
2346: obInterface.interfaceMethodLongD(obj, obj);
2347: stopChronometer();
2348:
2349: if (checkAssert)
2350: assertEquals("Hook notifications", RUNS, methodEntryCount);
2351: }
2352:
2353: // 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
2354: public void testInterfaceMethodExit_jp_activated_LongD() {
2355: double obj = 10.1;
2356: if (useProse) {
2357: aspectInterface.suspendNotification(Thread.currentThread());
2358: aspectInterface.setMethodExitWatch(interfaceMethodLongD,
2359: new Object());
2360: aspectInterface.resumeNotification(Thread.currentThread());
2361: }
2362:
2363: startChronometer();
2364: for (int i = 0; i < RUNS; i++)
2365: obInterface.interfaceMethodLongD(obj, obj);
2366: stopChronometer();
2367:
2368: if (checkAssert)
2369: assertEquals("Hook notifications", RUNS, methodExitCount);
2370: }
2371:
2372: //=====================================================
2373:
2374: // 1) INVOKESTATIC - no call to weaver because the joinpoint isn't activated
2375: public void testStaticMethod_LongD() {
2376: double obj = 10.1;
2377: startChronometer();
2378: for (int i = 0; i < RUNS; i++)
2379: JoinPointTestClass.staticMethodLongD(obj, obj);
2380: stopChronometer();
2381: }
2382:
2383: /*
2384: // 2) INVOKESTATIC - no call to weaver because joinpoint is activated but locked
2385: public void testStaticMethodEntry_jp_activated_locked_LongD()
2386: {
2387: double obj = 10.1;
2388: if (useProse) {
2389: aspectInterface.suspendNotification(Thread.currentThread());
2390: aspectInterface.setMethodEntryWatch(staticMethodLongD, new Object());
2391: aspectInterface.resumeNotification(Thread.currentThread());
2392: aspectInterface.suspendNotification(Thread.currentThread());
2393: }
2394:
2395: startChronometer();
2396: for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongD(obj, obj);
2397: stopChronometer();
2398: }
2399:
2400: // 2) INVOKESTATIC - no call to weaver because joinpoint is activated but locked
2401: public void testStaticMethodExit_jp_activated_locked_LongD()
2402: {
2403: double obj = 10.1;
2404: if (useProse) {
2405: aspectInterface.suspendNotification(Thread.currentThread());
2406: aspectInterface.setMethodExitWatch(staticMethodLongD, new Object());
2407: aspectInterface.resumeNotification(Thread.currentThread());
2408: aspectInterface.suspendNotification(Thread.currentThread());
2409: }
2410:
2411: startChronometer();
2412: for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongD(obj, obj);
2413: stopChronometer();
2414: }
2415: */
2416: // 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
2417: public void testStaticMethodEntry_jp_activated_LongD() {
2418: double obj = 10.1;
2419: if (useProse) {
2420: aspectInterface.suspendNotification(Thread.currentThread());
2421: aspectInterface.setMethodEntryWatch(staticMethodLongD,
2422: new Object());
2423: aspectInterface.resumeNotification(Thread.currentThread());
2424: }
2425:
2426: startChronometer();
2427: for (int i = 0; i < RUNS; i++)
2428: JoinPointTestClass.staticMethodLongD(obj, obj);
2429: stopChronometer();
2430:
2431: if (checkAssert)
2432: assertEquals("Hook notifications", RUNS, methodEntryCount);
2433: }
2434:
2435: // 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
2436: public void testStaticMethodExit_jp_activated_LongD() {
2437: double obj = 10.1;
2438: if (useProse) {
2439: aspectInterface.suspendNotification(Thread.currentThread());
2440: aspectInterface.setMethodExitWatch(staticMethodLongD,
2441: new Object());
2442: aspectInterface.resumeNotification(Thread.currentThread());
2443: }
2444:
2445: startChronometer();
2446: for (int i = 0; i < RUNS; i++)
2447: JoinPointTestClass.staticMethodLongD(obj, obj);
2448: stopChronometer();
2449:
2450: if (checkAssert)
2451: assertEquals("Hook notifications", RUNS, methodExitCount);
2452: }
2453:
2454: //=====================================================
2455:
2456: // 1) INVOKESPECIAL - no call to weaver because the joinpoint isn't activated
2457: public void testSpecialMethod_LongD() {
2458: double obj = 10.1;
2459: startChronometer();
2460: for (int i = 0; i < RUNS; i++)
2461: privatelocalMethodLongD(obj, obj);
2462: stopChronometer();
2463: }
2464:
2465: /*
2466: // 2) INVOKESPECIAL - no call to weaver because joinpoint is activated but locked
2467: public void testSpecialMethodEntry_jp_activated_locked_LongD()
2468: {
2469: double obj = 10.1;
2470: if (useProse) {
2471: aspectInterface.suspendNotification(Thread.currentThread());
2472: aspectInterface.setMethodEntryWatch(privateMethodLongD, new Object());
2473: aspectInterface.resumeNotification(Thread.currentThread());
2474: aspectInterface.suspendNotification(Thread.currentThread());
2475: }
2476:
2477: startChronometer();
2478: for (int i = 0; i < RUNS; i++) privatelocalMethodLongD(obj, obj);
2479: stopChronometer();
2480: }
2481:
2482: // 2) INVOKESPECIAL - no call to weaver because joinpoint is activated but locked
2483: public void testSpecialMethodExit_jp_activated_locked_LongD()
2484: {
2485: double obj = 10.1;
2486: if (useProse) {
2487: aspectInterface.suspendNotification(Thread.currentThread());
2488: aspectInterface.setMethodExitWatch(privateMethodLongD, new Object());
2489: aspectInterface.resumeNotification(Thread.currentThread());
2490: aspectInterface.suspendNotification(Thread.currentThread());
2491: }
2492:
2493: startChronometer();
2494: for (int i = 0; i < RUNS; i++) privatelocalMethodLongD(obj, obj);
2495: stopChronometer();
2496: }
2497: */
2498: // 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
2499: public void testSpecialMethodEntry_jp_activated_LongD() {
2500: double obj = 10.1;
2501: if (useProse) {
2502: aspectInterface.suspendNotification(Thread.currentThread());
2503: aspectInterface.setMethodEntryWatch(privateMethodLongD,
2504: new Object());
2505: aspectInterface.resumeNotification(Thread.currentThread());
2506: }
2507:
2508: startChronometer();
2509: for (int i = 0; i < RUNS; i++)
2510: privatelocalMethodLongD(obj, obj);
2511: stopChronometer();
2512:
2513: if (checkAssert)
2514: assertEquals("Hook notifications", RUNS, methodEntryCount);
2515: }
2516:
2517: // 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
2518: public void testSpecialMethodExit_jp_activated_LongD() {
2519: double obj = 10.1;
2520: if (useProse) {
2521: aspectInterface.suspendNotification(Thread.currentThread());
2522: aspectInterface.setMethodExitWatch(privateMethodLongD,
2523: new Object());
2524: aspectInterface.resumeNotification(Thread.currentThread());
2525: }
2526:
2527: startChronometer();
2528: for (int i = 0; i < RUNS; i++)
2529: privatelocalMethodLongD(obj, obj);
2530: stopChronometer();
2531:
2532: if (checkAssert)
2533: assertEquals("Hook notifications", RUNS, methodExitCount);
2534: }
2535:
2536: //=====================================================
2537: //=====================================================
2538:
2539: public static Test suite() {
2540: return new PerformanceTestSuite(JoinPointMeasurements1.class);
2541: }
2542:
2543: }
|