1 19 20 package org.netbeans.modules.java.editor.completion; 21 22 26 public class JavaCompletionProviderAdvancedTest extends CompletionTestBase { 27 28 public JavaCompletionProviderAdvancedTest(String testName) { 29 super(testName); 30 } 31 32 34 public void testEmptyFileAfterTypingNew() throws Exception { 35 performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew ", "declaredTypes.pass"); 36 } 37 38 public void testAfterTypingNew() throws Exception { 39 performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew ", "declaredTypes.pass"); 40 } 41 42 public void testAfterNew() throws Exception { 43 performTest("AdvancedMethodBody", 121, null, "declaredTypes.pass"); 44 } 45 46 public void testEmptyFileTypingConstructorName() throws Exception { 47 performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew Str", "declaredTypesStartingWithStr.pass"); 48 } 49 50 public void testTypingConstructorName() throws Exception { 51 performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew Str", "declaredTypesStartingWithStr.pass"); 52 } 53 54 public void testOnConstructorName() throws Exception { 55 performTest("AdvancedMethodBody", 124, null, "declaredTypesStartingWithStr.pass"); 56 } 57 58 public void testEmptyFileAfterTypingConstructorName() throws Exception { 59 performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String", "stringConstructors.pass"); 60 } 61 62 public void testAfterTypingConstructorName() throws Exception { 63 performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String", "stringConstructors.pass"); 64 } 65 66 public void testAfterConstructorName() throws Exception { 67 performTest("AdvancedMethodBody", 127, null, "stringConstructors.pass"); 68 } 69 70 public void testEmptyFileBeforeTypingConstructorParam() throws Exception { 71 performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(", "typesLocalMembersVarsAndSmartString.pass"); 72 } 73 74 public void testBeforeTypingConstructorParam() throws Exception { 75 performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(", "typesLocalMembersVarsAndSmartString.pass"); 76 } 77 78 public void testBeforeConstructorParam() throws Exception { 79 performTest("AdvancedMethodBody", 128, null, "typesLocalMembersVarsAndSmartString.pass"); 80 } 81 82 public void testEmptyFileTypingConstructorParam() throws Exception { 83 performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(fie", "field.pass"); 84 } 85 86 public void testTypingConstructorParam() throws Exception { 87 performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(fie", "field.pass"); 88 } 89 90 public void testOnConstructorParam() throws Exception { 91 performTest("AdvancedMethodBody", 132, null, "field.pass"); 92 } 93 94 public void testEmptyFileAfterTypingConstructorParam() throws Exception { 95 performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(field", "field.pass"); 96 } 97 98 public void testAfterTypingConstructorParam() throws Exception { 99 performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(field", "field.pass"); 100 } 101 102 public void testAfterConstructorParam() throws Exception { 103 performTest("AdvancedMethodBody", 133, null, "field.pass"); 104 } 105 106 public void testEmptyFileAfterTypingConstructorParamAndSpace() throws Exception { 107 performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(field ", "empty.pass"); 108 } 109 110 public void testAfterTypingConstructorParamAndSpace() throws Exception { 111 performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(field ", "empty.pass"); 112 } 113 114 public void testAfterConstructorParamAndSpace() throws Exception { 115 performTest("AdvancedMethodBody", 133, " ", "empty.pass"); 116 } 117 118 public void testEmptyFileAfterTypingConstructor() throws Exception { 119 performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(field)", "instanceOf.pass"); 120 } 121 122 public void testAfterTypingConstructor() throws Exception { 123 performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(field)", "instanceOf.pass"); 124 } 125 126 public void testAfterConstructor() throws Exception { 127 performTest("AdvancedMethodBody", 134, null, "instanceOf.pass"); 128 } 129 130 public void testEmptyFileAfterTypingConstructorAndSpace() throws Exception { 131 performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(field) ", "instanceOf.pass"); 132 } 133 134 public void testAfterTypingConstructorAndSpace() throws Exception { 135 performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(field) ", "instanceOf.pass"); 136 } 137 138 public void testAfterConstructorAndSpace() throws Exception { 139 performTest("AdvancedMethodBody", 134, " ", "instanceOf.pass"); 140 } 141 142 public void testEmptyFileAfterTypingConstructorAndDot() throws Exception { 143 performTest("SimpleMethodBodyStart", 89, "boolean b;\nnew String(field).", "stringContent.pass"); 144 } 145 146 public void testAfterTypingConstructorAndDot() throws Exception { 147 performTest("SimpleEmptyMethodBody", 89, "boolean b;\nnew String(field).", "stringContent.pass"); 148 } 149 150 public void testAfterConstructorAndDot() throws Exception { 151 performTest("AdvancedMethodBody", 135, null, "stringContent.pass"); 152 } 153 154 156 public void testEmptyFileAfterTypingPrimitiveTypeAndDot() throws Exception { 157 performTest("SimpleMethodBodyStart", 89, "boolean.", "classKeyword.pass"); 158 } 159 160 public void testAfterTypingPrimitiveTypeAndDot() throws Exception { 161 performTest("SimpleEmptyMethodBody", 89, "boolean.", "classKeyword.pass"); 162 } 163 164 public void testAfterPrimitiveTypeAndDot() throws Exception { 165 performTest("AdvancedMethodBody", 169, null, "classKeyword.pass"); 166 } 167 168 public void testEmptyFileTypingPrimitiveTypeDotClass() throws Exception { 169 performTest("SimpleMethodBodyStart", 89, "boolean.c", "classKeyword.pass"); 170 } 171 172 public void testTypingPrimitiveTypeDotClass() throws Exception { 173 performTest("SimpleEmptyMethodBody", 89, "boolean.c", "classKeyword.pass"); 174 } 175 176 public void testOnPrimitiveTypeDotClass() throws Exception { 177 performTest("AdvancedMethodBody", 170, null, "classKeyword.pass"); 178 } 179 180 public void testEmptyFileAfterTypingPrimitiveTypeDotClass() throws Exception { 181 performTest("SimpleMethodBodyStart", 89, "boolean.class", "classKeyword.pass"); 182 } 183 184 public void testAfterTypingPrimitiveTypeDotClass() throws Exception { 185 performTest("SimpleEmptyMethodBody", 89, "boolean.class", "classKeyword.pass"); 186 } 187 188 public void testAfterPrimitiveTypeDotClass() throws Exception { 189 performTest("AdvancedMethodBody", 174, null, "classKeyword.pass"); 190 } 191 192 194 public void testEmptyFileTypingBooleanValue() throws Exception { 195 performTest("SimpleMethodBodyStart", 89, "Boolean.FALSE.boolean", "booleanValue.pass"); 196 } 197 198 public void testTypingBooleanValue() throws Exception { 199 performTest("SimpleEmptyMethodBody", 89, "Boolean.FALSE.boolean", "booleanValue.pass"); 200 } 201 202 public void testOnBooleanValue() throws Exception { 203 performTest("AdvancedMethodBody", 198, null, "booleanValue.pass"); 204 } 205 206 208 public void testEmptyFileTypingParenWithinInitOfField() throws Exception { 209 performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = (", "typesLocalMembersAndSmartNumber.pass"); 210 } 211 212 public void testTypingParenWithinInitOfField() throws Exception { 213 performTest("FieldNoInit", 114, " = (", "typesLocalMembersAndSmartNumber.pass"); 214 } 215 216 public void testAfterParenWithinInitOfField() throws Exception { 217 performTest("Field", 141, null, "typesLocalMembersAndSmartNumber.pass"); 218 } 219 220 public void testEmptyFileTypingSecondParenWithinInitOfField() throws Exception { 221 performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = ((", "typesLocalMembersAndSmartNumber.pass"); 222 } 223 224 public void testTypingSecondParenWithinInitOfField() throws Exception { 225 performTest("FieldNoInit", 114, " = ((", "typesLocalMembersAndSmartNumber.pass"); 226 } 227 228 public void testAfterSecondParenWithinInitOfField() throws Exception { 229 performTest("Field", 142, null, "typesLocalMembersAndSmartNumber.pass"); 230 } 231 232 public void testEmptyFileTypingSecondParenAndSpaceWithinInitOfField() throws Exception { 233 performTest("MethodStart", 40, "public static int staticField;\npublic int field;\npublic Number num = (( ", "typesLocalMembersAndSmartNumber.pass"); 234 } 235 236 public void testTypingSecondParenAndSpaceWithinInitOfField() throws Exception { 237 performTest("FieldNoInit", 114, " = (( ", "typesLocalMembersAndSmartNumber.pass"); 238 } 239 240 public void testAfterSecondParenAndSpaceWithinInitOfField() throws Exception { 241 performTest("Field", 142, " ", "typesLocalMembersAndSmartNumber.pass"); 242 } 243 244 public void testEmptyFileTypingCastTypeWithinInitOfField() throws Exception { 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 { 249 performTest("FieldNoInit", 114, " = ((Number ", "empty.pass"); 250 } 251 252 public void testOnCastTypeWithinInitOfField() throws Exception { 253 performTest("Field", 148, " ", "empty.pass"); 254 } 255 256 public void testEmptyFileAfterTypingCastTypeWithinInitOfField() throws Exception { 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 { 261 performTest("FieldNoInit", 114, " = ((Number)", "typesAndLocalMembers1.pass"); 262 } 263 264 public void testAfterCastTypeWithinInitOfField() throws Exception { 265 performTest("Field", 149, null, "typesAndLocalMembers1.pass"); 266 } 267 268 public void testEmptyFileTypingCastAndSpaceWithinInitOfField() throws Exception { 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 { 273 performTest("FieldNoInit", 114, " = ((Number) ", "typesAndLocalMembers1.pass"); 274 } 275 276 public void testAfterCastAndSpaceWithinInitOfField() throws Exception { 277 performTest("Field", 149, " ", "typesAndLocalMembers1.pass"); 278 } 279 280 public void testEmptyFileTypingCastAndMethodWithinInitOfField() throws Exception { 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 { 285 performTest("FieldNoInit", 114, " = ((Number)h", "hashCode.pass"); 286 } 287 288 public void testOnCastAndMethodWithinInitOfField() throws Exception { 289 performTest("Field", 150, null, "hashCode.pass"); 290 } 291 292 public void testEmptyFileAfterTypingCastAndMethodWithinInitOfField() throws Exception { 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 { 297 performTest("FieldNoInit", 114, " = ((Number)hashCode())", "instanceOf.pass"); 298 } 299 300 public void testAfterCastAndMethodWithinInitOfField() throws Exception { 301 performTest("Field", 160, null, "instanceOf.pass"); 302 } 303 304 public void testEmptyFileAfterTypingCastWithinInitOfField() throws Exception { 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 { 309 performTest("FieldNoInit", 114, " = ((Number)hashCode()).", "numberContent.pass"); 310 } 311 312 public void testAfterCastWithinInitOfField() throws Exception { 313 performTest("Field", 161, null, "numberContent.pass"); 314 } 315 316 public void testEmptyFileBeforeTypingInstanceofWithinInitOfField() throws Exception { 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 { 321 performTest("FieldNoInit", 136, " = num ", "instanceOf.pass"); 322 } 323 324 public void testBeforeInstanceofWithinInitOfField() throws Exception { 325 performTest("Field", 200, null, "instanceOf.pass"); 326 } 327 328 public void testEmptyFileTypingInstanceofWithinInitOfField() throws Exception { 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 { 333 performTest("FieldNoInit", 136, " = num i", "instanceOf.pass"); 334 } 335 336 public void testInstanceofWithinInitOfField() throws Exception { 337 performTest("Field", 201, null, "instanceOf.pass"); 338 } 339 340 public void testEmptyFileAfterTypingInstanceofWithinInitOfField() throws Exception { 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 { 345 performTest("FieldNoInit", 136, " = num instanceof ", "declaredTypes.pass"); 346 } 347 348 public void testAfterInstanceofWithinInitOfField() throws Exception { 349 performTest("Field", 211, null, "declaredTypes.pass"); 350 } 351 352 public void testEmptyFileTypingInstanceofTypeWithinInitOfField() throws Exception { 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 { 357 performTest("FieldNoInit", 136, " = num instanceof I", "javaLangContentStartingWithI.pass"); 358 } 359 360 public void testOnInstanceofTypeWithinInitOfField() throws Exception { 361 performTest("Field", 212, null, "javaLangContentStartingWithI.pass"); 362 } 363 364 366 public void testEmptyFileAfterTypingForKeywordAndSpace() throws Exception { 367 performTest("SimpleMethodBodyStart", 98, "for ", "empty.pass"); 368 } 369 370 public void testAfterTypingForKeywordAndSpace() throws Exception { 371 performTest("SimpleEmptyMethodBody", 98, "for ", "empty.pass"); 372 } 373 374 public void testAfterForKeywordAndSpace() throws Exception { 375 performTest("For", 102, null, "empty.pass"); 376 } 377 378 public void testEmptyFileAfterTypingForKeywordAndParen() throws Exception { 379 performTest("SimpleMethodBodyStart", 98, "for (", "typesLocalFieldsAndVars.pass"); 380 } 381 382 public void testAfterTypingForKeywordAndParen() throws Exception { 383 performTest("SimpleEmptyMethodBody", 98, "for (", "typesLocalFieldsAndVars.pass"); 384 } 385 386 public void testAfterForKeywordAndParen() throws Exception { 387 performTest("For", 103, null, "typesLocalFieldsAndVars.pass"); 388 } 389 390 public void testEmptyFileAfterTypingForVarTypeAndSpace() throws Exception { 391 performTest("SimpleMethodBodyStart", 98, "for (int ", "i.pass"); 392 } 393 394 public void testAfterTypingForVarTypeAndSpace() throws Exception { 395 performTest("SimpleEmptyMethodBody", 98, "for (int ", "i.pass"); 396 } 397 398 public void testAfterForVarTypeAndSpace() throws Exception { 399 performTest("For", 107, null, "i.pass"); 400 } 401 402 public void testEmptyFileAfterTypingForVarAndSpace() throws Exception { 403 performTest("SimpleMethodBodyStart", 98, "for (int i ", "empty.pass"); 404 } 405 406 public void testAfterTypingForVarAndSpace() throws Exception { 407 performTest("SimpleEmptyMethodBody", 98, "for (int i ", "empty.pass"); 408 } 409 410 public void testAfterForVarAndSpace() throws Exception { 411 performTest("For", 109, null, "empty.pass"); 412 } 413 414 public void testEmptyFileBeforTypingForVarInit() throws Exception { 415 performTest("SimpleMethodBodyStart", 98, "for (int i = ", "typesLocalMembersVarsAndSmartInt.pass"); 416 } 417 418 public void testBeforTypingForVarInit() throws Exception { 419 performTest("SimpleEmptyMethodBody", 98, "for (int i = ", "typesLocalMembersVarsAndSmartInt.pass"); 420 } 421 422 public void testBeforeForVarInit() throws Exception { 423 performTest("For", 111, null, "typesLocalMembersVarsAndSmartInt.pass"); 424 } 425 426 public void testEmptyFileAfterTypingForVarInitAndSpace() throws Exception { 427 performTest("SimpleMethodBodyStart", 98, "for (int i = 0 ", "empty.pass"); 428 } 429 430 public void testAfterTypingForVarInitAndSpace() throws Exception { 431 performTest("SimpleEmptyMethodBody", 98, "for (int i = 0 ", "empty.pass"); 432 } 433 434 public void testAfterForVarInitAndSpace() throws Exception { 435 performTest("For", 112, " ", "empty.pass"); 436 } 437 438 public void testEmptyFileBeforTypingForCondition() throws Exception { 439 performTest("SimpleMethodBodyStart", 98, "for (int i = 0;", "typesLocalMembersVarsAndSmartBoolean.pass"); 440 } 441 442 public void testBeforTypingForCondition() throws Exception { 443 performTest("SimpleEmptyMethodBody", 98, "for (int i = 0;", "typesLocalMembersVarsAndSmartBoolean.pass"); 444 } 445 446 public void testBeforeForCondition() throws Exception { 447 performTest("For", 113, null, "typesLocalMembersVarsAndSmartBoolean.pass"); 448 } 449 450 public void testEmptyFileBeforTypingForConditionAndSpace() throws Exception { 451 performTest("SimpleMethodBodyStart", 98, "for (int i = 0; ", "typesLocalMembersVarsAndSmartBoolean.pass"); 452 } 453 454 public void testBeforTypingForConditionAndSpace() throws Exception { 455 performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; ", "typesLocalMembersVarsAndSmartBoolean.pass"); 456 } 457 458 public void testBeforeForConditionAndSpace() throws Exception { 459 performTest("For", 114, null, "typesLocalMembersVarsAndSmartBoolean.pass"); 460 } 461 462 public void testEmptyFileAfterTypingForConditionAndSpace() throws Exception { 463 performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a ", "empty.pass"); 464 } 465 466 public void testAfterTypingForConditionAndSpace() throws Exception { 467 performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; i < a ", "empty.pass"); 468 } 469 470 public void testAfterForConditionAndSpace() throws Exception { 471 performTest("For", 119, " ", "empty.pass"); 472 } 473 474 public void testEmptyFileBeforTypingForUpdateExpression() throws Exception { 475 performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a;", "typesLocalMembersAndVars2.pass"); 476 } 477 478 public void testBeforTypingForUpdateExpression() throws Exception { 479 performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; i < a;", "typesLocalMembersAndVars2.pass"); 480 } 481 482 public void testBeforeForUpdateExpression() throws Exception { 483 performTest("For", 120, null, "typesLocalMembersAndVars2.pass"); 484 } 485 486 public void testEmptyFileBeforTypingForUpdateExpressionAndSpace() throws Exception { 487 performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a; ", "typesLocalMembersAndVars2.pass"); 488 } 489 490 public void testBeforTypingForUpdateExpressionAndSpace() throws Exception { 491 performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; i < a; ", "typesLocalMembersAndVars2.pass"); 492 } 493 494 public void testBeforeForUpdateExpressionAndSpace() throws Exception { 495 performTest("For", 121, null, "typesLocalMembersAndVars2.pass"); 496 } 497 498 public void testEmptyFileAfterTypingForUpdateExpressionAndSpace() throws Exception { 499 performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a; i++ ", "empty.pass"); 500 } 501 502 public void testAfterTypingForUpdateExpressionAndSpace() throws Exception { 503 performTest("SimpleEmptyMethodBody", 98, "for (int i = 0 ; i < a; i++ ", "empty.pass"); 504 } 505 506 public void testAfterForUpdateExpressionAndSpace() throws Exception { 507 performTest("For", 124, " ", "empty.pass"); 508 } 509 510 public void testEmptyFileAfterTypingForUpdateExpressionAndParen() throws Exception { 511 performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a; i++)", "methodBodyContentAfterFor.pass"); 512 } 513 514 public void testAfterTypingForUpdateExpressionAndParen() throws Exception { 515 performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; i < a; i++)", "methodBodyContentAfterFor.pass"); 516 } 517 518 public void testAfterForUpdateExpressionAndParen() throws Exception { 519 performTest("For", 125, null, "methodBodyContentAfterFor.pass"); 520 } 521 522 public void testEmptyFileAfterTypingForUpdateExpressionParenAndSpace() throws Exception { 523 performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a; i++) ", "methodBodyContentAfterFor.pass"); 524 } 525 526 public void testAfterTypingForUpdateExpressionParenAndSpace() throws Exception { 527 performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; i < a; i++) ", "methodBodyContentAfterFor.pass"); 528 } 529 530 public void testAfterForUpdateExpressionParenAndSpace() throws Exception { 531 performTest("For", 126, null, "methodBodyContentAfterFor.pass"); 532 } 533 534 public void testEmptyFileInsideForBody() throws Exception { 535 performTest("SimpleMethodBodyStart", 98, "for (int i = 0; i < a; i++) {\n", "blockContentAfterFor.pass"); 536 } 537 538 public void testTypingInsideForBody() throws Exception { 539 performTest("SimpleEmptyMethodBody", 98, "for (int i = 0; i < a; i++) {\n", "blockContentAfterFor.pass"); 540 } 541 542 public void testInsideForBody() throws Exception { 543 performTest("For", 127, null, "blockContentAfterFor.pass"); 544 } 545 546 548 public void testEmptyFileBeforTypingForEachExpression() throws Exception { 549 performTest("SimpleMethodBodyStart", 98, "for (Byte b :", "typesLocalMembersAndVars1.pass"); 550 } 551 552 public void testBeforTypingForEachExpression() throws Exception { 553 performTest("SimpleEmptyMethodBody", 98, "for (Byte b :", "typesLocalMembersAndVars1.pass"); 554 } 555 556 public void testBeforeForEachExpression() throws Exception { 557 performTest("ForEach", 111, null, "typesLocalMembersAndVars1.pass"); 558 } 559 560 public void testEmptyFileBeforTypingForEachExpressionAndSpace() throws Exception { 561 performTest("SimpleMethodBodyStart", 98, "for (Byte b : ", "typesLocalMembersAndVars1.pass"); 562 } 563 564 public void testBeforTypingForEachExpressionAndSpace() throws Exception { 565 performTest("SimpleEmptyMethodBody", 98, "for (Byte b : ", "typesLocalMembersAndVars1.pass"); 566 } 567 568 public void testBeforeForEachExpressionAndSpace() throws Exception { 569 performTest("ForEach", 112, null, "typesLocalMembersAndVars1.pass"); 570 } 571 572 public void testEmptyFileAfterTypingForEachExpressionAndSpace() throws Exception { 573 performTest("SimpleMethodBodyStart", 98, "for (Byte b : field.getBytes() ", "empty.pass"); 574 } 575 576 public void testAfterTypingForEachExpressionAndSpace() throws Exception { 577 performTest("SimpleEmptyMethodBody", 98, "for (Byte b : field.getBytes() ", "empty.pass"); 578 } 579 580 public void testAfterForEachExpressionAndSpace() throws Exception { 581 performTest("ForEach", 128, " ", "empty.pass"); 582 } 583 584 public void testEmptyFileAfterTypingForEachExpressionAndParen() throws Exception { 585 performTest("SimpleMethodBodyStart", 98, "for (Byte b : field.getBytes())", "methodBodyContentAfterForEach.pass"); 586 } 587 588 public void testAfterTypingForEachExpressionAndParen() throws Exception { 589 performTest("SimpleEmptyMethodBody", 98, "for (Byte b : field.getBytes())", "methodBodyContentAfterForEach.pass"); 590 } 591 592 public void testAfterForEachExpressionAndParen() throws Exception { 593 performTest("ForEach", 129, null, "methodBodyContentAfterForEach.pass"); 594 } 595 596 public void testEmptyFileAfterTypingForEachExpressionParenAndSpace() throws Exception { 597 performTest("SimpleMethodBodyStart", 98, "for (Byte b : field.getBytes()) ", "methodBodyContentAfterForEach.pass"); 598 } 599 600 public void testAfterTypingForEachExpressionParenAndSpace() throws Exception { 601 performTest("SimpleEmptyMethodBody", 98, "for (Byte b : field.getBytes()) ", "methodBodyContentAfterForEach.pass"); 602 } 603 604 public void testAfterForEachExpressionParenAndSpace() throws Exception { 605 performTest("ForEach", 130, null, "methodBodyContentAfterForEach.pass"); 606 } 607 608 public void testEmptyFileInsideForEachBody() throws Exception { 609 performTest("SimpleMethodBodyStart", 98, "for (Byte b : field.getBytes()) {\n", "blockContentAfterForEach.pass"); 610 } 611 612 public void testTypingInsideForEachBody() throws Exception { 613 performTest("SimpleEmptyMethodBody", 98, "for (Byte b : field.getBytes()) {\n", "blockContentAfterForEach.pass"); 614 } 615 616 public void testInsideForEachBody() throws Exception { 617 performTest("ForEach", 131, null, "blockContentAfterForEach.pass"); 618 } 619 620 622 public void testEmptyFileAfterTypingSwitchKeyword() throws Exception { 623 performTest("SimpleMethodBodyStart", 98, "switch", "switchKeyword.pass"); 624 } 625 626 public void testAfterTypingSwitchKeyword() throws Exception { 627 performTest("SimpleEmptyMethodBody", 98, "switch", "switchKeyword.pass"); 628 } 629 630 public void testAfterSwitchKeyword() throws Exception { 631 performTest("Switch", 104, null, "switchKeyword.pass"); 632 } 633 634 public void testEmptyFileAfterTypingSwitchKeywordAndSpace() throws Exception { 635 performTest("SimpleMethodBodyStart", 98, "switch ", "empty.pass"); 636 } 637 638 public void testAfterTypingSwitchKeywordAndSpace() throws Exception { 639 performTest("SimpleEmptyMethodBody", 98, "switch ", "empty.pass"); 640 } 641 642 public void testAfterSwitchKeywordAndSpace() throws Exception { 643 performTest("Switch", 105, null, "empty.pass"); 644 } 645 646 public void testEmptyFileAfterTypingSwitchKeywordAndParen() throws Exception { 647 performTest("SimpleMethodBodyStart", 98, "switch (", "typesLocalMembersVarsAndSmartEnumAndInt.pass"); 648 } 649 650 public void testAfterTypingSwitchKeywordAndParen() throws Exception { 651 performTest("SimpleEmptyMethodBody", 98, "switch (", "typesLocalMembersVarsAndSmartEnumAndInt.pass"); 652 } 653 654 public void testAfterSwitchKeywordAndParen() throws Exception { 655 performTest("Switch", 106, null, "typesLocalMembersVarsAndSmartEnumAndInt.pass"); 656 } 657 658 public void testEmptyFileAfterTypingSwitchExpression() throws Exception { 659 performTest("SimpleMethodBodyStart", 98, "switch (a", "a.pass"); 660 } 661 662 public void testAfterTypingSwitchExpression() throws Exception { 663 performTest("SimpleEmptyMethodBody", 98, "switch (a", "a.pass"); 664 } 665 666 public void testAfterSwitchExpression() throws Exception { 667 performTest("Switch", 107, null, "a.pass"); 668 } 669 670 public void testEmptyFileAfterTypingSwitchExpressionAndSpace() throws Exception { 671 performTest("SimpleMethodBodyStart", 98, "switch (a ", "empty.pass"); 672 } 673 674 public void testAfterTypingSwitchExpressionAndSpace() throws Exception { 675 performTest("SimpleEmptyMethodBody", 98, "switch (a ", "empty.pass"); 676 } 677 678 public void testAfterSwitchExpressionAndSpace() throws Exception { 679 performTest("Switch", 107, " ", "empty.pass"); 680 } 681 682 public void testEmptyFileAfterTypingSwitchExpressionAndParen() throws Exception { 683 performTest("SimpleMethodBodyStart", 98, "switch (a) ", "empty.pass"); 684 } 685 686 public void testAfterTypingSwitchExpressionAndParen() throws Exception { 687 performTest("SimpleEmptyMethodBody", 98, "switch (a) ", "empty.pass"); 688 } 689 690 public void testAfterSwitchExpressionAndParen() throws Exception { 691 performTest("Switch", 108, null, "empty.pass"); 692 } 693 694 public void testEmptyFileInsideSwitchBody() throws Exception { 695 performTest("SimpleMethodBodyStart", 98, "switch (a) {\n", "caseAndDefaultKeywords.pass"); 696 } 697 698 public void testTypingInsideSwitchBody() throws Exception { 699 performTest("SimpleEmptyMethodBody", 98, "switch (a) {\n", "caseAndDefaultKeywords.pass"); 700 } 701 702 public void testInsideSwitchBody() throws Exception { 703 performTest("Switch", 123, null, "caseAndDefaultKeywords.pass"); 704 } 705 706 public void testEmptyFileAfterTypingCaseKeyword() throws Exception { 707 performTest("SimpleMethodBodyStart", 98, "switch (a) {\ncase", "caseKeyword.pass"); 708 } 709 710 public void testAfterTypingCaseKeyword() throws Exception { 711 performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ncase", "caseKeyword.pass"); 712 } 713 714 public void testAfterCaseKeyword() throws Exception { 715 performTest("Switch", 127, null, "caseKeyword.pass"); 716 } 717 718 public void testEmptyFileAfterTypingCaseKeywordAndSpace() throws Exception { 719 performTest("SimpleMethodBodyStart", 98, "switch (a) {\ncase ", "declaredTypesAndSmartInt.pass"); 720 } 721 722 public void testAfterTypingCaseKeywordAndSpace() throws Exception { 723 performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ncase ", "declaredTypesAndSmartInt.pass"); 724 } 725 726 public void testAfterCaseKeywordAndSpace() throws Exception { 727 performTest("Switch", 127, " ", "declaredTypesAndSmartInt.pass"); 728 } 729 730 public void testEmptyFileAfterTypingCaseKeywordAndColon() throws Exception { 731 performTest("SimpleMethodBodyStart", 98, "switch (a) {\ncase 0:", "methodBodyContentAfterCase.pass"); 732 } 733 734 public void testAfterTypingCaseKeywordAndColon() throws Exception { 735 performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ncase 0:", "methodBodyContentAfterCase.pass"); 736 } 737 738 public void testAfterCaseKeywordAndColon() throws Exception { 739 performTest("Switch", 130, null, "methodBodyContentAfterCase.pass"); 740 } 741 742 public void testEmptyFileAfterTypingCaseKeywordAndColonAndSpace() throws Exception { 743 performTest("SimpleMethodBodyStart", 98, "switch (a) {\ncase 0: ", "methodBodyContentAfterCase.pass"); 744 } 745 746 public void testAfterTypingCaseKeywordAndColonAndSpace() throws Exception { 747 performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ncase 0: ", "methodBodyContentAfterCase.pass"); 748 } 749 750 public void testAfterCaseKeywordAndColonAndSpace() throws Exception { 751 performTest("Switch", 131, null, "methodBodyContentAfterCase.pass"); 752 } 753 754 public void testEmptyFileAfterTypingBreakKeyword() throws Exception { 755 performTest("SimpleMethodBodyStart", 98, "switch (a) {\ncase 0:\nbreak", "breakKeyword.pass"); 756 } 757 758 public void testAfterTypingBreakKeyword() throws Exception { 759 performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ncase 0:\nbreak", "breakKeyword.pass"); 760 } 761 762 public void testAfterBreakKeyword() throws Exception { 763 performTest("Switch", 152, null, "breakKeyword.pass"); 764 } 765 766 public void testEmptyFileAfterTypingDefaultKeyword() throws Exception { 767 performTest("SimpleMethodBodyStart", 98, "switch (a) {\ndefault", "defaultKeyword.pass"); 768 } 769 770 public void testAfterTypingDefaultKeyword() throws Exception { 771 performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ndefault", "defaultKeyword.pass"); 772 } 773 774 public void testAfterDefaultKeyword() throws Exception { 775 performTest("Switch", 173, null, "defaultKeyword.pass"); 776 } 777 778 public void testEmptyFileAfterTypingDefaultKeywordAndSpace() throws Exception { 779 performTest("SimpleMethodBodyStart", 98, "switch (a) {\ndefault ", "empty.pass"); 780 } 781 782 public void testAfterTypingDefaultKeywordAndSpace() throws Exception { 783 performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ndefault ", "empty.pass"); 784 } 785 786 public void testAfterDefaultKeywordAndSpace() throws Exception { 787 performTest("Switch", 173, " ", "empty.pass"); 788 } 789 790 public void testEmptyFileAfterTypingDefaultKeywordAndColon() throws Exception { 791 performTest("SimpleMethodBodyStart", 98, "switch (a) {\ndefault:", "methodBodyContentAfterDefault.pass"); 792 } 793 794 public void testAfterTypingDefaultKeywordAndColon() throws Exception { 795 performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ndefault:", "methodBodyContentAfterDefault.pass"); 796 } 797 798 public void testAfterDefaultKeywordAndColon() throws Exception { 799 performTest("Switch", 174, null, "methodBodyContentAfterDefault.pass"); 800 } 801 802 public void testEmptyFileAfterTypingDefaultKeywordAndColonAndSpace() throws Exception { 803 performTest("SimpleMethodBodyStart", 98, "switch (a) {\ndefault: ", "methodBodyContentAfterDefault.pass"); 804 } 805 806 public void testAfterTypingDefaultKeywordAndColonAndSpace() throws Exception { 807 performTest("SimpleEmptyMethodBody", 98, "switch (a) {\ndefault: ", "methodBodyContentAfterDefault.pass"); 808 } 809 810 public void testAfterDefaultKeywordAndColonAndSpace() throws Exception { 811 performTest("Switch", 175, null, "methodBodyContentAfterDefault.pass"); 812 } 813 814 816 public void testEmptyFileAfterTypingStaticKeyword() throws Exception { 817 performTest("InitializersStart", 220, "static", "staticKeyword.pass"); 818 } 819 820 public void testAfterTypingStaticKeyword() throws Exception { 821 performTest("Field", 220, "static", "staticKeyword.pass"); 822 } 823 824 public void testAfterStaticKeyword() throws Exception { 825 performTest("Initializers", 235, null, "staticKeyword.pass"); 826 } 827 828 public void testEmptyFileAfterTypingStaticKeywordAndSpace() throws Exception { 829 performTest("InitializersStart", 220, "static ", "memberModifiersAndTypesWithoutStatic.pass"); 830 } 831 832 public void testAfterTypingStaticKeywordAndSpace() throws Exception { 833 performTest("Field", 220, "static ", "memberModifiersAndTypesWithoutStatic.pass"); 834 } 835 836 public void testAfterStaticKeywordAndSpace() throws Exception { 837 performTest("Initializers", 236, null, "memberModifiersAndTypesWithoutStatic.pass"); 838 } 839 840 public void testEmptyFileTypingStaticBlockBody() throws Exception { 841 performTest("InitializersStart", 220, "static {", "staticBlockContent.pass"); 842 } 843 844 public void testTypingStaticBlockBody() throws Exception { 845 performTest("Field", 220, "static {", "staticBlockContent.pass"); 846 } 847 848 public void testInStaticBlockBody() throws Exception { 849 performTest("Initializers", 237, null, "staticBlockContent.pass"); 850 } 851 852 public void testEmptyFileTypingVarTypeInStaticBlockBody() throws Exception { 853 performTest("InitializersStart", 220, "static {\ni", "intKeyword.pass"); 854 } 855 856 public void testTypingVarTypeInStaticBlockBody() throws Exception { 857 performTest("Field", 220, "static {\ni", "intKeyword.pass"); 858 } 859 860 public void testOnVarTypeInStaticBlockBody() throws Exception { 861 performTest("Initializers", 247, null, "intKeyword.pass"); 862 } 863 864 public void testEmptyFileBeforeTypingVarInitInStaticBlockBody() throws Exception { 865 performTest("InitializersStart", 220, "static {\nint i = ", "staticBlockTypesAndLocalMembers.pass"); 866 } 867 868 public void testBeforeTypingVarInitInStaticBlockBody() throws Exception { 869 performTest("Field", 220, "static {\nint i = ", "staticBlockTypesAndLocalMembers.pass"); 870 } 871 872 public void testBeforeVarInitInStaticBlockBody() throws Exception { 873 performTest("Initializers", 254, null, "staticBlockTypesAndLocalMembers.pass"); 874 } 875 876 public void testEmptyFileTypingVarInitInStaticBlockBody() throws Exception { 877 performTest("InitializersStart", 220, "static {\nint i = f", "falseAndFloatKeywords.pass"); 878 } 879 880 public void testTypingVarInitInStaticBlockBody() throws Exception { 881 performTest("Field", 220, "static {\nint i = f", "falseAndFloatKeywords.pass"); 882 } 883 884 public void testOnVarInitInStaticBlockBody() throws Exception { 885 performTest("Initializers", 255, null, "falseAndFloatKeywords.pass"); 886 } 887 888 890 public void testEmptyFileTypingInitializerBlockBody() throws Exception { 891 performTest("InitializersStart", 220, "{", "initBlockContent.pass"); 892 } 893 894 public void testTypingInitializerBlockBody() throws Exception { 895 performTest("Field", 220, "{", "initBlockContent.pass"); 896 } 897 898 public void testInInitializerBlockBody() throws Exception { 899 performTest("Initializers", 277, null, "initBlockContent.pass"); 900 } 901 902 public void testEmptyFileTypingVarTypeInInitializerBlockBody() throws Exception { 903 performTest("InitializersStart", 220, "{\nbo", "booleanKeyword.pass"); 904 } 905 906 public void testTypingVarTypeInInitializerBlockBody() throws Exception { 907 performTest("Field", 220, "{\nbo", "booleanKeyword.pass"); 908 } 909 910 public void testOnVarTypeInInitializerBlockBody() throws Exception { 911 performTest("Initializers", 288, null, "booleanKeyword.pass"); 912 } 913 914 public void testEmptyFileBeforeTypingVarInitInInitializerBlockBody() throws Exception { 915 performTest("InitializersStart", 220, "{\nboolean b1 = ", "initBlockTypesAndLocalMembers.pass"); 916 } 917 918 public void testBeforeTypingVarInitInInitializerBlockBody() throws Exception { 919 performTest("Field", 220, "{\nboolean b1 = ", "initBlockTypesAndLocalMembers.pass"); 920 } 921 922 public void testBeforeVarInitInInitializerBlockBody() throws Exception { 923 performTest("Initializers", 299, null, "initBlockTypesAndLocalMembers.pass"); 924 } 925 926 public void testEmptyFileTypingVarInitInInitializerBlockBody() throws Exception { 927 performTest("InitializersStart", 220, "{\nboolean b1 = b", "initBlockContentStartingWithB.pass"); 928 } 929 930 public void testTypingVarInitInInitializerBlockBody() throws Exception { 931 performTest("Field", 220, "{\nboolean b1 = b", "initBlockContentStartingWithB.pass"); 932 } 933 934 public void testOnVarInitInInitializerBlockBody() throws Exception { 935 performTest("Initializers", 300, null, "initBlockContentStartingWithB.pass"); 936 } 937 } 938 | Popular Tags |