blob: fb7a3007126a5103aab9823439038053efa88b04 (
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
/*******************************************************************************
* Copyright (c) 2004 IBM
* 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 API and implementation
*******************************************************************************/
package org.aspectj.systemtest.ajc150;
import java.io.File;
import junit.framework.Test;
import org.aspectj.apache.bcel.classfile.JavaClass;
import org.aspectj.apache.bcel.classfile.Method;
import org.aspectj.testing.XMLBasedAjcTestCase;
public class Annotations extends XMLBasedAjcTestCase {
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Annotations.class);
}
protected java.net.URL getSpecFile() {
return getClassResource("ajc150.xml");
}
public void testCompilingAnnotation() {
runTest("compiling an annotation");
}
public void testCompilingAnnotatedFile() {
runTest("compiling annotated file");
}
public void testCompilingUsingWithinAndAnnotationTypePattern() {
runTest("annotations and within (src)");
}
/**
* We had a bug where annotations were not present in the output class file for methods
* that got woven. This was due to unpacking bugs in LazyMethodGen. This test compiles
* a simple program then checks the annotations were copied across.
*/
public void testBugWithAnnotationsLostOnWovenMethods() throws ClassNotFoundException {
runTest("losing annotations...");
if (getCurrentTest().canRunOnThisVM()) {
JavaClass jc = getClassFrom(ajc.getSandboxDirectory(),"Program");
Method[] meths = jc.getMethods();
for (int i = 0; i < meths.length; i++) {
Method method = meths[i];
if (method.getName().equals("m1")) {
assertTrue("Didn't have annotations - were they lost? method="+method.getName(),method.getAnnotations().length==1);
}
}
}
}
public void testAnnotatedAnnotations() {
runTest("annotated annotations (@Target)");
}
public void testSimpleAnnotatedAspectMembers() {
runTest("simple annotated aspect members");
}
public void testAnnotatedAspectMembersWithWrongAnnotationType() {
runTest("simple annotated aspect members with bad target");
}
// more implementation work needed before this test passes
public void testAnnotatedITDs() {
runTest("annotated itds");
}
public void testAnnotatedITDs2() {
runTest("annotated public itds");
}
public void testAnnotatedITDs3() {
runTest("annotated public itds - values");
}
public void testAnnotatedITDs4() {
runTest("annotated public itds - multiple complex annotations");
}
public void testAnnotatedITDsWithWrongAnnotationType() {
runTest("annotated itds with bad target");
}
public void testAnnotatedAdvice() {
runTest("annotated advice");
}
public void testAnnotatedAdviceWithWrongAnnotationType() {
runTest("annotated advice with bad target");
}
public void testAnnotatedPointcut() {
runTest("annotated pointcut");
}
// FIXME asc uncomment this test when parser is opened up
// public void testAnnotatedDeclareStatements() {
// runTest("annotated declare statements");
// }
public void testBasicDeclareAnnotation() {
runTest("basic declare annotation parse test");
}
public void testAJDKAnnotatingAspects() {
runTest("ajdk: annotating aspects chapter");
}
public void testAJDKAnnotatingAspects2() {
runTest("ajdk: annotating aspects chapter, ex 2");
}
public void testAnnotationPatterns() {
runTest("ajdk: annotation pattern matching");
}
public void testAnnotationTypePatterns() {
runTest("ajdk: annotation type pattern matching");
}
public void testAnnotationSigPatterns() {
runTest("ajdk: annotations in sig patterns");
}
public void testAnnotationRuntimeMatching() {
runTest("ajdk: runtime annotations");
}
public void testAnnotationRetentionChecking() {
runTest("ajdk: @retention checking");
}
public void testAnnotationInheritance() {
runTest("ajdk: @inherited");
}
public void testAnnotationDEOW() {
runTest("ajdk: deow-ann");
}
public void testAnnotationDecp() {
runTest("ajdk: decp-ann");
}
public void testAnnotationDecPrecedence() {
runTest("ajdk: dec precedence");
}
public void testAnnotationDecAnnotation() {
runTest("ajdk: dec annotation");
}
public void testAnnotationsAndITDs() {
runTest("nasty annotation and itds test");
}
// helper methods.....
}
|