// $Id: JoinPointMeasurements1_micro.java,v 1.2 2008/11/18 10:41:01 anicoara Exp $
// ======================================================
package measurements.suites;
import junit.framework.Test;
import junit.framework.Assert;
import ch.ethz.inf.util.junit.PerformanceTest;
import ch.ethz.inf.util.junit.PerformanceTestSuite;
import ch.ethz.prose.ProseSystem;
import ch.ethz.prose.DefaultAspect;
import ch.ethz.prose.Aspect;
import ch.ethz.prose.crosscut.Crosscut;
import ch.ethz.prose.crosscut.MethodCut;
import ch.ethz.prose.crosscut.REST;
import ch.ethz.prose.filter.PointCutter;
import ch.ethz.prose.filter.Executions;
import ch.ethz.prose.filter.Within;
import ch.ethz.jvmai.MethodEntryJoinPoint;
import ch.ethz.jvmai.MethodExitJoinPoint;
/**
* JoinPoint micro-measurements.
*
* Performance micro-measurements tests for method boundaries,
* fields accesses and modifications, exception handlers:
*
* 1) INVOKEVIRTUAL -> invoke a normal method
* 2) SYNC INVOKEVIRTUAL -> invoke a normal but synchronized method
* 3) INVOKEINTERFACE -> invoke a method through an interface
* 4) INVOKESPECIAL -> invoke a private method
* 5) INVOKESTATIC -> invoke a static method
* 6) GETFIELD -> used when a field has been read
* 7) PUTFIELD -> used when a field has been write
* 8) Exception Catch
* 9) Exception Throw
*
* Each test is executed "RUNS" times.
*
* @author Angela Nicoara
*/
public class JoinPointMeasurements1_micro extends PerformanceTest {
public boolean useProse = false;
public boolean checkAssert = true;
public static int counter=0;
// INVOKEVIRTUAL
public void localMethod() { }
public void localMethodLongO(Object ob1, Object ob2) { }
public void localMethodLongI(int ob1, int ob2) { }
public void localMethodLongL(long ob1, long ob2) { }
public void localMethodLongD(double ob1, double ob2) { }
// INVOKESPECIAL
private void privatelocalMethod() { }
private void privatelocalMethodLongO(Object ob1, Object ob2) { }
private void privatelocalMethodLongI(int ob1, int ob2) { }
private void privatelocalMethodLongL(long ob1, long ob2) { }
private void privatelocalMethodLongD(double ob1, double ob2) { }
// INVOKEINTERFACE
protected JoinPointTestInterface obInterface = new JoinPointTestClass();
// SYNC INVOKEVIRTUAL
protected JoinPointTestClass obSync = new JoinPointTestClass();
// METHOD ENTRY 1
public class MethodEntryAspect_1 extends DefaultAspect {
public Crosscut c1 = new MethodCut() {
// execute the advice 'before' the methods '^localMethod.*' and '^privatelocalMethod.*'
public void METHOD_ARGS(JoinPointMeasurements1_micro target, REST args) {
counter++;
}
// .. && calls('^localMethod.*' and '^privatelocalMethod.*')
protected PointCutter pointCutter() {
return ( (Executions.before()) . AND
(
( (Within.method("^localMethod.*")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("^privatelocalMethod.*")) . AND (Within.type("JoinPointMeasurements1_micro")) )
/*
( (Within.method("localMethod")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("localMethodLongO")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("localMethodLongI")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("localMethodLongL")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("localMethodLongD")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("privatelocalMethod")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("privatelocalMethodLongO")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("privatelocalMethodLongI")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("privatelocalMethodLongL")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("privatelocalMethodLongD")) . AND (Within.type("JoinPointMeasurements1_micro")) )
*/
)
);
}
};
}
// METHOD EXIT 1
public class MethodExitAspect_1 extends DefaultAspect {
public Crosscut c2 = new MethodCut() {
// execute the advice 'after' the method '^localMethod.*' and '^privatelocalMethod.*'
public void METHOD_ARGS(JoinPointMeasurements1_micro target, REST args) {
counter++;
}
// .. && calls('^localMethod.*' and '^privatelocalMethod.*')
protected PointCutter pointCutter() {
return ( (Executions.after()) . AND
(
( (Within.method("^localMethod.*")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("^privatelocalMethod.*")) . AND (Within.type("JoinPointMeasurements1_micro")) )
/*
( (Within.method("localMethod")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("localMethodLongO")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("localMethodLongI")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("localMethodLongL")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("localMethodLongD")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("privatelocalMethod")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("privatelocalMethodLongO")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("privatelocalMethodLongI")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("privatelocalMethodLongL")) . AND (Within.type("JoinPointMeasurements1_micro")) ) . OR
( (Within.method("privatelocalMethodLongD")) . AND (Within.type("JoinPointMeasurements1_micro")) )
*/
)
);
}
};
}
// METHOD ENTRY 2
public class MethodEntryAspect_2 extends DefaultAspect {
public Crosscut c3 = new MethodCut() {
// execute the advice 'before' the methods '^interfaceMethod.*' and '^syncMethod.*' and '^staticMethod.*'
public void METHOD_ARGS(JoinPointTestClass target, REST args) {
counter++;
}
// .. && calls('^interfaceMethod.*' and '^syncMethod.*' and '^staticMethod.*')
protected PointCutter pointCutter() {
return ( (Executions.before()) . AND
(
( (Within.method("^interfaceMethod.*")) . AND (Within.type("JoinPointTestClass")) ) . OR
( (Within.method("^syncMethod.*")) . AND (Within.type("JoinPointTestClass")) ) . OR
( (Within.method("^staticMethod.*")) . AND (Within.type("JoinPointTestClass")) )
)
);
}
};
}
// METHOD EXIT 2
public class MethodExitAspect_2 extends DefaultAspect {
public Crosscut c4 = new MethodCut() {
// execute the advice 'after' the methods '^interfaceMethod.*' and '^syncMethod.*' and '^staticMethod.*'
public void METHOD_ARGS(JoinPointTestClass target, REST args) {
counter++;
}
// .. && calls('^interfaceMethod.*' and '^syncMethod.*' and '^staticMethod.*')
protected PointCutter pointCutter() {
return ( (Executions.after()) . AND
(
( (Within.method("^interfaceMethod.*")) . AND (Within.type("JoinPointTestClass")) ) . OR
( (Within.method("^syncMethod.*")) . AND (Within.type("JoinPointTestClass")) ) . OR
( (Within.method("^staticMethod.*")) . AND (Within.type("JoinPointTestClass")) )
)
);
}
};
}
Aspect aspect1; // METHOD ENTRY 1
Aspect aspect2; // METHOD EXIT 1
Aspect aspect3; // METHOD ENTRY 2
Aspect aspect4; // METHOD EXIT 2
public JoinPointMeasurements1_micro(String name) {
super(name);
//RANGE = new int[] { 100000000 };
//RANGE = new int[] { 1000000 };
RANGE = new int[] { 10000 };
//RANGE = new int[] { 1 };
String proseParam = System.getProperty("useprose");
if (proseParam != null) useProse = true;
}
protected void setUp() throws Exception {
if (!useProse) return;
try {
ProseSystem.startup();
} catch (Exception e) {
Assert.fail("ProseSystem.startup() failed");
}
aspect1 = new MethodEntryAspect_1();
aspect2 = new MethodExitAspect_1();
aspect3 = new MethodEntryAspect_2();
aspect4 = new MethodExitAspect_2();
counter=0;
}
protected void tearDown() {
if (!useProse) return;
try {
ProseSystem.teardown();
} catch (Exception e) {
Assert.fail("ProseSystem.teardown() failed");
}
}
//=====================================================
/*
// 1) INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
public void testVirtualMethod_no_jp_NoArg()
{
startChronometer();
for (int i = 0; i < RUNS; i++) localMethod();
stopChronometer();
}
*/
// 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testVirtualMethodEntry_jp_activated_NoArg() {
if (useProse) ProseSystem.getAspectManager().insert(aspect1);
startChronometer();
for (int i = 0; i < RUNS; i++) localMethod();
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect1);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testVirtualMethodExit_jp_activated_NoArg() {
if (useProse) ProseSystem.getAspectManager().insert(aspect2);
startChronometer();
for (int i = 0; i < RUNS; i++) localMethod();
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect2);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) SYNC INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
public void testSyncVirtualMethod_no_jp_NoArg()
{
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodShort();
stopChronometer();
}
*/
// 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testSyncVirtualMethodEntry_jp_activated_NoArg() {
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodShort();
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testSyncVirtualMethodExit_jp_activated_NoArg() {
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodShort();
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKEINTERFACE - no call to weaver because the joinpoint isn't activated
public void testInterfaceMethod_no_jp_NoArg()
{
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodShort();
stopChronometer();
}
*/
// 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
public void testInterfaceMethodEntry_jp_activated_NoArg() {
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodShort();
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
public void testInterfaceMethodExit_jp_activated_NoArg() {
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodShort();
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKESTATIC - no call to weaver because the joinpoint isn't activated
public void testStaticMethod_no_jp_NoArg() {
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodShort();
stopChronometer();
}
*/
// 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
public void testStaticMethodEntry_jp_activated_NoArg() {
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodShort();
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
public void testStaticMethodExit_jp_activated_NoArg() {
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodShort();
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKESPECIAL - no call to weaver because the joinpoint isn't activated
public void testSpecialMethod_no_jp_NoArg() {
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethod();
stopChronometer();
}
*/
// 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
public void testSpecialMethodEntry_jp_activated_NoArg() {
if (useProse) ProseSystem.getAspectManager().insert(aspect1);
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethod();
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect1);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
public void testSpecialMethodExit_jp_activated_NoArg() {
if (useProse) ProseSystem.getAspectManager().insert(aspect2);
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethod();
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect2);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
//=====================================================
//=====================================================
//=====================================================
//=====================================================
// Method arguments: (Object, Object)
//=====================================================
/*
// 1) INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
public void testVirtualMethod_LongO() {
Object obj = new Object();
startChronometer();
for (int i = 0; i < RUNS; i++) localMethodLongO(obj, obj);
stopChronometer();
}
*/
// 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testVirtualMethodEntry_jp_activated_LongO() {
Object obj = new Object();
if (useProse) ProseSystem.getAspectManager().insert(aspect1);
startChronometer();
for (int i = 0; i < RUNS; i++) localMethodLongO(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect1);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testVirtualMethodExit_jp_activated_LongO() {
Object obj = new Object();
if (useProse) ProseSystem.getAspectManager().insert(aspect2);
startChronometer();
for (int i = 0; i < RUNS; i++) localMethodLongO(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect2);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) SYNC INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
public void testSyncVirtualMethod_LongO() {
Object obj = new Object();
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodLongO(obj, obj);
stopChronometer();
}
*/
// 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testSyncVirtualMethodEntry_jp_activated_LongO() {
Object obj = new Object();
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodLongO(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testSyncVirtualMethodExit_jp_activated_LongO() {
Object obj = new Object();
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodLongO(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKEINTERFACE - no call to weaver because the joinpoint isn't activated
public void testInterfaceMethod_LongO() {
Object obj = new Object();
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongO(obj, obj);
stopChronometer();
}
*/
// 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
public void testInterfaceMethodEntry_jp_activated_LongO() {
Object obj = new Object();
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongO(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
public void testInterfaceMethodExit_jp_activated_LongO() {
Object obj = new Object();
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongO(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKESTATIC - no call to weaver because the joinpoint isn't activated
public void testStaticMethod_LongO() {
Object obj = new Object();
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongO(obj, obj);
stopChronometer();
}
*/
// 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
public void testStaticMethodEntry_jp_activated_LongO() {
Object obj = new Object();
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongO(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
public void testStaticMethodExit_jp_activated_LongO() {
Object obj = new Object();
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongO(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKESPECIAL - no call to weaver because the joinpoint isn't activated
public void testSpecialMethod_LongO() {
Object obj = new Object();
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethodLongO(obj, obj);
stopChronometer();
}
*/
// 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
public void testSpecialMethodEntry_jp_activated_LongO() {
Object obj = new Object();
if (useProse) ProseSystem.getAspectManager().insert(aspect1);
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethodLongO(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect1);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
public void testSpecialMethodExit_jp_activated_LongO() {
Object obj = new Object();
if (useProse) ProseSystem.getAspectManager().insert(aspect2);
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethodLongO(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect2);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
//=====================================================
// Method arguments: (int, int)
//=====================================================
/*
// 1) INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
public void testVirtualMethod_LongI() {
int obj = 1;
startChronometer();
for (int i = 0; i < RUNS; i++) localMethodLongI(obj, obj);
stopChronometer();
}
*/
// 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testVirtualMethodEntry_jp_activated_LongI() {
int obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect1);
startChronometer();
for (int i = 0; i < RUNS; i++) localMethodLongI(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect1);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testVirtualMethodExit_jp_activated_LongI() {
int obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect2);
startChronometer();
for (int i = 0; i < RUNS; i++) localMethodLongI(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect2);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) SYNC INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
public void testSyncVirtualMethod_LongI() {
int obj = 1;
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodLongI(obj, obj);
stopChronometer();
}
*/
// 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testSyncVirtualMethodEntry_jp_activated_LongI() {
int obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodLongI(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testSyncVirtualMethodExit_jp_activated_LongI() {
int obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodLongI(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKEINTERFACE - no call to weaver because the joinpoint isn't activated
public void testInterfaceMethod_LongI() {
int obj = 1;
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongI(obj, obj);
stopChronometer();
}
*/
// 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
public void testInterfaceMethodEntry_jp_activated_LongI() {
int obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongI(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
public void testInterfaceMethodExit_jp_activated_LongI() {
int obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongI(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKESTATIC - no call to weaver because the joinpoint isn't activated
public void testStaticMethod_LongI() {
int obj = 1;
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongI(obj, obj);
stopChronometer();
}
*/
// 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
public void testStaticMethodEntry_jp_activated_LongI() {
int obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongI(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
public void testStaticMethodExit_jp_activated_LongI() {
int obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongI(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKESPECIAL - no call to weaver because the joinpoint isn't activated
public void testSpecialMethod_LongI() {
int obj = 1;
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethodLongI(obj, obj);
stopChronometer();
}
*/
// 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
public void testSpecialMethodEntry_jp_activated_LongI() {
int obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect1);
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethodLongI(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect1);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
public void testSpecialMethodExit_jp_activated_LongI() {
int obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect2);
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethodLongI(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect2);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
//=====================================================
// Method arguments: (long, long)
//=====================================================
/*
// 1) INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
public void testVirtualMethod_LongL() {
long obj = 1;
startChronometer();
for (int i = 0; i < RUNS; i++) localMethodLongL(obj, obj);
stopChronometer();
}
*/
// 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testVirtualMethodEntry_jp_activated_LongL() {
long obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect1);
startChronometer();
for (int i = 0; i < RUNS; i++) localMethodLongL(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect1);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testVirtualMethodExit_jp_activated_LongL() {
long obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect2);
startChronometer();
for (int i = 0; i < RUNS; i++) localMethodLongL(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect2);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) SYNC INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
public void testSyncVirtualMethod_LongL() {
long obj = 1;
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodLongL(obj, obj);
stopChronometer();
}
*/
// 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testSyncVirtualMethodEntry_jp_activated_LongL() {
long obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodLongL(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testSyncVirtualMethodExit_jp_activated_LongL() {
long obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodLongL(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKEINTERFACE - no call to weaver because the joinpoint isn't activated
public void testInterfaceMethod_LongL() {
long obj = 1;
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongL(obj, obj);
stopChronometer();
}
*/
// 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
public void testInterfaceMethodEntry_jp_activated_LongL() {
long obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongL(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
public void testInterfaceMethodExit_jp_activated_LongL() {
long obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongL(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKESTATIC - no call to weaver because the joinpoint isn't activated
public void testStaticMethod_LongL() {
long obj = 1;
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongL(obj, obj);
stopChronometer();
}
*/
// 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
public void testStaticMethodEntry_jp_activated_LongL() {
long obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongL(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
public void testStaticMethodExit_jp_activated_LongL() {
long obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongL(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKESPECIAL - no call to weaver because the joinpoint isn't activated
public void testSpecialMethod_LongL() {
long obj = 1;
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethodLongL(obj, obj);
stopChronometer();
}
*/
// 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
public void testSpecialMethodEntry_jp_activated_LongL() {
long obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect1);
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethodLongL(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect1);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
public void testSpecialMethodExit_jp_activated_LongL() {
long obj = 1;
if (useProse) ProseSystem.getAspectManager().insert(aspect2);
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethodLongL(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect2);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
//=====================================================
// Method arguments: (double, double)
//=====================================================
/*
// 1) INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
public void testVirtualMethod_LongD() {
double obj = 10.1;
startChronometer();
for (int i = 0; i < RUNS; i++) localMethodLongD(obj, obj);
stopChronometer();
}
*/
// 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testVirtualMethodEntry_jp_activated_LongD() {
double obj = 10.1;
if (useProse) ProseSystem.getAspectManager().insert(aspect1);
startChronometer();
for (int i = 0; i < RUNS; i++) localMethodLongD(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect1);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testVirtualMethodExit_jp_activated_LongD() {
double obj = 10.1;
if (useProse) ProseSystem.getAspectManager().insert(aspect2);
startChronometer();
for (int i = 0; i < RUNS; i++) localMethodLongD(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect2);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) SYNC INVOKEVIRTUAL - no call to weaver because the joinpoint isn't activated
public void testSyncVirtualMethod_LongD() {
double obj = 10.1;
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodLongD(obj, obj);
stopChronometer();
}
*/
// 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testSyncVirtualMethodEntry_jp_activated_LongD() {
double obj = 10.1;
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodLongD(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) SYNC INVOKEVIRTUAL - call to empty weaver because of on active, unlocked joinpoint
public void testSyncVirtualMethodExit_jp_activated_LongD() {
double obj = 10.1;
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) obSync.syncMethodLongD(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKEINTERFACE - no call to weaver because the joinpoint isn't activated
public void testInterfaceMethod_LongD() {
double obj = 10.1;
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongD(obj, obj);
stopChronometer();
}
*/
// 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
public void testInterfaceMethodEntry_jp_activated_LongD() {
double obj = 10.1;
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongD(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKEINTERFACE - call to empty weaver because of on active, unlocked joinpoint
public void testInterfaceMethodExit_jp_activated_LongD() {
double obj = 10.1;
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) obInterface.interfaceMethodLongD(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKESTATIC - no call to weaver because the joinpoint isn't activated
public void testStaticMethod_LongD() {
double obj = 10.1;
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongD(obj, obj);
stopChronometer();
}
*/
// 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
public void testStaticMethodEntry_jp_activated_LongD() {
double obj = 10.1;
if (useProse) ProseSystem.getAspectManager().insert(aspect3);
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongD(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect3);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKESTATIC - call to empty weaver because of on active, unlocked joinpoint
public void testStaticMethodExit_jp_activated_LongD() {
double obj = 10.1;
if (useProse) ProseSystem.getAspectManager().insert(aspect4);
startChronometer();
for (int i = 0; i < RUNS; i++) JoinPointTestClass.staticMethodLongD(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect4);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
/*
// 1) INVOKESPECIAL - no call to weaver because the joinpoint isn't activated
public void testSpecialMethod_LongD() {
double obj = 10.1;
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethodLongD(obj, obj);
stopChronometer();
}
*/
// 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
public void testSpecialMethodEntry_jp_activated_LongD() {
double obj = 10.1;
if (useProse) ProseSystem.getAspectManager().insert(aspect1);
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethodLongD(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect1);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
// 3) INVOKESPECIAL - call to empty weaver because of on active, unlocked joinpoint
public void testSpecialMethodExit_jp_activated_LongD() {
double obj = 10.1;
if (useProse) ProseSystem.getAspectManager().insert(aspect2);
startChronometer();
for (int i = 0; i < RUNS; i++) privatelocalMethodLongD(obj, obj);
stopChronometer();
if (useProse) ProseSystem.getAspectManager().withdraw(aspect2);
if (checkAssert) assertEquals("Hook notifications", RUNS, counter);
}
//=====================================================
//=====================================================
public static Test suite() {
return new PerformanceTestSuite(JoinPointMeasurements1_micro.class);
}
}