1 2 3 4 5 6 7 8 9 10 11 12
import org.aspectj.testing.Tester; /** Make Tester require execution of main method */ public aspect RequireMain { static { Tester.expectEvent("RequireMain - main"); } before() : execution(static void main(String[])) { Tester.event("RequireMain - main"); } }