aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test/java/org/aspectj/systemtest/pre10x/AjcPre10xTests.java
blob: 8b267e9958ce21d6d2a5454eb38c530c1e822263 (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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
/* *******************************************************************
 * Copyright (c) 2004 IBM Corporation
 * All rights reserved.
 * This program and the accompanying materials are made available
 * under the terms of the Eclipse Public License v 2.0
 * which accompanies this distribution and is available at
 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
 *
 * ******************************************************************/
package org.aspectj.systemtest.pre10x;

import org.aspectj.testing.XMLBasedAjcTestCase;

import junit.framework.Test;

public class AjcPre10xTests extends org.aspectj.testing.XMLBasedAjcTestCase {

	public static Test suite() {
		return XMLBasedAjcTestCase.loadSuite(AjcPre10xTests.class);
	}

	@Override
	protected java.net.URL getSpecFile() {
		return getClassResource("pre10x.xml");
	}


	public void test001(){
		runTest("Using 'aspect' as identifier is legal TODO");
	}

	public void test002(){
		runTest("Using 'pointcut' as identifier is legal TODO");
	}

	public void test003(){
		runTest("CF expected when enclosing class superclass used as this qualifier in inner class");
	}

	public void test004(){
		runTest("enclosing class may be used as this qualifier in inner class");
	}

	public void test005(){
		runTest("reasonable error for crosscut reference with no formals specified");
	}

	public void test006(){
		runTest("reasonable error for introduction on type whose source isn't found");
	}

	public void test007(){
		runTest("handle errors in crosscut designators, insist that they end with a semicolon");
	}

	public void test008(){
		runTest("try to return from a before, after, after throwing and after returning");
	}

	public void test009(){
		runTest("the designator has a wildcard for method name but no return type specified");
	}

	public void test010(){
		runTest("the designator for the introduction has no type after the | charcter");
	}

	public void test011(){
		runTest("crosscut signature does not match");
	}

	public void test012(){
		runTest("proper exit conditions when errors fall through to javac");
	}

	public void test013(){
		runTest("mismatched parens on advice (wasn't binding Tester)");
	}

	public void test014(){
		runTest("Non-static advice silently ignored");
	}

	public void test015(){
		runTest("extra closing brace");
	}

	public void test016(){
		runTest("decent errors for around return type not matching target point");
	}

	public void test017(){
		runTest("eachobject: can't call new on an aspect of");
	}

	public void test018(){
		runTest("eachobject: only zero-argument constructors allowed in an aspect");
	}

	public void test019(){
		runTest("eachobject: can't extend a concrete aspect");
	}

	public void test020(){
		runTest("instanceof used without a class");
	}

	public void test021(){
		runTest("wildcard used for returns clause");
	}

	public void test022(){
		runTest("no return statement in around advice");
	}

	public void test023(){
		runTest("inner aspects must be static (no longer matches PR#286)");
	}

	public void test024(){
		runTest("Casting class declarations as interfaces");
	}

	public void test025(){
		runTest("omits a variable name and crashes with a null pointer");
	}

	public void test026(){
		runTest("Not generating an error for using new as a method name");
	}

	public void test027(){
		runTest("ClassCastException on the int literal");
	}

	public void test028(){
		runTest("Wrong strictfp keyword usage in interface function prototype [TODO: move to errors]");
	}

	public void test029(){
		runTest("Wrong strictfp keyword usage in field declaration [TODO: move to errors]");
	}

	public void test030(){
		runTest("Wrong strictfp keyword usage in constructor declaration [TODO: move to errors]");
	}

	public void test031(){
		runTest("Incorrect static casts to primitively foldable arguments should not crash the compiler.");
	}

	public void test032(){
		runTest("Dominates with commas should signal an error.");
	}

	public void test033(){
		runTest("stack overflow with recursive crosscut specifier");
	}

	public void test034(){
		runTest("Throwing a NullPointerException when formals can't be bound in named pointcut");
	}

	public void test035(){
		runTest("disallow defining more than one pointcut with the same name");
	}

	// With intro of record in Java14 the error messages here change
	//  public void test036(){
	//    runTest("pre 0.7 introduction form outside aspect body causes an EmptyStackException");
	//  }
	//
	//  public void test037(){
	//    runTest("a class can't extend an aspect");
	//  }
	//
	//  public void test038(){
	//    runTest("a before() clause at the class-level causes an EmptyStackException");
	//  }
	//
	//  public void test039(){
	//    runTest("an after() clause at the class-level causes an EmptyStackException");
	//  }
	//
	// public void test040(){
	//	runTest("an around() clause at the class-level causes an EmptyStackException");
	// }

	public void test041(){
		runTest("Doesn't detect cyclic inheritance of aspects.");
	}

	public void test042(){
		runTest("Binds the pointcut formals to member variables instead of pointcut formals.");
	}

	public void test043(){
		runTest("ambiguous formal in formals pattern");
	}

	public void test044(){
		runTest("good error for field name instead of type name");
	}

	public void test045(){
		runTest("errors in aspect inheritance - 1");
	}

	public void test046(){
		runTest("errors in aspect inheritance - 2");
	}

	public void test047(){
		runTest("errors in aspect inheritance - 3");
	}

	public void test048(){
		runTest("errors in aspect inheritance - 4");
	}

	public void test049(){
		runTest("circular dominates leading to irresolvable advice precedence");
	}

	public void test050(){
		runTest("Should issue an error for using 'class' instead of 'aspect'");
	}

	public void test051(){
		runTest("Should signal an error when we need an exposed value but don't provide it");
	}

	public void test052(){
		runTest("StackOverFlowException with circular +implements's.");
	}

	public void test053(){
		runTest("Introducing protected methods is causing a crash");
	}

	public void test054(){
		runTest("Introducing protected fields is causing a crash");
	}

	public void test055(){
		runTest("two classes with the same fully-qualified names [eachjvm]");
	}

	public void test056(){
		runTest("Undefined pointcuts were throwing exceptions in 07b11 [callsto]");
	}

	public void test057(){
		runTest("advice on abstract pointcuts");
	}

	public void test058(){
		runTest("Whoops, I forgot to put a class in the field access PCD.");
	}

	public void test059(){
		runTest("the arounds return something but there is no returns statement");
	}

	public void test060(){
		runTest("multiple conflicting introductions");
	}

	public void test061(){
		runTest("referencing non-static pointcuts in outer aspects");
	}

	public void test062(){
		runTest("javac correct compiler error if there is no return in around returning result");
	}

	public void test063(){
		runTest("should give an error for introducing two members with the same name");
	}

	public void test064(){
		runTest("wimpy test for undeclared and uncaught exceptions");
	}

	public void test065(){
		runTest("Given non-matching TypePattern, CE flags use of non-introduced method rather than failure to introduce");
	}

	public void test066(){
		runTest("Compiler should suggest using aspect when advice, pointcuts, or introduction is in a class");
	}

	public void test067(){
		runTest("declare error working with pointcut and-not (amp,amp,bang)");
	}

	public void test068(){
		runTest("aspect as member of interface (private and protected)");
	}

	public void test069(){
		runTest("introduced inner interfaces - compile should fail to bind interface name outside of Aspect or if implementing method is not public");
	}

	public void test070(){
		runTest("aspects may not implement Serializable or Cloneable");
	}

	public void test071(){
		runTest("explicit constructor calls can throw exceptions");
	}

	public void test072(){
		runTest("bad proceed args good error messages");
	}

}