KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > java > editor > completion > JavaCompletionProviderAdvancedTest


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.java.editor.completion;
21
22 /**
23  *
24  * @author Dusan Balek
25  */

26 public class JavaCompletionProviderAdvancedTest extends CompletionTestBase {
27
28     public JavaCompletionProviderAdvancedTest(String JavaDoc testName) {
29         super(testName);
30     }
31
32     // constructor tests -------------------------------------------------------
33

34     public void testEmptyFileAfterTypingNew() throws Exception JavaDoc {
35         performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew ", "declaredTypes.pass");
36     }
37
38     public void testAfterTypingNew() throws Exception JavaDoc {
39         performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew ", "declaredTypes.pass");
40     }
41     
42     public void testAfterNew() throws Exception JavaDoc {
43         performTest("AdvancedMethodBody", 121, null, "declaredTypes.pass");
44     }
45     
46     public void testEmptyFileTypingConstructorName() throws Exception JavaDoc {
47         performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew Str", "declaredTypesStartingWithStr.pass");
48     }
49     
50     public void testTypingConstructorName() throws Exception JavaDoc {
51         performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew Str", "declaredTypesStartingWithStr.pass");
52     }
53     
54     public void testOnConstructorName() throws Exception JavaDoc {
55         performTest("AdvancedMethodBody", 124, null, "declaredTypesStartingWithStr.pass");
56     }
57
58     public void testEmptyFileAfterTypingConstructorName() throws Exception JavaDoc {
59         performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String", "stringConstructors.pass");
60     }
61     
62     public void testAfterTypingConstructorName() throws Exception JavaDoc {
63         performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String", "stringConstructors.pass");
64     }
65     
66     public void testAfterConstructorName() throws Exception JavaDoc {
67         performTest("AdvancedMethodBody", 127, null, "stringConstructors.pass");
68     }
69     
70     public void testEmptyFileBeforeTypingConstructorParam() throws Exception JavaDoc {
71         performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(", "typesLocalMembersVarsAndSmartString.pass");
72     }
73     
74     public void testBeforeTypingConstructorParam() throws Exception JavaDoc {
75         performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(", "typesLocalMembersVarsAndSmartString.pass");
76     }
77     
78     public void testBeforeConstructorParam() throws Exception JavaDoc {
79         performTest("AdvancedMethodBody", 128, null, "typesLocalMembersVarsAndSmartString.pass");
80     }
81     
82     public void testEmptyFileTypingConstructorParam() throws Exception JavaDoc {
83         performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(fie", "field.pass");
84     }
85     
86     public void testTypingConstructorParam() throws Exception JavaDoc {
87         performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(fie", "field.pass");
88     }
89     
90     public void testOnConstructorParam() throws Exception JavaDoc {
91         performTest("AdvancedMethodBody", 132, null, "field.pass");
92     }
93     
94     public void testEmptyFileAfterTypingConstructorParam() throws Exception JavaDoc {
95         performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(field", "field.pass");
96     }
97     
98     public void testAfterTypingConstructorParam() throws Exception JavaDoc {
99         performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(field", "field.pass");
100     }
101     
102     public void testAfterConstructorParam() throws Exception JavaDoc {
103         performTest("AdvancedMethodBody", 133, null, "field.pass");
104     }
105     
106     public void testEmptyFileAfterTypingConstructorParamAndSpace() throws Exception JavaDoc {
107         performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(field ", "empty.pass");
108     }
109     
110     public void testAfterTypingConstructorParamAndSpace() throws Exception JavaDoc {
111         performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(field ", "empty.pass");
112     }
113     
114     public void testAfterConstructorParamAndSpace() throws Exception JavaDoc {
115         performTest("AdvancedMethodBody", 133, " ", "empty.pass");
116     }
117     
118     public void testEmptyFileAfterTypingConstructor() throws Exception JavaDoc {
119         performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(field)", "instanceOf.pass");
120     }
121     
122     public void testAfterTypingConstructor() throws Exception JavaDoc {
123         performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(field)", "instanceOf.pass");
124     }
125     
126     public void testAfterConstructor() throws Exception JavaDoc {
127         performTest("AdvancedMethodBody", 134, null, "instanceOf.pass");
128     }
129     
130     public void testEmptyFileAfterTypingConstructorAndSpace() throws Exception JavaDoc {
131         performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(field) ", "instanceOf.pass");
132     }
133     
134     public void testAfterTypingConstructorAndSpace() throws Exception JavaDoc {
135         performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(field) ", "instanceOf.pass");
136     }
137     
138     public void testAfterConstructorAndSpace() throws Exception JavaDoc {
139         performTest("AdvancedMethodBody", 134, " ", "instanceOf.pass");
140     }
141     
142     public void testEmptyFileAfterTypingConstructorAndDot() throws Exception JavaDoc {
143         performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(field).", "stringContent.pass");
144     }
145     
146     public void testAfterTypingConstructorAndDot() throws Exception JavaDoc {
147         performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(field).", "stringContent.pass");
148     }
149     
150     public void testAfterConstructorAndDot() throws Exception JavaDoc {
151         performTest("AdvancedMethodBody", 135, null, "stringContent.pass");
152     }
153     
154     // primitive_type.class tests ----------------------------------------------
155

156     public void testEmptyFileAfterTypingPrimitiveTypeAndDot() throws Exception JavaDoc {
157         performTest("SimpleMethodBodyStart", 89, "boolean.", "classKeyword.pass");
158     }
159     
160     public void testAfterTypingPrimitiveTypeAndDot() throws Exception JavaDoc {
161         performTest("SimpleEmptyMethodBody", 89, "boolean.", "classKeyword.pass");
162     }
163     
164     public void testAfterPrimitiveTypeAndDot() throws Exception JavaDoc {
165         performTest("AdvancedMethodBody", 169, null, "classKeyword.pass");
166     }
167     
168     public void testEmptyFileTypingPrimitiveTypeDotClass() throws Exception JavaDoc {
169         performTest("SimpleMethodBodyStart", 89, "boolean.c", "classKeyword.pass");
170     }
171     
172     public void testTypingPrimitiveTypeDotClass() throws Exception JavaDoc {
173         performTest("SimpleEmptyMethodBody", 89, "boolean.c", "classKeyword.pass");
174     }
175     
176     public void testOnPrimitiveTypeDotClass() throws Exception JavaDoc {
177         performTest("AdvancedMethodBody", 170, null, "classKeyword.pass");
178     }
179
180     public void testEmptyFileAfterTypingPrimitiveTypeDotClass() throws Exception JavaDoc {
181         performTest("SimpleMethodBodyStart", 89, "boolean.class", "classKeyword.pass");
182     }
183     
184     public void testAfterTypingPrimitiveTypeDotClass() throws Exception JavaDoc {
185         performTest("SimpleEmptyMethodBody", 89, "boolean.class", "classKeyword.pass");
186     }
187     
188     public void testAfterPrimitiveTypeDotClass() throws Exception JavaDoc {
189         performTest("AdvancedMethodBody", 174, null, "classKeyword.pass");
190     }
191     
192     // Boolean.FALSE.booleanValue() like tests ---------------------------------
193

194     public void testEmptyFileTypingBooleanValue() throws Exception JavaDoc {
195         performTest("SimpleMethodBodyStart", 89, "Boolean.FALSE.boolean", "booleanValue.pass");
196     }
197     
198     public void testTypingBooleanValue() throws Exception JavaDoc {
199         performTest("SimpleEmptyMethodBody", 89, "Boolean.FALSE.boolean", "booleanValue.pass");
200     }
201     
202     public void testOnBooleanValue() throws Exception JavaDoc {
203         performTest("AdvancedMethodBody", 198, null, "booleanValue.pass");
204     }
205
206     // Expression in field init tests ------------------------------------------
207

208     public void testEmptyFileTypingParenWithinInitOfField() throws Exception JavaDoc {
209         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = (", "typesLocalMembersAndSmartNumber.pass");
210     }
211     
212     public void testTypingParenWithinInitOfField() throws Exception JavaDoc {
213         performTest("FieldNoInit", 114, " = (", "typesLocalMembersAndSmartNumber.pass");
214     }
215     
216     public void testAfterParenWithinInitOfField() throws Exception JavaDoc {
217         performTest("Field", 141, null, "typesLocalMembersAndSmartNumber.pass");
218     }
219     
220     public void testEmptyFileTypingSecondParenWithinInitOfField() throws Exception JavaDoc {
221         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = ((", "typesLocalMembersAndSmartNumber.pass");
222     }
223     
224     public void testTypingSecondParenWithinInitOfField() throws Exception JavaDoc {
225         performTest("FieldNoInit", 114, " = ((", "typesLocalMembersAndSmartNumber.pass");
226     }
227     
228     public void testAfterSecondParenWithinInitOfField() throws Exception JavaDoc {
229         performTest("Field", 142, null, "typesLocalMembersAndSmartNumber.pass");
230     }
231
232     public void testEmptyFileTypingSecondParenAndSpaceWithinInitOfField() throws Exception JavaDoc {
233         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = (( ", "typesLocalMembersAndSmartNumber.pass");
234     }
235     
236     public void testTypingSecondParenAndSpaceWithinInitOfField() throws Exception JavaDoc {
237         performTest("FieldNoInit", 114, " = (( ", "typesLocalMembersAndSmartNumber.pass");
238     }
239     
240     public void testAfterSecondParenAndSpaceWithinInitOfField() throws Exception JavaDoc {
241         performTest("Field", 142, " ", "typesLocalMembersAndSmartNumber.pass");
242     }
243     
244     public void testEmptyFileTypingCastTypeWithinInitOfField() throws Exception JavaDoc {
245         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = ((Number ", "empty.pass");
246     }
247     
248     public void testTypingCastTypeWithinInitOfField() throws Exception JavaDoc {
249         performTest("FieldNoInit", 114, " = ((Number ", "empty.pass");
250     }
251     
252     public void testOnCastTypeWithinInitOfField() throws Exception JavaDoc {
253         performTest("Field", 148, " ", "empty.pass");
254     }
255
256     public void testEmptyFileAfterTypingCastTypeWithinInitOfField() throws Exception JavaDoc {
257         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = ((Number)", "typesAndLocalMembers1.pass");
258     }
259     
260     public void testAfterTypingCastTypeWithinInitOfField() throws Exception JavaDoc {
261         performTest("FieldNoInit", 114, " = ((Number)", "typesAndLocalMembers1.pass");
262     }
263     
264     public void testAfterCastTypeWithinInitOfField() throws Exception JavaDoc {
265         performTest("Field", 149, null, "typesAndLocalMembers1.pass");
266     }
267
268     public void testEmptyFileTypingCastAndSpaceWithinInitOfField() throws Exception JavaDoc {
269         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = ((Number) ", "typesAndLocalMembers1.pass");
270     }
271     
272     public void testTypingCastAndSpaceWithinInitOfField() throws Exception JavaDoc {
273         performTest("FieldNoInit", 114, " = ((Number) ", "typesAndLocalMembers1.pass");
274     }
275     
276     public void testAfterCastAndSpaceWithinInitOfField() throws Exception JavaDoc {
277         performTest("Field", 149, " ", "typesAndLocalMembers1.pass");
278     }
279
280     public void testEmptyFileTypingCastAndMethodWithinInitOfField() throws Exception JavaDoc {
281         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = ((Number)h", "hashCode.pass");
282     }
283     
284     public void testTypingCastAndMethodWithinInitOfField() throws Exception JavaDoc {
285         performTest("FieldNoInit", 114, " = ((Number)h", "hashCode.pass");
286     }
287     
288     public void testOnCastAndMethodWithinInitOfField() throws Exception JavaDoc {
289         performTest("Field", 150, null, "hashCode.pass");
290     }
291
292     public void testEmptyFileAfterTypingCastAndMethodWithinInitOfField() throws Exception JavaDoc {
293         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = ((Number)hashCode())", "instanceOf.pass");
294     }
295     
296     public void testAfterTypingCastAndMethodWithinInitOfField() throws Exception JavaDoc {
297         performTest("FieldNoInit", 114, " = ((Number)hashCode())", "instanceOf.pass");
298     }
299     
300     public void testAfterCastAndMethodWithinInitOfField() throws Exception JavaDoc {
301         performTest("Field", 160, null, "instanceOf.pass");
302     }
303
304     public void testEmptyFileAfterTypingCastWithinInitOfField() throws Exception JavaDoc {
305         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = ((Number)hashCode()).", "numberContent.pass");
306     }
307     
308     public void testAfterTypingCastWithinInitOfField() throws Exception JavaDoc {
309         performTest("FieldNoInit", 114, " = ((Number)hashCode()).", "numberContent.pass");
310     }
311     
312     public void testAfterCastWithinInitOfField() throws Exception JavaDoc {
313         performTest("Field", 161, null, "numberContent.pass");
314     }
315
316     public void testEmptyFileBeforeTypingInstanceofWithinInitOfField() throws Exception JavaDoc {
317         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = ((Number)hashCode()).intValue();\npublic boolean b = num ", "instanceOf.pass");
318     }
319     
320     public void testBeforeTypingInstanceofWithinInitOfField() throws Exception JavaDoc {
321         performTest("FieldNoInit", 136, " = num ", "instanceOf.pass");
322     }
323     
324     public void testBeforeInstanceofWithinInitOfField() throws Exception JavaDoc {
325         performTest("Field", 200, null, "instanceOf.pass");
326     }
327
328     public void testEmptyFileTypingInstanceofWithinInitOfField() throws Exception JavaDoc {
329         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = ((Number)hashCode()).intValue();\npublic boolean b = num i", "instanceOf.pass");
330     }
331     
332     public void testTypingInstanceofWithinInitOfField() throws Exception JavaDoc {
333         performTest("FieldNoInit", 136, " = num i", "instanceOf.pass");
334     }
335     
336     public void testInstanceofWithinInitOfField() throws Exception JavaDoc {
337         performTest("Field", 201, null, "instanceOf.pass");
338     }
339
340     public void testEmptyFileAfterTypingInstanceofWithinInitOfField() throws Exception JavaDoc {
341         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = ((Number)hashCode()).intValue();\npublic boolean b = num instanceof ", "declaredTypes.pass");
342     }
343     
344     public void testAfterTypingInstanceofWithinInitOfField() throws Exception JavaDoc {
345         performTest("FieldNoInit", 136, " = num instanceof ", "declaredTypes.pass");
346     }
347     
348     public void testAfterInstanceofWithinInitOfField() throws Exception JavaDoc {
349         performTest("Field", 211, null, "declaredTypes.pass");
350     }
351
352     public void testEmptyFileTypingInstanceofTypeWithinInitOfField() throws Exception JavaDoc {
353         performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = ((Number)hashCode()).intValue();\npublic boolean b = num instanceof I", "javaLangContentStartingWithI.pass");
354     }
355     
356     public void testTypingInstanceofTypeWithinInitOfField() throws Exception JavaDoc {
357         performTest("FieldNoInit", 136, " = num instanceof I", "javaLangContentStartingWithI.pass");
358     }
359     
360     public void testOnInstanceofTypeWithinInitOfField() throws Exception JavaDoc {
361         performTest("Field", 212, null, "javaLangContentStartingWithI.pass");
362     }
363
364     // For loop tests ----------------------------------------------------------
365

366     public void testEmptyFileAfterTypingForKeywordAndSpace() throws Exception JavaDoc {
367         performTest("SimpleMethodBodyStart", 98, "for ", "empty.pass");
368     }
369     
370     public void testAfterTypingForKeywordAndSpace() throws Exception JavaDoc {
371         performTest("SimpleEmptyMethodBody", 98, "for ", "empty.pass");
372     }
373     
374     public void testAfterForKeywordAndSpace() throws Exception JavaDoc {
375         performTest("For", 102, null, "empty.pass");
376     }
377     
378     public void testEmptyFileAfterTypingForKeywordAndParen() throws Exception JavaDoc {
379         performTest("SimpleMethodBodyStart", 98, "for (", "typesLocalFieldsAndVars.pass");
380     }
381     
382     public void testAfterTypingForKeywordAndParen() throws Exception JavaDoc {
383         performTest("SimpleEmptyMethodBody", 98, "for (", "typesLocalFieldsAndVars.pass");
384     }
385     
386     public void testAfterForKeywordAndParen() throws Exception JavaDoc {
387         performTest("For", 103, null, "typesLocalFieldsAndVars.pass");
388     }
389     
390     public void testEmptyFileAfterTypingForVarTypeAndSpace() throws Exception JavaDoc {
391         performTest("SimpleMethodBodyStart", 98, "for (int ", "i.pass");
392     }
393     
394     public void testAfterTypingForVarTypeAndSpace() throws Exception JavaDoc {
395         performTest("SimpleEmptyMethodBody", 98, "for (int ", "i.pass");
396     }
397     
398     public void testAfterForVarTypeAndSpace() throws Exception JavaDoc {
399         performTest("For", 107, null, "i.pass");
400     }
401     
402     public void testEmptyFileAfterTypingForVarAndSpace() throws Exception JavaDoc {
403         performTest("SimpleMethodBodyStart", 98, "for (int i ", "empty.pass");
404     }
405     
406     public void testAfterTypingForVarAndSpace() throws Exception JavaDoc {
407         performTest("SimpleEmptyMethodBody", 98, "for (int i ", "empty.pass");
408     }
409     
410     public void testAfterForVarAndSpace() throws Exception JavaDoc {
411         performTest("For", 109, null, "empty.pass");
412     }
413     
414     public void testEmptyFileBeforTypingForVarInit() throws Exception JavaDoc {
415         performTest("SimpleMethodBodyStart", 98, "for (int i = ", "typesLocalMembersVarsAndSmartInt.pass");
416     }
417     
418     public void testBeforTypingForVarInit() throws Exception JavaDoc {
419         performTest("SimpleEmptyMethodBody", 98, "for (int i = ", "typesLocalMembersVarsAndSmartInt.pass");
420     }
421     
422     public void testBeforeForVarInit() throws Exception JavaDoc {
423         performTest("For", 111, null, "typesLocalMembersVarsAndSmartInt.pass");
424     }
425     
426     public void testEmptyFileAfterTypingForVarInitAndSpace() throws Exception JavaDoc {
427         performTest("SimpleMethodBodyStart", 98, "for (int i = 0 ", "empty.pass");
428     }
429     
430     public void testAfterTypingForVarInitAndSpace() throws Exception JavaDoc {
431         performTest("SimpleEmptyMethodBody", 98, "for (int i = 0 ", "empty.pass");
432     }
433     
434     public void testAfterForVarInitAndSpace() throws Exception JavaDoc {
435         performTest("For", 112, " ", "empty.pass");
436     }
437     
438     public void testEmptyFileBeforTypingForCondition() throws Exception JavaDoc {
439         performTest("SimpleMethodBodyStart", 98, "for (int i = 0;", "typesLocalMembersVarsAndSmartBoolean.pass");
440     }
441     
442     public void testBeforTypingForCondition() throws Exception JavaDoc {
443         performTest("SimpleEmptyMethodBody", 98, "for (int i = 0;", "typesLocalMembersVarsAndSmartBoolean.pass");
444     }
445     
446     public void testBeforeForCondition() throws Exception JavaDoc {
447         performTest("For", 113, null, "typesLocalMembersVarsAndSmartBoolean.pass");
448     }
449     
450     public void testEmptyFileBeforTypingForConditionAndSpace() throws Exception JavaDoc {
451         performTest("SimpleMethodBodyStart", 98, "for (int i = 0; ", "typesLocalMembersVarsAndSmartBoolean.pass");
452     }
453     
454     public void testBeforTypingForConditionAndSpace() throws Exception JavaDoc {
455         performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; ", "typesLocalMembersVarsAndSmartBoolean.pass");
456     }
457     
458     public void testBeforeForConditionAndSpace() throws Exception JavaDoc {
459         performTest("For", 114, null, "typesLocalMembersVarsAndSmartBoolean.pass");
460     }
461     
462     public void testEmptyFileAfterTypingForConditionAndSpace() throws Exception JavaDoc {
463         performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a ", "empty.pass");
464     }
465     
466     public void testAfterTypingForConditionAndSpace() throws Exception JavaDoc {
467         performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; i < a ", "empty.pass");
468     }
469     
470     public void testAfterForConditionAndSpace() throws Exception JavaDoc {
471         performTest("For", 119, " ", "empty.pass");
472     }
473     
474     public void testEmptyFileBeforTypingForUpdateExpression() throws Exception JavaDoc {
475         performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a;", "typesLocalMembersAndVars2.pass");
476     }
477     
478     public void testBeforTypingForUpdateExpression() throws Exception JavaDoc {
479         performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; i < a;", "typesLocalMembersAndVars2.pass");
480     }
481     
482     public void testBeforeForUpdateExpression() throws Exception JavaDoc {
483         performTest("For", 120, null, "typesLocalMembersAndVars2.pass");
484     }
485     
486     public void testEmptyFileBeforTypingForUpdateExpressionAndSpace() throws Exception JavaDoc {
487         performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a; ", "typesLocalMembersAndVars2.pass");
488     }
489     
490     public void testBeforTypingForUpdateExpressionAndSpace() throws Exception JavaDoc {
491         performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; i < a; ", "typesLocalMembersAndVars2.pass");
492     }
493     
494     public void testBeforeForUpdateExpressionAndSpace() throws Exception JavaDoc {
495         performTest("For", 121, null, "typesLocalMembersAndVars2.pass");
496     }
497     
498     public void testEmptyFileAfterTypingForUpdateExpressionAndSpace() throws Exception JavaDoc {
499         performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a; i++ ", "empty.pass");
500     }
501     
502     public void testAfterTypingForUpdateExpressionAndSpace() throws Exception JavaDoc {
503         performTest("SimpleEmptyMethodBody", 98, "for (int i = 0 ; i < a; i++ ", "empty.pass");
504     }
505     
506     public void testAfterForUpdateExpressionAndSpace() throws Exception JavaDoc {
507         performTest("For", 124, " ", "empty.pass");
508     }
509     
510     public void testEmptyFileAfterTypingForUpdateExpressionAndParen() throws Exception JavaDoc {
511         performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a; i++)", "methodBodyContentAfterFor.pass");
512     }
513     
514     public void testAfterTypingForUpdateExpressionAndParen() throws Exception JavaDoc {
515         performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; i < a; i++)", "methodBodyContentAfterFor.pass");
516     }
517     
518     public void testAfterForUpdateExpressionAndParen() throws Exception JavaDoc {
519         performTest("For", 125, null, "methodBodyContentAfterFor.pass");
520     }
521     
522     public void testEmptyFileAfterTypingForUpdateExpressionParenAndSpace() throws Exception JavaDoc {
523         performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a; i++) ", "methodBodyContentAfterFor.pass");
524     }
525     
526     public void testAfterTypingForUpdateExpressionParenAndSpace() throws Exception JavaDoc {
527         performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; i < a; i++) ", "methodBodyContentAfterFor.pass");
528     }
529     
530     public void testAfterForUpdateExpressionParenAndSpace() throws Exception JavaDoc {
531         performTest("For", 126, null, "methodBodyContentAfterFor.pass");
532     }
533
534     public void testEmptyFileInsideForBody() throws Exception JavaDoc {
535         performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a; i++) {\n", "blockContentAfterFor.pass");
536     }
537     
538     public void testTypingInsideForBody() throws Exception JavaDoc {
539         performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; i < a; i++) {\n", "blockContentAfterFor.pass");
540     }
541     
542     public void testInsideForBody() throws Exception JavaDoc {
543         performTest("For", 127, null, "blockContentAfterFor.pass");
544     }
545     
546     // For-each loop tests -----------------------------------------------------
547

548     public void testEmptyFileBeforTypingForEachExpression() throws Exception JavaDoc {
549         performTest("SimpleMethodBodyStart", 98, "for (Byte b :", "typesLocalMembersAndVars1.pass");
550     }
551     
552     public void testBeforTypingForEachExpression() throws Exception JavaDoc {
553         performTest("SimpleEmptyMethodBody", 98, "for (Byte b :", "typesLocalMembersAndVars1.pass");
554     }
555     
556     public void testBeforeForEachExpression() throws Exception JavaDoc {
557         performTest("ForEach", 111, null, "typesLocalMembersAndVars1.pass");
558     }
559     
560     public void testEmptyFileBeforTypingForEachExpressionAndSpace() throws Exception JavaDoc {
561         performTest("SimpleMethodBodyStart", 98, "for (Byte b : ", "typesLocalMembersAndVars1.pass");
562     }
563     
564     public void testBeforTypingForEachExpressionAndSpace() throws Exception JavaDoc {
565         performTest("SimpleEmptyMethodBody", 98, "for (Byte b : ", "typesLocalMembersAndVars1.pass");
566     }
567     
568     public void testBeforeForEachExpressionAndSpace() throws Exception JavaDoc {
569         performTest("ForEach", 112, null, "typesLocalMembersAndVars1.pass");
570     }
571     
572     public void testEmptyFileAfterTypingForEachExpressionAndSpace() throws Exception JavaDoc {
573         performTest("SimpleMethodBodyStart", 98, "for (Byte b : field.getBytes() ", "empty.pass");
574     }
575     
576     public void testAfterTypingForEachExpressionAndSpace() throws Exception JavaDoc {
577         performTest("SimpleEmptyMethodBody", 98, "for (Byte b : field.getBytes() ", "empty.pass");
578     }
579     
580     public void testAfterForEachExpressionAndSpace() throws Exception JavaDoc {
581         performTest("ForEach", 128, " ", "empty.pass");
582     }
583     
584     public void testEmptyFileAfterTypingForEachExpressionAndParen() throws Exception JavaDoc {
585         performTest("SimpleMethodBodyStart", 98, "for (Byte b : field.getBytes())", "methodBodyContentAfterForEach.pass");
586     }
587     
588     public void testAfterTypingForEachExpressionAndParen() throws Exception JavaDoc {
589         performTest("SimpleEmptyMethodBody", 98, "for (Byte b : field.getBytes())", "methodBodyContentAfterForEach.pass");
590     }
591     
592     public void testAfterForEachExpressionAndParen() throws Exception JavaDoc {
593         performTest("ForEach", 129, null, "methodBodyContentAfterForEach.pass");
594     }
595     
596     public void testEmptyFileAfterTypingForEachExpressionParenAndSpace() throws Exception JavaDoc {
597         performTest("SimpleMethodBodyStart", 98, "for (Byte b : field.getBytes()) ", "methodBodyContentAfterForEach.pass");
598     }
599     
600     public void testAfterTypingForEachExpressionParenAndSpace() throws Exception JavaDoc {
601         performTest("SimpleEmptyMethodBody", 98, "for (Byte b : field.getBytes()) ", "methodBodyContentAfterForEach.pass");
602     }
603     
604     public void testAfterForEachExpressionParenAndSpace() throws Exception JavaDoc {
605         performTest("ForEach", 130, null, "methodBodyContentAfterForEach.pass");
606     }
607     
608     public void testEmptyFileInsideForEachBody() throws Exception JavaDoc {
609         performTest("SimpleMethodBodyStart", 98, "for (Byte b : field.getBytes()) {\n", "blockContentAfterForEach.pass");
610     }
611     
612     public void testTypingInsideForEachBody() throws Exception JavaDoc {
613         performTest("SimpleEmptyMethodBody", 98, "for (Byte b : field.getBytes()) {\n", "blockContentAfterForEach.pass");
614     }
615     
616     public void testInsideForEachBody() throws Exception JavaDoc {
617         performTest("ForEach", 131, null, "blockContentAfterForEach.pass");
618     }
619     
620     // Switch-case statement tests ---------------------------------------------
621

622     public void testEmptyFileAfterTypingSwitchKeyword() throws Exception JavaDoc {
623         performTest("SimpleMethodBodyStart", 98, "switch", "switchKeyword.pass");
624     }
625     
626     public void testAfterTypingSwitchKeyword() throws Exception JavaDoc {
627         performTest("SimpleEmptyMethodBody", 98, "switch", "switchKeyword.pass");
628     }
629     
630     public void testAfterSwitchKeyword() throws Exception JavaDoc {
631         performTest("Switch", 104, null, "switchKeyword.pass");
632     }
633     
634     public void testEmptyFileAfterTypingSwitchKeywordAndSpace() throws Exception JavaDoc {
635         performTest("SimpleMethodBodyStart", 98, "switch ", "empty.pass");
636     }
637     
638     public void testAfterTypingSwitchKeywordAndSpace() throws Exception JavaDoc {
639         performTest("SimpleEmptyMethodBody", 98, "switch ", "empty.pass");
640     }
641     
642     public void testAfterSwitchKeywordAndSpace() throws Exception JavaDoc {
643         performTest("Switch", 105, null, "empty.pass");
644     }
645     
646     public void testEmptyFileAfterTypingSwitchKeywordAndParen() throws Exception JavaDoc {
647         performTest("SimpleMethodBodyStart", 98, "switch (", "typesLocalMembersVarsAndSmartEnumAndInt.pass");
648     }
649     
650     public void testAfterTypingSwitchKeywordAndParen() throws Exception JavaDoc {
651         performTest("SimpleEmptyMethodBody", 98, "switch (", "typesLocalMembersVarsAndSmartEnumAndInt.pass");
652     }
653     
654     public void testAfterSwitchKeywordAndParen() throws Exception JavaDoc {
655         performTest("Switch", 106, null, "typesLocalMembersVarsAndSmartEnumAndInt.pass");
656     }
657     
658     public void testEmptyFileAfterTypingSwitchExpression() throws Exception JavaDoc {
659         performTest("SimpleMethodBodyStart", 98, "switch (a", "a.pass");
660     }
661     
662     public void testAfterTypingSwitchExpression() throws Exception JavaDoc {
663         performTest("SimpleEmptyMethodBody", 98, "switch (a", "a.pass");
664     }
665     
666     public void testAfterSwitchExpression() throws Exception JavaDoc {
667         performTest("Switch", 107, null, "a.pass");
668     }
669     
670     public void testEmptyFileAfterTypingSwitchExpressionAndSpace() throws Exception JavaDoc {
671         performTest("SimpleMethodBodyStart", 98, "switch (a ", "empty.pass");
672     }
673     
674     public void testAfterTypingSwitchExpressionAndSpace() throws Exception JavaDoc {
675         performTest("SimpleEmptyMethodBody", 98, "switch (a ", "empty.pass");
676     }
677     
678     public void testAfterSwitchExpressionAndSpace() throws Exception JavaDoc {
679         performTest("Switch", 107, " ", "empty.pass");
680     }
681     
682     public void testEmptyFileAfterTypingSwitchExpressionAndParen() throws Exception JavaDoc {
683         performTest("SimpleMethodBodyStart", 98, "switch (a) ", "empty.pass");
684     }
685     
686     public void testAfterTypingSwitchExpressionAndParen() throws Exception JavaDoc {
687         performTest("SimpleEmptyMethodBody", 98, "switch (a) ", "empty.pass");
688     }
689     
690     public void testAfterSwitchExpressionAndParen() throws Exception JavaDoc {
691         performTest("Switch", 108, null, "empty.pass");
692     }
693     
694     public void testEmptyFileInsideSwitchBody() throws Exception JavaDoc {
695         performTest("SimpleMethodBodyStart", 98, "switch (a) {\n", "caseAndDefaultKeywords.pass");
696     }
697     
698     public void testTypingInsideSwitchBody() throws Exception JavaDoc {
699         performTest("SimpleEmptyMethodBody", 98, "switch (a) {\n", "caseAndDefaultKeywords.pass");
700     }
701     
702     public void testInsideSwitchBody() throws Exception JavaDoc {
703         performTest("Switch", 123, null, "caseAndDefaultKeywords.pass");
704     }
705     
706     public void testEmptyFileAfterTypingCaseKeyword() throws Exception JavaDoc {
707         performTest("SimpleMethodBodyStart", 98, "switch (a) {\ncase", "caseKeyword.pass");
708     }
709     
710     public void testAfterTypingCaseKeyword() throws Exception JavaDoc {
711         performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ncase", "caseKeyword.pass");
712     }
713     
714     public void testAfterCaseKeyword() throws Exception JavaDoc {
715         performTest("Switch", 127, null, "caseKeyword.pass");
716     }
717     
718     public void testEmptyFileAfterTypingCaseKeywordAndSpace() throws Exception JavaDoc {
719         performTest("SimpleMethodBodyStart", 98, "switch (a) {\ncase ", "declaredTypesAndSmartInt.pass");
720     }
721     
722     public void testAfterTypingCaseKeywordAndSpace() throws Exception JavaDoc {
723         performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ncase ", "declaredTypesAndSmartInt.pass");
724     }
725     
726     public void testAfterCaseKeywordAndSpace() throws Exception JavaDoc {
727         performTest("Switch", 127, " ", "declaredTypesAndSmartInt.pass");
728     }
729     
730     public void testEmptyFileAfterTypingCaseKeywordAndColon() throws Exception JavaDoc {
731         performTest("SimpleMethodBodyStart", 98, "switch (a) {\ncase 0:", "methodBodyContentAfterCase.pass");
732     }
733     
734     public void testAfterTypingCaseKeywordAndColon() throws Exception JavaDoc {
735         performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ncase 0:", "methodBodyContentAfterCase.pass");
736     }
737     
738     public void testAfterCaseKeywordAndColon() throws Exception JavaDoc {
739         performTest("Switch", 130, null, "methodBodyContentAfterCase.pass");
740     }
741     
742     public void testEmptyFileAfterTypingCaseKeywordAndColonAndSpace() throws Exception JavaDoc {
743         performTest("SimpleMethodBodyStart", 98, "switch (a) {\ncase 0: ", "methodBodyContentAfterCase.pass");
744     }
745     
746     public void testAfterTypingCaseKeywordAndColonAndSpace() throws Exception JavaDoc {
747         performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ncase 0: ", "methodBodyContentAfterCase.pass");
748     }
749     
750     public void testAfterCaseKeywordAndColonAndSpace() throws Exception JavaDoc {
751         performTest("Switch", 131, null, "methodBodyContentAfterCase.pass");
752     }
753     
754     public void testEmptyFileAfterTypingBreakKeyword() throws Exception JavaDoc {
755         performTest("SimpleMethodBodyStart", 98, "switch (a) {\ncase 0:\nbreak", "breakKeyword.pass");
756     }
757     
758     public void testAfterTypingBreakKeyword() throws Exception JavaDoc {
759         performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ncase 0:\nbreak", "breakKeyword.pass");
760     }
761     
762     public void testAfterBreakKeyword() throws Exception JavaDoc {
763         performTest("Switch", 152, null, "breakKeyword.pass");
764     }
765     
766     public void testEmptyFileAfterTypingDefaultKeyword() throws Exception JavaDoc {
767         performTest("SimpleMethodBodyStart", 98, "switch (a) {\ndefault", "defaultKeyword.pass");
768     }
769     
770     public void testAfterTypingDefaultKeyword() throws Exception JavaDoc {
771         performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ndefault", "defaultKeyword.pass");
772     }
773     
774     public void testAfterDefaultKeyword() throws Exception JavaDoc {
775         performTest("Switch", 173, null, "defaultKeyword.pass");
776     }
777     
778     public void testEmptyFileAfterTypingDefaultKeywordAndSpace() throws Exception JavaDoc {
779         performTest("SimpleMethodBodyStart", 98, "switch (a) {\ndefault ", "empty.pass");
780     }
781     
782     public void testAfterTypingDefaultKeywordAndSpace() throws Exception JavaDoc {
783         performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ndefault ", "empty.pass");
784     }
785     
786     public void testAfterDefaultKeywordAndSpace() throws Exception JavaDoc {
787         performTest("Switch", 173, " ", "empty.pass");
788     }
789     
790     public void testEmptyFileAfterTypingDefaultKeywordAndColon() throws Exception JavaDoc {
791         performTest("SimpleMethodBodyStart", 98, "switch (a) {\ndefault:", "methodBodyContentAfterDefault.pass");
792     }
793     
794     public void testAfterTypingDefaultKeywordAndColon() throws Exception JavaDoc {
795         performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ndefault:", "methodBodyContentAfterDefault.pass");
796     }
797     
798     public void testAfterDefaultKeywordAndColon() throws Exception JavaDoc {
799         performTest("Switch", 174, null, "methodBodyContentAfterDefault.pass");
800     }
801     
802     public void testEmptyFileAfterTypingDefaultKeywordAndColonAndSpace() throws Exception JavaDoc {
803         performTest("SimpleMethodBodyStart", 98, "switch (a) {\ndefault: ", "methodBodyContentAfterDefault.pass");
804     }
805     
806     public void testAfterTypingDefaultKeywordAndColonAndSpace() throws Exception JavaDoc {
807         performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ndefault: ", "methodBodyContentAfterDefault.pass");
808     }
809     
810     public void testAfterDefaultKeywordAndColonAndSpace() throws Exception JavaDoc {
811         performTest("Switch", 175, null, "methodBodyContentAfterDefault.pass");
812     }
813     
814     // Static initializer tests ------------------------------------------------
815

816     public void testEmptyFileAfterTypingStaticKeyword() throws Exception JavaDoc {
817         performTest("InitializersStart", 220, "static", "staticKeyword.pass");
818     }
819     
820     public void testAfterTypingStaticKeyword() throws Exception JavaDoc {
821         performTest("Field", 220, "static", "staticKeyword.pass");
822     }
823     
824     public void testAfterStaticKeyword() throws Exception JavaDoc {
825         performTest("Initializers", 235, null, "staticKeyword.pass");
826     }
827
828     public void testEmptyFileAfterTypingStaticKeywordAndSpace() throws Exception JavaDoc {
829         performTest("InitializersStart", 220, "static ", "memberModifiersAndTypesWithoutStatic.pass");
830     }
831     
832     public void testAfterTypingStaticKeywordAndSpace() throws Exception JavaDoc {
833         performTest("Field", 220, "static ", "memberModifiersAndTypesWithoutStatic.pass");
834     }
835     
836     public void testAfterStaticKeywordAndSpace() throws Exception JavaDoc {
837         performTest("Initializers", 236, null, "memberModifiersAndTypesWithoutStatic.pass");
838     }
839
840     public void testEmptyFileTypingStaticBlockBody() throws Exception JavaDoc {
841         performTest("InitializersStart", 220, "static {", "staticBlockContent.pass");
842     }
843     
844     public void testTypingStaticBlockBody() throws Exception JavaDoc {
845         performTest("Field", 220, "static {", "staticBlockContent.pass");
846     }
847     
848     public void testInStaticBlockBody() throws Exception JavaDoc {
849         performTest("Initializers", 237, null, "staticBlockContent.pass");
850     }
851
852     public void testEmptyFileTypingVarTypeInStaticBlockBody() throws Exception JavaDoc {
853         performTest("InitializersStart", 220, "static {\ni", "intKeyword.pass");
854     }
855     
856     public void testTypingVarTypeInStaticBlockBody() throws Exception JavaDoc {
857         performTest("Field", 220, "static {\ni", "intKeyword.pass");
858     }
859     
860     public void testOnVarTypeInStaticBlockBody() throws Exception JavaDoc {
861         performTest("Initializers", 247, null, "intKeyword.pass");
862     }
863
864     public void testEmptyFileBeforeTypingVarInitInStaticBlockBody() throws Exception JavaDoc {
865         performTest("InitializersStart", 220, "static {\nint i = ", "staticBlockTypesAndLocalMembers.pass");
866     }
867     
868     public void testBeforeTypingVarInitInStaticBlockBody() throws Exception JavaDoc {
869         performTest("Field", 220, "static {\nint i = ", "staticBlockTypesAndLocalMembers.pass");
870     }
871     
872     public void testBeforeVarInitInStaticBlockBody() throws Exception JavaDoc {
873         performTest("Initializers", 254, null, "staticBlockTypesAndLocalMembers.pass");
874     }
875
876     public void testEmptyFileTypingVarInitInStaticBlockBody() throws Exception JavaDoc {
877         performTest("InitializersStart", 220, "static {\nint i = f", "falseAndFloatKeywords.pass");
878     }
879     
880     public void testTypingVarInitInStaticBlockBody() throws Exception JavaDoc {
881         performTest("Field", 220, "static {\nint i = f", "falseAndFloatKeywords.pass");
882     }
883     
884     public void testOnVarInitInStaticBlockBody() throws Exception JavaDoc {
885         performTest("Initializers", 255, null, "falseAndFloatKeywords.pass");
886     }
887
888     // Instance initializer tests ----------------------------------------------
889

890     public void testEmptyFileTypingInitializerBlockBody() throws Exception JavaDoc {
891         performTest("InitializersStart", 220, "{", "initBlockContent.pass");
892     }
893     
894     public void testTypingInitializerBlockBody() throws Exception JavaDoc {
895         performTest("Field", 220, "{", "initBlockContent.pass");
896     }
897     
898     public void testInInitializerBlockBody() throws Exception JavaDoc {
899         performTest("Initializers", 277, null, "initBlockContent.pass");
900     }
901
902     public void testEmptyFileTypingVarTypeInInitializerBlockBody() throws Exception JavaDoc {
903         performTest("InitializersStart", 220, "{\nbo", "booleanKeyword.pass");
904     }
905     
906     public void testTypingVarTypeInInitializerBlockBody() throws Exception JavaDoc {
907         performTest("Field", 220, "{\nbo", "booleanKeyword.pass");
908     }
909     
910     public void testOnVarTypeInInitializerBlockBody() throws Exception JavaDoc {
911         performTest("Initializers", 288, null, "booleanKeyword.pass");
912     }
913
914     public void testEmptyFileBeforeTypingVarInitInInitializerBlockBody() throws Exception JavaDoc {
915         performTest("InitializersStart", 220, "{\nboolean b1 = ", "initBlockTypesAndLocalMembers.pass");
916     }
917     
918     public void testBeforeTypingVarInitInInitializerBlockBody() throws Exception JavaDoc {
919         performTest("Field", 220, "{\nboolean b1 = ", "initBlockTypesAndLocalMembers.pass");
920     }
921     
922     public void testBeforeVarInitInInitializerBlockBody() throws Exception JavaDoc {
923         performTest("Initializers", 299, null, "initBlockTypesAndLocalMembers.pass");
924     }
925
926     public void testEmptyFileTypingVarInitInInitializerBlockBody() throws Exception JavaDoc {
927         performTest("InitializersStart", 220, "{\nboolean b1 = b", "initBlockContentStartingWithB.pass");
928     }
929     
930     public void testTypingVarInitInInitializerBlockBody() throws Exception JavaDoc {
931         performTest("Field", 220, "{\nboolean b1 = b", "initBlockContentStartingWithB.pass");
932     }
933     
934     public void testOnVarInitInInitializerBlockBody() throws Exception JavaDoc {
935         performTest("Initializers", 300, null, "initBlockContentStartingWithB.pass");
936     }
937 }
938
Popular Tags