blob: 9512e8db4e0622f5c64fea655f77d146439a048e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
/*******************************************************************************
* Copyright (c) 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andy Clement - initial implementation
*******************************************************************************/
package org.aspectj.systemtest.ajc151;
import java.io.File;
import junit.framework.Test;
import org.aspectj.testing.XMLBasedAjcTestCase;
/**
* This testcode shows what is possible with code style and the current limitations
* of @AJ style. Each program is written in both styles and those variations
* not currently possible are commented out.
*
* @author AndyClement
*
*/
public class AtAroundTests extends XMLBasedAjcTestCase {
public void testCodeBasic() { runTest("code style - basic"); }
public void testAtBasicNoInline() { runTest("annotation style - basic - noinline"); }
public void testAtBasic() { runTest("annotation style - basic"); }
public void testCodeBindingTarget() { runTest("code style - correct usage, binding and passing same target for call"); }
public void testAtBindingTargetNoInline() { runTest("annotation style - correct usage, binding and passing same target for call - noinline"); }
public void testAtBindingTarget() { runTest("annotation style - correct usage, binding and passing same target for call"); }
public void testCodeBindingTarget2() { runTest("code style - correct usage, binding and passing new target for call"); }
public void testAtBindingTargetNoInline2() { runTest("annotation style - correct usage, binding and passing new target for call - noinline"); }
public void testAtBindingTarget2() { runTest("annotation style - correct usage, binding and passing new target for call"); }
public void testCodeErrorCase1() { runTest("code style - forget to pass target");}
// Don't think we can report correct errors for @AJ as the parameters are specified as an object array
//public void testAtErrorCase1() { runTest("annotation style - forget to pass target");}
public void testCodeBindThisCallChangeProceed() { runTest("code style - bind this on call - change on proceed - no effect");}
public void testAtBindThisCallChangeProceedNoInline() { runTest("annotation style - bind this on call - change on proceed - no effect - noinline");}
public void testAtBindThisCallChangeProceed() { runTest("annotation style - bind this on call - change on proceed - no effect");}
public void testCodeBindThisExecutionChangeProceed() { runTest("code style - bind this on execution - change on proceed - works");}
public void testAtBindThisExecutionChangeProceedNoInline() { runTest("annotation style - bind this on execution - change on proceed - works - noinline");}
public void testAtBindThisExecutionChangeProceed() { runTest("annotation style - bind this on execution - change on proceed - works");}
public void testCodeBindBothExecutionChangeProceed() { runTest("code style - bind this and target on execution - change on proceed - works");}
public void testAtBindBothExecutionChangeProceedNoInline() { runTest("annotation style - bind this and target on execution - change on proceed - works - noinline");}
public void testAtBindBothExecutionChangeProceed() { runTest("annotation style - bind this and target on execution - change on proceed - works");}
public void testCodeErrorCase2() { runTest("code style - incorrect arg types");}
// Don't think we can report correct errors for @AJ as the parameters are specified as an object array
// public void testAtErrorCase2() { runTest("annotation style - incorrect arg types");}
public void testCodeChangingTargetDifferingOrder() { runTest("code style - changing target for call - reverse order"); }
// @AJ cant cope with the changing of the order of arguments bound and passed through proceed
//public void testAtChangingTargetDifferingOrder() { runTest("annotation style - changing target for call - reverse order"); }
public void testCodeBindBothCallChangeProceed() { runTest("code style - bind this and target on call - change on proceed - works");}
public void testAtBindBothCallChangeProceedNoInline() { runTest("annotation style - bind this and target on call - change on proceed - works - noinline");}
public void testAtBindBothCallChangeProceed() { runTest("annotation style - bind this and target on call - change on proceed - works");}
public void testBreakingIt1() { runTest("breaking it - one");}
public void testBreakingIt2() { runTest("breaking it - two");}
public void testBugCase1() { runTest("bug case one");}
public void testBugCase2() { runTest("bug case two");}
public void testMultipleArgs() { runTest("multiple args");}
public void testCodeSubsetArguments() { runTest("code style - works with subset of arguments in advice");}
// cant do this for annotation style
//public void testAtSubsetArguments() { runTest("annotation style - works with subset of arguments in advice");}
// ---
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(AtAroundTests.class);
}
protected File getSpecFile() {
return getClassResource("ataround.xml");
}
}
|