1 /******************************************************************************* 2 * Copyright (c) 2000, 2020 IBM Corporation and others. 3 * 4 * This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License 2.0 6 * which accompanies this distribution, and is available at 7 * https://www.eclipse.org/legal/epl-2.0/ 8 * 9 * SPDX-License-Identifier: EPL-2.0 10 * 11 * Contributors: 12 * IBM Corporation - initial API and implementation 13 * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Does not replace similar code in parent class of anonymous class - https://bugs.eclipse.org/bugs/show_bug.cgi?id=160853 14 * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Missing return value, while extracting code out of a loop - https://bugs.eclipse.org/bugs/show_bug.cgi?id=213519 15 * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] missing return type when code can throw exception - https://bugs.eclipse.org/bugs/show_bug.cgi?id=97413 16 * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Extract method and continue https://bugs.eclipse.org/bugs/show_bug.cgi?id=48056 17 * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] should declare method static if extracted from anonymous in static method - https://bugs.eclipse.org/bugs/show_bug.cgi?id=152004 18 * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] extracting return value results in compile error - https://bugs.eclipse.org/bugs/show_bug.cgi?id=264606 19 * Samrat Dhillon <samrat.dhillon@gmail.com> - [extract method] Extracted method should be declared static if extracted expression is also used in another static method https://bugs.eclipse.org/bugs/show_bug.cgi?id=393098 20 * Samrat Dhillon <samrat.dhillon@gmail.com> - [extract method] Extracting expression of parameterized type that is passed as argument to this constructor yields compilation error https://bugs.eclipse.org/bugs/show_bug.cgi?id=394030 21 *******************************************************************************/ 22 package org.eclipse.jdt.ui.tests.refactoring; 23 24 import static org.eclipse.jdt.ui.tests.refactoring.AbstractJunit4SelectionTestCase.TestMode.COMPARE_WITH_OUTPUT; 25 import static org.eclipse.jdt.ui.tests.refactoring.AbstractJunit4SelectionTestCase.TestMode.INVALID_SELECTION; 26 import static org.eclipse.jdt.ui.tests.refactoring.AbstractJunit4SelectionTestCase.TestMode.VALID_SELECTION; 27 import static org.junit.Assert.assertEquals; 28 import static org.junit.Assert.assertTrue; 29 30 import java.lang.reflect.Modifier; 31 import java.util.ArrayList; 32 import java.util.List; 33 34 import org.junit.Rule; 35 import org.junit.Test; 36 37 import org.eclipse.core.runtime.NullProgressMonitor; 38 39 import org.eclipse.ltk.core.refactoring.CheckConditionsOperation; 40 import org.eclipse.ltk.core.refactoring.RefactoringStatus; 41 42 import org.eclipse.jdt.core.ICompilationUnit; 43 import org.eclipse.jdt.core.IPackageFragment; 44 import org.eclipse.jdt.core.ISourceRange; 45 46 import org.eclipse.jdt.internal.corext.refactoring.ParameterInfo; 47 import org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring; 48 49 import org.eclipse.jdt.ui.tests.refactoring.infra.TextRangeUtil; 50 51 public class ExtractMethodTests extends AbstractJunit4SelectionTestCase { 52 53 private static final boolean BUG_405778= true; //XXX: [1.8][dom ast] method body recovery broken (empty body) 54 55 @Rule 56 public ExtractMethodTestSetup fgTestSetup= new ExtractMethodTestSetup(); 57 58 @Override setUp()59 public void setUp() throws Exception { 60 super.setUp(); 61 fIsPreDeltaTest= true; 62 } 63 64 @Override getResourceLocation()65 protected String getResourceLocation() { 66 return "ExtractMethodWorkSpace/ExtractMethodTests/"; 67 } 68 69 @Override adaptName(String name)70 protected String adaptName(String name) { 71 return name + "_" + getName() + ".java"; 72 } 73 selectionTest(int startLine, int startColumn, int endLine, int endColumn)74 protected void selectionTest(int startLine, int startColumn, int endLine, int endColumn) throws Exception{ 75 ICompilationUnit unit= createCU(getSelectionPackage(), "A"); 76 int[] selection= getSelection(); 77 ISourceRange expected= TextRangeUtil.getSelection(unit, startLine, startColumn, endLine, endColumn); 78 assertEquals(expected.getOffset(), selection[0]); 79 assertEquals(expected.getLength(), selection[1]); 80 } 81 getSelectionPackage()82 private IPackageFragment getSelectionPackage() { 83 return fgTestSetup.getSelectionPackage(); 84 } 85 performTest(IPackageFragment packageFragment, String id, TestMode mode, String outputFolder)86 protected void performTest(IPackageFragment packageFragment, String id, TestMode mode, String outputFolder) throws Exception { 87 performTest(packageFragment, id, mode, outputFolder, null, null, 0); 88 } 89 performTest(IPackageFragment packageFragment, String id, TestMode mode, String outputFolder, String[] newNames, int[] newOrder, int destination)90 protected void performTest(IPackageFragment packageFragment, String id, TestMode mode, String outputFolder, String[] newNames, int[] newOrder, int destination) throws Exception { 91 performTest(packageFragment, id, mode, outputFolder, newNames, newOrder, destination, Modifier.PROTECTED); 92 } 93 performTest(IPackageFragment packageFragment, String id, TestMode mode, String outputFolder, String[] newNames, int[] newOrder, int destination, int visibility)94 protected void performTest(IPackageFragment packageFragment, String id, TestMode mode, String outputFolder, String[] newNames, int[] newOrder, int destination, int visibility) throws Exception { 95 ICompilationUnit unit= createCU(packageFragment, id); 96 int[] selection= getSelection(); 97 ExtractMethodRefactoring refactoring= new ExtractMethodRefactoring(unit, selection[0], selection[1]); 98 refactoring.setMethodName("extracted"); 99 refactoring.setVisibility(visibility); 100 TestModelProvider.clearDelta(); 101 RefactoringStatus status= refactoring.checkInitialConditions(new NullProgressMonitor()); 102 switch (mode) { 103 case VALID_SELECTION: 104 assertTrue(status.isOK()); 105 break; 106 case INVALID_SELECTION: 107 if (!status.isOK()) 108 return; 109 break; 110 case COMPARE_WITH_OUTPUT: 111 default: 112 break; 113 } 114 List<ParameterInfo> parameters= refactoring.getParameterInfos(); 115 if (newNames != null && newNames.length > 0) { 116 for (int i= 0; i < newNames.length; i++) { 117 if (newNames[i] != null) 118 parameters.get(i).setNewName(newNames[i]); 119 } 120 } 121 if (newOrder != null && newOrder.length > 0) { 122 assertTrue(newOrder.length == parameters.size()); 123 List<ParameterInfo> current= new ArrayList<>(parameters); 124 for (int i= 0; i < newOrder.length; i++) { 125 parameters.set(newOrder[i], current.get(i)); 126 } 127 } 128 refactoring.setDestination(destination); 129 130 String out= null; 131 if (mode == COMPARE_WITH_OUTPUT) 132 out= getProofedContent(outputFolder, id); 133 134 performTest(unit, refactoring, mode, out, true); 135 } 136 137 @Override getCheckingStyle()138 protected int getCheckingStyle() { 139 return CheckConditionsOperation.FINAL_CONDITIONS; 140 } 141 142 @Override clearPreDelta()143 protected void clearPreDelta() { 144 // Do nothing. We clear the delta before 145 // initial condition checking 146 } 147 invalidSelectionTest()148 protected void invalidSelectionTest() throws Exception { 149 performTest(fgTestSetup.getInvalidSelectionPackage(), "A", INVALID_SELECTION, null); 150 } 151 validSelectionTest()152 protected void validSelectionTest() throws Exception { 153 performTest(fgTestSetup.getValidSelectionPackage(), "A", VALID_SELECTION, null); 154 } 155 validSelectionTestChecked()156 protected void validSelectionTestChecked() throws Exception { 157 performTest(fgTestSetup.getValidSelectionCheckedPackage(), "A", COMPARE_WITH_OUTPUT, "validSelection_out"); 158 } 159 semicolonTest()160 protected void semicolonTest() throws Exception { 161 performTest(fgTestSetup.getSemicolonPackage(), "A", COMPARE_WITH_OUTPUT, "semicolon_out"); 162 } 163 tryTest()164 protected void tryTest() throws Exception { 165 performTest(fgTestSetup.getTryPackage(), "A", COMPARE_WITH_OUTPUT, "try_out"); 166 } 167 localsTest()168 protected void localsTest() throws Exception { 169 performTest(fgTestSetup.getLocalsPackage(), "A", COMPARE_WITH_OUTPUT, "locals_out"); 170 } 171 expressionTest()172 protected void expressionTest() throws Exception { 173 performTest(fgTestSetup.getExpressionPackage(), "A", COMPARE_WITH_OUTPUT, "expression_out"); 174 } 175 nestedTest()176 protected void nestedTest() throws Exception { 177 performTest(fgTestSetup.getNestedPackage(), "A", COMPARE_WITH_OUTPUT, "nested_out"); 178 } 179 returnTest()180 protected void returnTest() throws Exception { 181 performTest(fgTestSetup.getReturnPackage(), "A", COMPARE_WITH_OUTPUT, "return_out"); 182 } 183 branchTest()184 protected void branchTest() throws Exception { 185 performTest(fgTestSetup.getBranchPackage(), "A", COMPARE_WITH_OUTPUT, "branch_out"); 186 } 187 errorTest()188 protected void errorTest() throws Exception { 189 performTest(fgTestSetup.getErrorPackage(), "A", COMPARE_WITH_OUTPUT, "error_out"); 190 } 191 wikiTest()192 protected void wikiTest() throws Exception { 193 performTest(fgTestSetup.getWikiPackage(), "A", COMPARE_WITH_OUTPUT, "wiki_out"); 194 } 195 duplicatesTest()196 protected void duplicatesTest() throws Exception { 197 performTest(fgTestSetup.getDuplicatesPackage(), "A", COMPARE_WITH_OUTPUT, "duplicates_out"); 198 } 199 initializerTest()200 protected void initializerTest() throws Exception { 201 performTest(fgTestSetup.getInitializerPackage(), "A", COMPARE_WITH_OUTPUT, "initializer_out"); 202 } 203 destinationTest(int destination)204 protected void destinationTest(int destination) throws Exception { 205 performTest(fgTestSetup.getDestinationPackage(), "A", COMPARE_WITH_OUTPUT, "destination_out", 206 null, null, destination); 207 } 208 genericTest()209 protected void genericTest() throws Exception { 210 performTest(fgTestSetup.getGenericsPackage(), "A", COMPARE_WITH_OUTPUT, "generics_out"); 211 } 212 enumTest()213 protected void enumTest() throws Exception { 214 performTest(fgTestSetup.getEnumsPackage(), "A", COMPARE_WITH_OUTPUT, "enums_out"); 215 } 216 217 //===================================================================================== 218 // Testing selections 219 //===================================================================================== 220 221 222 @Test test1()223 public void test1() throws Exception { 224 selectionTest(5, 9, 5, 24); 225 } 226 227 @Test test2()228 public void test2() throws Exception { 229 selectionTest(5, 9, 5, 19); 230 } 231 232 @Test test3()233 public void test3() throws Exception { 234 selectionTest(5, 14, 5, 24); 235 } 236 237 @Test test4()238 public void test4() throws Exception { 239 selectionTest(5, 14, 5, 19); 240 } 241 242 //===================================================================================== 243 // Testing invalid selections 244 //===================================================================================== 245 246 //---- Misc 247 248 @Test test010()249 public void test010() throws Exception { 250 invalidSelectionTest(); 251 } 252 253 @Test test011()254 public void test011() throws Exception { 255 invalidSelectionTest(); 256 } 257 258 @Test test012()259 public void test012() throws Exception { 260 invalidSelectionTest(); 261 } 262 263 @Test test013()264 public void test013() throws Exception { 265 invalidSelectionTest(); 266 } 267 268 @Test test014()269 public void test014() throws Exception { 270 invalidSelectionTest(); 271 } 272 273 @Test test015()274 public void test015() throws Exception { 275 invalidSelectionTest(); 276 } 277 278 @Test test016()279 public void test016() throws Exception { 280 invalidSelectionTest(); 281 } 282 283 //---- Switch / Case 284 285 @Test test020()286 public void test020() throws Exception { 287 invalidSelectionTest(); 288 } 289 290 @Test test021()291 public void test021() throws Exception { 292 invalidSelectionTest(); 293 } 294 295 @Test test022()296 public void test022() throws Exception { 297 invalidSelectionTest(); 298 } 299 300 //---- Block 301 302 @Test test030()303 public void test030() throws Exception { 304 invalidSelectionTest(); 305 } 306 307 @Test test031()308 public void test031() throws Exception { 309 invalidSelectionTest(); 310 } 311 312 //---- For 313 314 @Test test040()315 public void test040() throws Exception { 316 invalidSelectionTest(); 317 } 318 319 @Test test041()320 public void test041() throws Exception { 321 invalidSelectionTest(); 322 } 323 324 @Test test042()325 public void test042() throws Exception { 326 invalidSelectionTest(); 327 } 328 329 @Test test043()330 public void test043() throws Exception { 331 invalidSelectionTest(); 332 } 333 334 @Test test044()335 public void test044() throws Exception { 336 invalidSelectionTest(); 337 } 338 339 @Test test045()340 public void test045() throws Exception { 341 invalidSelectionTest(); 342 } 343 344 @Test test046()345 public void test046() throws Exception { 346 invalidSelectionTest(); 347 } 348 349 @Test test047()350 public void test047() throws Exception { 351 invalidSelectionTest(); 352 } 353 354 @Test test048()355 public void test048() throws Exception { 356 invalidSelectionTest(); 357 } 358 359 //---- While 360 361 @Test test050()362 public void test050() throws Exception { 363 invalidSelectionTest(); 364 } 365 366 @Test test051()367 public void test051() throws Exception { 368 invalidSelectionTest(); 369 } 370 371 @Test test052()372 public void test052() throws Exception { 373 invalidSelectionTest(); 374 } 375 376 //---- do / While 377 378 @Test test060()379 public void test060() throws Exception { 380 invalidSelectionTest(); 381 } 382 383 @Test test061()384 public void test061() throws Exception { 385 invalidSelectionTest(); 386 } 387 388 @Test test062()389 public void test062() throws Exception { 390 invalidSelectionTest(); 391 } 392 393 @Test test063()394 public void test063() throws Exception { 395 invalidSelectionTest(); 396 } 397 398 //---- switch 399 400 @Test test070()401 public void test070() throws Exception { 402 invalidSelectionTest(); 403 } 404 405 @Test test071()406 public void test071() throws Exception { 407 invalidSelectionTest(); 408 } 409 410 @Test test072()411 public void test072() throws Exception { 412 invalidSelectionTest(); 413 } 414 415 @Test test073()416 public void test073() throws Exception { 417 invalidSelectionTest(); 418 } 419 420 //---- if then else 421 422 @Test test080()423 public void test080() throws Exception { 424 invalidSelectionTest(); 425 } 426 427 @Test test081()428 public void test081() throws Exception { 429 invalidSelectionTest(); 430 } 431 432 @Test test082()433 public void test082() throws Exception { 434 invalidSelectionTest(); 435 } 436 437 @Test test083()438 public void test083() throws Exception { 439 invalidSelectionTest(); 440 } 441 442 @Test test084()443 public void test084() throws Exception { 444 invalidSelectionTest(); 445 } 446 447 @Test test085()448 public void test085() throws Exception { 449 invalidSelectionTest(); 450 } 451 452 //---- Break 453 454 @Test test090()455 public void test090() throws Exception { 456 invalidSelectionTest(); 457 } 458 459 @Test test091()460 public void test091() throws Exception { 461 invalidSelectionTest(); 462 } 463 464 @Test test092()465 public void test092() throws Exception { 466 invalidSelectionTest(); 467 } 468 469 @Test test093()470 public void test093() throws Exception { 471 invalidSelectionTest(); 472 } 473 474 @Test test094()475 public void test094() throws Exception { 476 invalidSelectionTest(); 477 } 478 479 @Test test095()480 public void test095() throws Exception { 481 invalidSelectionTest(); 482 } 483 484 @Test test096()485 public void test096() throws Exception { 486 invalidSelectionTest(); 487 } 488 489 //---- Try / catch / finally 490 491 @Test test100()492 public void test100() throws Exception { 493 invalidSelectionTest(); 494 } 495 496 @Test test101()497 public void test101() throws Exception { 498 invalidSelectionTest(); 499 } 500 501 @Test test102()502 public void test102() throws Exception { 503 invalidSelectionTest(); 504 } 505 506 @Test test103()507 public void test103() throws Exception { 508 invalidSelectionTest(); 509 } 510 511 @Test test104()512 public void test104() throws Exception { 513 invalidSelectionTest(); 514 } 515 516 @Test test105()517 public void test105() throws Exception { 518 invalidSelectionTest(); 519 } 520 521 @Test test106()522 public void test106() throws Exception { 523 invalidSelectionTest(); 524 } 525 526 @Test test107()527 public void test107() throws Exception { 528 invalidSelectionTest(); 529 } 530 531 @Test test108()532 public void test108() throws Exception { 533 invalidSelectionTest(); 534 } 535 536 @Test test109()537 public void test109() throws Exception { 538 invalidSelectionTest(); 539 } 540 541 @Test test110()542 public void test110() throws Exception { 543 invalidSelectionTest(); 544 } 545 546 @Test test111()547 public void test111() throws Exception { 548 invalidSelectionTest(); 549 } 550 551 @Test test112()552 public void test112() throws Exception { 553 invalidSelectionTest(); 554 } 555 556 @Test test113()557 public void test113() throws Exception { 558 invalidSelectionTest(); 559 } 560 561 @Test test114()562 public void test114() throws Exception { 563 invalidSelectionTest(); 564 } 565 566 @Test test115()567 public void test115() throws Exception { 568 invalidSelectionTest(); 569 } 570 571 //---- invalid local var selection 572 573 @Test test120()574 public void test120() throws Exception { 575 invalidSelectionTest(); 576 } 577 578 @Test test121()579 public void test121() throws Exception { 580 invalidSelectionTest(); 581 } 582 583 @Test test122()584 public void test122() throws Exception { 585 invalidSelectionTest(); 586 } 587 588 @Test test123()589 public void test123() throws Exception { 590 invalidSelectionTest(); 591 } 592 593 @Test test124()594 public void test124() throws Exception { 595 invalidSelectionTest(); 596 } 597 598 //---- invalid local type selection 599 600 @Test test130()601 public void test130() throws Exception { 602 invalidSelectionTest(); 603 } 604 605 @Test test131()606 public void test131() throws Exception { 607 invalidSelectionTest(); 608 } 609 610 //---- invalid return statement selection 611 612 @Test test140()613 public void test140() throws Exception { 614 invalidSelectionTest(); 615 } 616 617 @Test test141()618 public void test141() throws Exception { 619 invalidSelectionTest(); 620 } 621 622 @Test test142()623 public void test142() throws Exception { 624 invalidSelectionTest(); 625 } 626 627 @Test test143()628 public void test143() throws Exception { 629 invalidSelectionTest(); 630 } 631 632 @Test test144()633 public void test144() throws Exception { 634 invalidSelectionTest(); 635 } 636 637 @Test test145()638 public void test145() throws Exception { 639 invalidSelectionTest(); 640 } 641 642 @Test test146()643 public void test146() throws Exception { 644 invalidSelectionTest(); 645 } 646 647 @Test test147()648 public void test147() throws Exception { 649 invalidSelectionTest(); 650 } 651 652 @Test test148()653 public void test148() throws Exception { 654 invalidSelectionTest(); 655 } 656 657 @Test test149()658 public void test149() throws Exception { 659 invalidSelectionTest(); 660 } 661 662 //---- Synchronized statement 663 664 @Test test150()665 public void test150() throws Exception { 666 invalidSelectionTest(); 667 } 668 669 @Test test151()670 public void test151() throws Exception { 671 invalidSelectionTest(); 672 } 673 674 @Test test152()675 public void test152() throws Exception { 676 invalidSelectionTest(); 677 } 678 679 @Test test153()680 public void test153() throws Exception { 681 invalidSelectionTest(); 682 } 683 684 @Test test160()685 public void test160() throws Exception { 686 invalidSelectionTest(); 687 } 688 689 @Test test161()690 public void test161() throws Exception { 691 invalidSelectionTest(); 692 } 693 694 //----- local declarations 695 696 @Test test170()697 public void test170() throws Exception { 698 invalidSelectionTest(); 699 } 700 701 @Test test171()702 public void test171() throws Exception { 703 invalidSelectionTest(); 704 } 705 706 @Test test172()707 public void test172() throws Exception { 708 invalidSelectionTest(); 709 } 710 711 @Test test173()712 public void test173() throws Exception { 713 invalidSelectionTest(); 714 } 715 716 //---- Constructor 717 718 @Test test180()719 public void test180() throws Exception { 720 // System.out.println(getClass().getName() + "::"+ getName() + " disabled - see bug 11853"); 721 invalidSelectionTest(); 722 } 723 724 @Test test181()725 public void test181() throws Exception { 726 // System.out.println(getClass().getName() + "::"+ getName() + " disabled - see bug 11853"); 727 invalidSelectionTest(); 728 } 729 730 //---- More return statement handling 731 732 @Test test190()733 public void test190() throws Exception { 734 invalidSelectionTest(); 735 } 736 737 @Test test191()738 public void test191() throws Exception { 739 invalidSelectionTest(); 740 } 741 742 //---- Assignment 743 744 @Test test192()745 public void test192() throws Exception { 746 invalidSelectionTest(); 747 } 748 749 @Test test193()750 public void test193() throws Exception { 751 invalidSelectionTest(); 752 } 753 754 //---- single names 755 756 @Test test194()757 public void test194() throws Exception { 758 invalidSelectionTest(); 759 } 760 761 //---- case expression 762 763 @Test test195()764 public void test195() throws Exception { 765 invalidSelectionTest(); 766 } 767 768 //---- more than one value to return 769 770 @Test test196()771 public void test196() throws Exception { 772 invalidSelectionTest(); 773 } 774 775 //---- continue not possible 776 777 @Test test197()778 public void test197() throws Exception { 779 invalidSelectionTest(); 780 } 781 782 783 784 //==================================================================================== 785 // Testing valid selections 786 //===================================================================================== 787 788 //---- Misc 789 790 @Test test200()791 public void test200() throws Exception { 792 validSelectionTest(); 793 } 794 795 @Test test201()796 public void test201() throws Exception { 797 validSelectionTest(); 798 } 799 800 @Test test202()801 public void test202() throws Exception { 802 validSelectionTest(); 803 } 804 805 @Test test203()806 public void test203() throws Exception { 807 validSelectionTest(); 808 } 809 810 //---- Block 811 812 @Test test230()813 public void test230() throws Exception { 814 validSelectionTest(); 815 } 816 817 @Test test231()818 public void test231() throws Exception { 819 validSelectionTest(); 820 } 821 822 @Test test232()823 public void test232() throws Exception { 824 validSelectionTest(); 825 } 826 827 @Test test233()828 public void test233() throws Exception { 829 validSelectionTest(); 830 } 831 832 @Test test234()833 public void test234() throws Exception { 834 validSelectionTest(); 835 } 836 837 @Test test235()838 public void test235() throws Exception { 839 validSelectionTest(); 840 } 841 842 //---- For statement 843 844 @Test test240()845 public void test240() throws Exception { 846 validSelectionTest(); 847 } 848 849 @Test test241()850 public void test241() throws Exception { 851 validSelectionTest(); 852 } 853 854 @Test test244()855 public void test244() throws Exception { 856 validSelectionTest(); 857 } 858 859 @Test test245()860 public void test245() throws Exception { 861 validSelectionTest(); 862 } 863 864 @Test test246()865 public void test246() throws Exception { 866 validSelectionTest(); 867 } 868 869 @Test test247()870 public void test247() throws Exception { 871 validSelectionTest(); 872 } 873 874 @Test test248()875 public void test248() throws Exception { 876 validSelectionTest(); 877 } 878 879 @Test test249()880 public void test249() throws Exception { 881 validSelectionTest(); 882 } 883 884 //---- While statement 885 886 @Test test250()887 public void test250() throws Exception { 888 validSelectionTest(); 889 } 890 891 @Test test251()892 public void test251() throws Exception { 893 validSelectionTest(); 894 } 895 896 @Test test252()897 public void test252() throws Exception { 898 validSelectionTest(); 899 } 900 901 @Test test253()902 public void test253() throws Exception { 903 validSelectionTest(); 904 } 905 906 @Test test254()907 public void test254() throws Exception { 908 validSelectionTest(); 909 } 910 911 @Test test255()912 public void test255() throws Exception { 913 validSelectionTest(); 914 } 915 916 //---- do while statement 917 918 @Test test260()919 public void test260() throws Exception { 920 validSelectionTest(); 921 } 922 923 @Test test261()924 public void test261() throws Exception { 925 validSelectionTest(); 926 } 927 928 @Test test262()929 public void test262() throws Exception { 930 validSelectionTest(); 931 } 932 933 @Test test263()934 public void test263() throws Exception { 935 validSelectionTest(); 936 } 937 938 //---- switch 939 940 @Test test270()941 public void test270() throws Exception { 942 validSelectionTest(); 943 } 944 945 @Test test271()946 public void test271() throws Exception { 947 validSelectionTest(); 948 } 949 950 @Test test272()951 public void test272() throws Exception { 952 validSelectionTest(); 953 } 954 955 @Test test273()956 public void test273() throws Exception { 957 validSelectionTest(); 958 } 959 960 @Test test274()961 public void test274() throws Exception { 962 validSelectionTest(); 963 } 964 965 @Test test275()966 public void test275() throws Exception { 967 validSelectionTest(); 968 } 969 970 //---- if then else 971 972 @Test test280()973 public void test280() throws Exception { 974 validSelectionTest(); 975 } 976 977 @Test test281()978 public void test281() throws Exception { 979 validSelectionTest(); 980 } 981 982 @Test test282()983 public void test282() throws Exception { 984 validSelectionTest(); 985 } 986 987 @Test test283()988 public void test283() throws Exception { 989 validSelectionTest(); 990 } 991 992 @Test test284()993 public void test284() throws Exception { 994 validSelectionTest(); 995 } 996 997 @Test test285()998 public void test285() throws Exception { 999 validSelectionTest(); 1000 } 1001 1002 //---- try / catch / finally 1003 1004 @Test test300()1005 public void test300() throws Exception { 1006 validSelectionTest(); 1007 } 1008 1009 @Test test301()1010 public void test301() throws Exception { 1011 validSelectionTest(); 1012 } 1013 1014 @Test test302()1015 public void test302() throws Exception { 1016 validSelectionTest(); 1017 } 1018 1019 @Test test304()1020 public void test304() throws Exception { 1021 validSelectionTest(); 1022 } 1023 1024 @Test test305()1025 public void test305() throws Exception { 1026 validSelectionTest(); 1027 } 1028 1029 @Test test306()1030 public void test306() throws Exception { 1031 validSelectionTest(); 1032 } 1033 1034 @Test test307()1035 public void test307() throws Exception { 1036 validSelectionTest(); 1037 } 1038 1039 @Test test308()1040 public void test308() throws Exception { 1041 validSelectionTest(); 1042 } 1043 1044 @Test test309()1045 public void test309() throws Exception { 1046 validSelectionTest(); 1047 } 1048 1049 @Test test310()1050 public void test310() throws Exception { 1051 validSelectionTest(); 1052 } 1053 1054 @Test test311()1055 public void test311() throws Exception { 1056 validSelectionTest(); 1057 } 1058 1059 //---- Synchronized statement 1060 1061 @Test test350()1062 public void test350() throws Exception { 1063 validSelectionTest(); 1064 } 1065 1066 @Test test351()1067 public void test351() throws Exception { 1068 validSelectionTest(); 1069 } 1070 1071 @Test test352()1072 public void test352() throws Exception { 1073 validSelectionTest(); 1074 } 1075 1076 @Test test353()1077 public void test353() throws Exception { 1078 validSelectionTest(); 1079 } 1080 1081 @Test test360()1082 public void test360() throws Exception { 1083 validSelectionTestChecked(); 1084 } 1085 1086 @Test test361()1087 public void test361() throws Exception { 1088 validSelectionTestChecked(); 1089 } 1090 1091 @Test test362()1092 public void test362() throws Exception { 1093 validSelectionTestChecked(); 1094 } 1095 1096 @Test test363()1097 public void test363() throws Exception { 1098 validSelectionTestChecked(); 1099 } 1100 1101 @Test test364()1102 public void test364() throws Exception { 1103 validSelectionTestChecked(); 1104 } 1105 1106 @Test test365()1107 public void test365() throws Exception { 1108 validSelectionTestChecked(); 1109 } 1110 1111 @Test test366()1112 public void test366() throws Exception { 1113 validSelectionTestChecked(); 1114 } 1115 1116 @Test test367()1117 public void test367() throws Exception { 1118 validSelectionTestChecked(); 1119 } 1120 1121 @Test test368()1122 public void test368() throws Exception { 1123 validSelectionTestChecked(); 1124 } 1125 1126 @Test test369()1127 public void test369() throws Exception { 1128 validSelectionTestChecked(); 1129 } 1130 1131 @Test test370()1132 public void test370() throws Exception { 1133 validSelectionTestChecked(); 1134 } 1135 1136 @Test test371()1137 public void test371() throws Exception { 1138 validSelectionTestChecked(); 1139 } 1140 1141 @Test test372()1142 public void test372() throws Exception { 1143 validSelectionTestChecked(); 1144 } 1145 1146 @Test test373()1147 public void test373() throws Exception { 1148 validSelectionTestChecked(); 1149 } 1150 1151 @Test test374()1152 public void test374() throws Exception { 1153 validSelectionTestChecked(); 1154 } 1155 1156 //==================================================================================== 1157 // Testing Extracted result 1158 //==================================================================================== 1159 1160 //---- Test semicolon 1161 1162 @Test test400()1163 public void test400() throws Exception { 1164 semicolonTest(); 1165 } 1166 1167 @Test test401()1168 public void test401() throws Exception { 1169 semicolonTest(); 1170 } 1171 1172 @Test test402()1173 public void test402() throws Exception { 1174 semicolonTest(); 1175 } 1176 1177 @Test test403()1178 public void test403() throws Exception { 1179 semicolonTest(); 1180 } 1181 1182 @Test test404()1183 public void test404() throws Exception { 1184 semicolonTest(); 1185 } 1186 1187 @Test test406()1188 public void test406() throws Exception { 1189 semicolonTest(); 1190 } 1191 1192 @Test test407()1193 public void test407() throws Exception { 1194 semicolonTest(); 1195 } 1196 1197 @Test test409()1198 public void test409() throws Exception { 1199 semicolonTest(); 1200 } 1201 1202 @Test test410()1203 public void test410() throws Exception { 1204 semicolonTest(); 1205 } 1206 1207 @Test test411()1208 public void test411() throws Exception { 1209 semicolonTest(); //https://bugs.eclipse.org/bugs/show_bug.cgi?id=366281 1210 } 1211 1212 @Test test412()1213 public void test412() throws Exception { 1214 semicolonTest(); //https://bugs.eclipse.org/bugs/show_bug.cgi?id=366281 1215 } 1216 1217 //---- Test Try / catch block 1218 1219 @Test test450()1220 public void test450() throws Exception { 1221 tryTest(); 1222 } 1223 1224 @Test test451()1225 public void test451() throws Exception { 1226 tryTest(); 1227 } 1228 1229 @Test test452()1230 public void test452() throws Exception { 1231 tryTest(); 1232 } 1233 1234 @Test test453()1235 public void test453() throws Exception { 1236 tryTest(); 1237 } 1238 1239 @Test test454()1240 public void test454() throws Exception { 1241 tryTest(); 1242 } 1243 1244 @Test test455()1245 public void test455() throws Exception { 1246 tryTest(); 1247 } 1248 1249 @Test test456()1250 public void test456() throws Exception { 1251 tryTest(); 1252 } 1253 1254 @Test test457()1255 public void test457() throws Exception { 1256 tryTest(); 1257 } 1258 1259 @Test test458()1260 public void test458() throws Exception { 1261 tryTest(); 1262 } 1263 1264 @Test test459()1265 public void test459() throws Exception { 1266 tryTest(); 1267 } 1268 1269 @Test test460()1270 public void test460() throws Exception { 1271 tryTest(); 1272 } 1273 1274 @Test test461()1275 public void test461() throws Exception { 1276 tryTest(); 1277 } 1278 1279 @Test test462()1280 public void test462() throws Exception { 1281 tryTest(); 1282 } 1283 1284 //---- Test local vars and types 1285 1286 @Test test500()1287 public void test500() throws Exception { 1288 localsTest(); 1289 } 1290 1291 @Test test501()1292 public void test501() throws Exception { 1293 localsTest(); 1294 } 1295 1296 @Test test502()1297 public void test502() throws Exception { 1298 localsTest(); 1299 } 1300 1301 @Test test503()1302 public void test503() throws Exception { 1303 localsTest(); 1304 } 1305 1306 @Test test504()1307 public void test504() throws Exception { 1308 localsTest(); 1309 } 1310 1311 @Test test505()1312 public void test505() throws Exception { 1313 localsTest(); 1314 } 1315 1316 @Test test506()1317 public void test506() throws Exception { 1318 localsTest(); 1319 } 1320 1321 @Test test507()1322 public void test507() throws Exception { 1323 localsTest(); 1324 } 1325 1326 @Test test508()1327 public void test508() throws Exception { 1328 localsTest(); 1329 } 1330 1331 @Test test509()1332 public void test509() throws Exception { 1333 localsTest(); 1334 } 1335 1336 @Test test510()1337 public void test510() throws Exception { 1338 localsTest(); 1339 } 1340 1341 @Test test511()1342 public void test511() throws Exception { 1343 localsTest(); 1344 } 1345 1346 @Test test512()1347 public void test512() throws Exception { 1348 localsTest(); 1349 } 1350 1351 @Test test513()1352 public void test513() throws Exception { 1353 localsTest(); 1354 } 1355 1356 @Test test514()1357 public void test514() throws Exception { 1358 localsTest(); 1359 } 1360 1361 @Test test515()1362 public void test515() throws Exception { 1363 localsTest(); 1364 } 1365 1366 @Test test516()1367 public void test516() throws Exception { 1368 localsTest(); 1369 } 1370 1371 @Test test517()1372 public void test517() throws Exception { 1373 localsTest(); 1374 } 1375 1376 @Test test518()1377 public void test518() throws Exception { 1378 localsTest(); 1379 } 1380 1381 @Test test519()1382 public void test519() throws Exception { 1383 localsTest(); 1384 } 1385 1386 @Test test520()1387 public void test520() throws Exception { 1388 localsTest(); 1389 } 1390 1391 @Test test521()1392 public void test521() throws Exception { 1393 localsTest(); 1394 } 1395 1396 @Test test522()1397 public void test522() throws Exception { 1398 localsTest(); 1399 } 1400 1401 @Test test523()1402 public void test523() throws Exception { 1403 localsTest(); 1404 } 1405 1406 @Test test524()1407 public void test524() throws Exception { 1408 localsTest(); 1409 } 1410 1411 @Test test525()1412 public void test525() throws Exception { 1413 localsTest(); 1414 } 1415 1416 @Test test526()1417 public void test526() throws Exception { 1418 localsTest(); 1419 } 1420 1421 @Test test527()1422 public void test527() throws Exception { 1423 localsTest(); 1424 } 1425 1426 @Test test528()1427 public void test528() throws Exception { 1428 localsTest(); 1429 } 1430 1431 @Test test530()1432 public void test530() throws Exception { 1433 localsTest(); 1434 } 1435 1436 @Test test531()1437 public void test531() throws Exception { 1438 localsTest(); 1439 } 1440 1441 @Test test532()1442 public void test532() throws Exception { 1443 localsTest(); 1444 } 1445 1446 @Test test533()1447 public void test533() throws Exception { 1448 localsTest(); 1449 } 1450 1451 @Test test534()1452 public void test534() throws Exception { 1453 localsTest(); 1454 } 1455 1456 @Test test535()1457 public void test535() throws Exception { 1458 localsTest(); 1459 } 1460 1461 @Test test536()1462 public void test536() throws Exception { 1463 localsTest(); 1464 } 1465 1466 @Test test537()1467 public void test537() throws Exception { 1468 localsTest(); 1469 } 1470 1471 @Test test538()1472 public void test538() throws Exception { 1473 localsTest(); 1474 } 1475 1476 @Test test539()1477 public void test539() throws Exception { 1478 localsTest(); 1479 } 1480 1481 @Test test540()1482 public void test540() throws Exception { 1483 localsTest(); 1484 } 1485 1486 @Test test541()1487 public void test541() throws Exception { 1488 localsTest(); 1489 } 1490 1491 @Test test542()1492 public void test542() throws Exception { 1493 localsTest(); 1494 } 1495 1496 @Test test543()1497 public void test543() throws Exception { 1498 localsTest(); 1499 } 1500 1501 @Test test550()1502 public void test550() throws Exception { 1503 localsTest(); 1504 } 1505 1506 @Test test551()1507 public void test551() throws Exception { 1508 localsTest(); 1509 } 1510 1511 @Test test552()1512 public void test552() throws Exception { 1513 localsTest(); 1514 } 1515 1516 @Test test553()1517 public void test553() throws Exception { 1518 localsTest(); 1519 } 1520 1521 @Test test554()1522 public void test554() throws Exception { 1523 localsTest(); 1524 } 1525 1526 @Test test555()1527 public void test555() throws Exception { 1528 localsTest(); 1529 } 1530 1531 @Test test556()1532 public void test556() throws Exception { 1533 localsTest(); 1534 } 1535 1536 @Test test557()1537 public void test557() throws Exception { 1538 localsTest(); 1539 } 1540 1541 @Test test558()1542 public void test558() throws Exception { 1543 localsTest(); 1544 } 1545 1546 @Test test559()1547 public void test559() throws Exception { 1548 localsTest(); 1549 } 1550 1551 @Test test560()1552 public void test560() throws Exception { 1553 localsTest(); 1554 } 1555 1556 @Test test561()1557 public void test561() throws Exception { 1558 localsTest(); 1559 } 1560 1561 @Test test562()1562 public void test562() throws Exception { 1563 localsTest(); 1564 } 1565 1566 @Test test563()1567 public void test563() throws Exception { 1568 localsTest(); 1569 } 1570 1571 @Test test564()1572 public void test564() throws Exception { 1573 localsTest(); 1574 } 1575 1576 @Test test565()1577 public void test565() throws Exception { 1578 localsTest(); 1579 } 1580 1581 @Test test566()1582 public void test566() throws Exception { 1583 localsTest(); 1584 } 1585 1586 @Test test567()1587 public void test567() throws Exception { 1588 localsTest(); 1589 } 1590 1591 @Test test568()1592 public void test568() throws Exception { 1593 localsTest(); 1594 } 1595 1596 @Test test569()1597 public void test569() throws Exception { 1598 localsTest(); 1599 } 1600 1601 @Test test570()1602 public void test570() throws Exception { 1603 localsTest(); 1604 } 1605 1606 @Test test571()1607 public void test571() throws Exception { 1608 localsTest(); 1609 } 1610 1611 @Test test572()1612 public void test572() throws Exception { 1613 localsTest(); 1614 } 1615 1616 @Test test575()1617 public void test575() throws Exception { 1618 localsTest(); 1619 } 1620 1621 @Test test576()1622 public void test576() throws Exception { 1623 localsTest(); 1624 } 1625 1626 @Test test577()1627 public void test577() throws Exception { 1628 localsTest(); 1629 } 1630 1631 @Test test578()1632 public void test578() throws Exception { 1633 localsTest(); 1634 } 1635 1636 //---- Test expressions 1637 1638 @Test test600()1639 public void test600() throws Exception { 1640 expressionTest(); 1641 } 1642 1643 @Test test601()1644 public void test601() throws Exception { 1645 expressionTest(); 1646 } 1647 1648 @Test test602()1649 public void test602() throws Exception { 1650 expressionTest(); 1651 } 1652 1653 @Test test603()1654 public void test603() throws Exception { 1655 expressionTest(); 1656 } 1657 1658 @Test test604()1659 public void test604() throws Exception { 1660 expressionTest(); 1661 } 1662 1663 @Test test605()1664 public void test605() throws Exception { 1665 expressionTest(); 1666 } 1667 1668 @Test test606()1669 public void test606() throws Exception { 1670 expressionTest(); 1671 } 1672 1673 @Test test607()1674 public void test607() throws Exception { 1675 expressionTest(); 1676 } 1677 1678 @Test test608()1679 public void test608() throws Exception { 1680 expressionTest(); 1681 } 1682 1683 @Test test609()1684 public void test609() throws Exception { 1685 expressionTest(); 1686 } 1687 1688 @Test test610()1689 public void test610() throws Exception { 1690 expressionTest(); 1691 } 1692 1693 @Test test611()1694 public void test611() throws Exception { 1695 expressionTest(); 1696 } 1697 1698 @Test test612()1699 public void test612() throws Exception { 1700 expressionTest(); 1701 } 1702 1703 @Test test613()1704 public void test613() throws Exception { 1705 expressionTest(); 1706 } 1707 1708 @Test test614()1709 public void test614() throws Exception { 1710 expressionTest(); 1711 } 1712 1713 @Test test615()1714 public void test615() throws Exception { 1715 expressionTest(); 1716 } 1717 1718 @Test test616()1719 public void test616() throws Exception { 1720 expressionTest(); 1721 } 1722 1723 @Test test617()1724 public void test617() throws Exception { 1725 expressionTest(); 1726 } 1727 1728 @Test test618()1729 public void test618() throws Exception { 1730 expressionTest(); 1731 } 1732 1733 @Test test619()1734 public void test619() throws Exception { 1735 expressionTest(); 1736 } 1737 1738 @Test test620()1739 public void test620() throws Exception { 1740 expressionTest(); 1741 } 1742 1743 @Test test621()1744 public void test621() throws Exception { 1745 expressionTest(); 1746 } 1747 1748 @Test test622()1749 public void test622() throws Exception { 1750 expressionTest(); 1751 } 1752 1753 @Test test623()1754 public void test623() throws Exception { 1755 expressionTest(); 1756 } 1757 1758 @Test test624()1759 public void test624() throws Exception { 1760 expressionTest(); 1761 } 1762 1763 @Test test625()1764 public void test625() throws Exception { 1765 expressionTest(); 1766 } 1767 1768 @Test test626()1769 public void test626() throws Exception { 1770 expressionTest(); 1771 } 1772 1773 @Test test627()1774 public void test627() throws Exception { 1775 expressionTest(); 1776 } 1777 1778 @Test test628()1779 public void test628() throws Exception { 1780 expressionTest(); 1781 } 1782 1783 @Test test629()1784 public void test629() throws Exception { 1785 expressionTest(); 1786 } 1787 1788 //---- Test nested methods and constructor 1789 1790 @Test test650()1791 public void test650() throws Exception { 1792 nestedTest(); 1793 } 1794 1795 @Test test651()1796 public void test651() throws Exception { 1797 nestedTest(); 1798 } 1799 1800 @Test test652()1801 public void test652() throws Exception { 1802 nestedTest(); 1803 } 1804 1805 @Test test653()1806 public void test653() throws Exception { 1807 nestedTest(); 1808 } 1809 1810 @Test test654()1811 public void test654() throws Exception { 1812 nestedTest(); 1813 } 1814 1815 //---- Extracting method containing a return statement. 1816 1817 @Test test700()1818 public void test700() throws Exception { 1819 returnTest(); 1820 } 1821 1822 @Test test701()1823 public void test701() throws Exception { 1824 returnTest(); 1825 } 1826 1827 @Test test702()1828 public void test702() throws Exception { 1829 returnTest(); 1830 } 1831 1832 @Test test703()1833 public void test703() throws Exception { 1834 returnTest(); 1835 } 1836 1837 @Test test704()1838 public void test704() throws Exception { 1839 returnTest(); 1840 } 1841 1842 @Test test705()1843 public void test705() throws Exception { 1844 returnTest(); 1845 } 1846 1847 @Test test706()1848 public void test706() throws Exception { 1849 returnTest(); 1850 } 1851 1852 @Test test707()1853 public void test707() throws Exception { 1854 returnTest(); 1855 } 1856 1857 @Test test708()1858 public void test708() throws Exception { 1859 returnTest(); 1860 } 1861 1862 @Test test709()1863 public void test709() throws Exception { 1864 returnTest(); 1865 } 1866 1867 @Test test710()1868 public void test710() throws Exception { 1869 returnTest(); 1870 } 1871 1872 @Test test711()1873 public void test711() throws Exception { 1874 returnTest(); 1875 } 1876 1877 @Test test712()1878 public void test712() throws Exception { 1879 returnTest(); 1880 } 1881 1882 @Test test713()1883 public void test713() throws Exception { 1884 returnTest(); 1885 } 1886 1887 @Test test714()1888 public void test714() throws Exception { 1889 returnTest(); 1890 } 1891 1892 @Test test715()1893 public void test715() throws Exception { 1894 returnTest(); 1895 } 1896 1897 @Test test716()1898 public void test716() throws Exception { 1899 returnTest(); 1900 } 1901 1902 @Test test717()1903 public void test717() throws Exception { 1904 returnTest(); 1905 } 1906 1907 @Test test718()1908 public void test718() throws Exception { 1909 returnTest(); 1910 } 1911 1912 @Test test719()1913 public void test719() throws Exception { 1914 returnTest(); 1915 } 1916 1917 @Test test720()1918 public void test720() throws Exception { 1919 returnTest(); 1920 } 1921 1922 @Test test721()1923 public void test721() throws Exception { 1924 returnTest(); 1925 } 1926 1927 @Test test722()1928 public void test722() throws Exception { 1929 returnTest(); 1930 } 1931 1932 @Test test723()1933 public void test723() throws Exception { 1934 returnTest(); 1935 } 1936 1937 @Test test724()1938 public void test724() throws Exception { 1939 returnTest(); 1940 } 1941 1942 @Test test725()1943 public void test725() throws Exception { 1944 returnTest(); 1945 } 1946 1947 @Test test726()1948 public void test726() throws Exception { 1949 returnTest(); 1950 } 1951 1952 @Test test727()1953 public void test727() throws Exception { 1954 returnTest(); 1955 } 1956 1957 @Test test728()1958 public void test728() throws Exception { 1959 returnTest(); 1960 } 1961 1962 // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=213519 1963 @Test test729()1964 public void test729() throws Exception { 1965 returnTest(); 1966 } 1967 1968 // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=213519 1969 @Test test730()1970 public void test730() throws Exception { 1971 returnTest(); 1972 } 1973 1974 // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=213519 1975 @Test test731()1976 public void test731() throws Exception { 1977 returnTest(); 1978 } 1979 1980 // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=213519 1981 @Test test732()1982 public void test732() throws Exception { 1983 returnTest(); 1984 } 1985 1986 // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=97413 1987 @Test test733()1988 public void test733() throws Exception { 1989 returnTest(); 1990 } 1991 1992 // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=97413 1993 @Test test734()1994 public void test734() throws Exception { 1995 returnTest(); 1996 } 1997 1998 // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=285554 1999 @Test test735()2000 public void test735() throws Exception { 2001 returnTest(); 2002 } 2003 2004 //---- Branch statements 2005 2006 @Test test750()2007 public void test750() throws Exception { 2008 branchTest(); 2009 } 2010 2011 @Test test751()2012 public void test751() throws Exception { 2013 branchTest(); 2014 } 2015 2016 @Test test752()2017 public void test752() throws Exception { 2018 branchTest(); 2019 } 2020 2021 @Test test753()2022 public void test753() throws Exception { 2023 branchTest(); 2024 } 2025 2026 @Test test754()2027 public void test754() throws Exception { 2028 branchTest(); 2029 } 2030 2031 @Test test755()2032 public void test755() throws Exception { 2033 branchTest(); 2034 } 2035 2036 @Test test756()2037 public void test756() throws Exception { 2038 branchTest(); 2039 } 2040 2041 @Test test757()2042 public void test757() throws Exception { 2043 branchTest(); 2044 } 2045 2046 @Test test758()2047 public void test758() throws Exception { 2048 branchTest(); 2049 } 2050 2051 @Test test759()2052 public void test759() throws Exception { 2053 branchTest(); 2054 } 2055 2056 @Test test760()2057 public void test760() throws Exception { 2058 branchTest(); 2059 } 2060 2061 @Test test761()2062 public void test761() throws Exception { 2063 branchTest(); 2064 } 2065 2066 @Test test762()2067 public void test762() throws Exception { 2068 branchTest(); 2069 } 2070 2071 @Test test763()2072 public void test763() throws Exception { 2073 branchTest(); 2074 } 2075 2076 @Test test764()2077 public void test764() throws Exception { 2078 branchTest(); 2079 } 2080 2081 @Test test765()2082 public void test765() throws Exception { 2083 branchTest(); 2084 } 2085 2086 @Test test766()2087 public void test766() throws Exception { 2088 branchTest(); 2089 } 2090 2091 @Test test767()2092 public void test767() throws Exception { 2093 branchTest(); 2094 } 2095 2096 @Test test768()2097 public void test768() throws Exception { 2098 branchTest(); 2099 } 2100 2101 @Test test769()2102 public void test769() throws Exception { 2103 branchTest(); 2104 } 2105 2106 //---- Test for CUs with compiler errors 2107 2108 @Test test800()2109 public void test800() throws Exception { 2110 errorTest(); 2111 } 2112 2113 @Test test801()2114 public void test801() throws Exception { 2115 errorTest(); 2116 } 2117 2118 @Test test802()2119 public void test802() throws Exception { 2120 errorTest(); 2121 } 2122 2123 @Test test803()2124 public void test803() throws Exception { 2125 if (BUG_405778) 2126 return; 2127 errorTest(); 2128 } 2129 2130 @Test test804()2131 public void test804() throws Exception { 2132 errorTest(); 2133 } 2134 2135 //---- Test parameter name changes 2136 invalidParameterNameTest(String[] newNames)2137 private void invalidParameterNameTest(String[] newNames) throws Exception { 2138 performTest(fgTestSetup.getParameterNamePackage(), "A", INVALID_SELECTION, null, newNames, null, 0); 2139 } 2140 parameterNameTest(String[] newNames, int[] newOrder)2141 private void parameterNameTest(String[] newNames, int[] newOrder) throws Exception { 2142 performTest(fgTestSetup.getParameterNamePackage(), "A", COMPARE_WITH_OUTPUT, "parameterName_out", newNames, newOrder, 0); 2143 } 2144 2145 @Test test900()2146 public void test900() throws Exception { 2147 invalidParameterNameTest(new String[] {"y"}); 2148 } 2149 2150 @Test test901()2151 public void test901() throws Exception { 2152 invalidParameterNameTest(new String[] {null, "i"}); 2153 } 2154 2155 @Test test902()2156 public void test902() throws Exception { 2157 invalidParameterNameTest(new String[] {"System"}); 2158 } 2159 2160 @Test test903()2161 public void test903() throws Exception { 2162 parameterNameTest(new String[] {"xxx", "yyyy"}, null); 2163 } 2164 2165 @Test test904()2166 public void test904() throws Exception { 2167 parameterNameTest(new String[] {"xx", "zz"}, new int[] {1, 0}); 2168 } 2169 2170 @Test test905()2171 public void test905() throws Exception { 2172 parameterNameTest(new String[] {"message"}, null); 2173 } 2174 2175 @Test test906()2176 public void test906() throws Exception { 2177 parameterNameTest(new String[] {"xxx"}, null); 2178 } 2179 2180 //---- Test duplicate code snippets ---------------------------------------- 2181 2182 @Test test950()2183 public void test950() throws Exception { 2184 duplicatesTest(); 2185 } 2186 2187 @Test test951()2188 public void test951() throws Exception { 2189 duplicatesTest(); 2190 } 2191 2192 @Test test952()2193 public void test952() throws Exception { 2194 duplicatesTest(); 2195 } 2196 2197 @Test test953()2198 public void test953() throws Exception { 2199 duplicatesTest(); 2200 } 2201 2202 @Test test954()2203 public void test954() throws Exception { 2204 duplicatesTest(); 2205 } 2206 2207 @Test test955()2208 public void test955() throws Exception { 2209 duplicatesTest(); 2210 } 2211 2212 @Test test956()2213 public void test956() throws Exception { 2214 duplicatesTest(); 2215 } 2216 2217 @Test test957()2218 public void test957() throws Exception { 2219 duplicatesTest(); 2220 } 2221 2222 @Test test958()2223 public void test958() throws Exception { 2224 duplicatesTest(); 2225 } 2226 2227 @Test test959()2228 public void test959() throws Exception { 2229 duplicatesTest(); 2230 } 2231 2232 @Test test960()2233 public void test960() throws Exception { 2234 duplicatesTest(); 2235 } 2236 2237 @Test test961()2238 public void test961() throws Exception { 2239 duplicatesTest(); 2240 } 2241 2242 @Test test962()2243 public void test962() throws Exception { 2244 duplicatesTest(); 2245 } 2246 2247 @Test test963()2248 public void test963() throws Exception { 2249 duplicatesTest(); 2250 } 2251 2252 @Test test964()2253 public void test964() throws Exception { 2254 duplicatesTest(); 2255 } 2256 2257 @Test test965()2258 public void test965() throws Exception { 2259 duplicatesTest(); 2260 } 2261 2262 @Test test966()2263 public void test966() throws Exception { 2264 duplicatesTest(); 2265 } 2266 2267 @Test test967()2268 public void test967() throws Exception { 2269 duplicatesTest(); 2270 } 2271 2272 @Test test968()2273 public void test968() throws Exception { 2274 duplicatesTest(); 2275 } 2276 2277 @Test test969()2278 public void test969() throws Exception { 2279 duplicatesTest(); 2280 } 2281 2282 @Test test970()2283 public void test970() throws Exception { 2284 duplicatesTest(); // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=186061 2285 } 2286 2287 @Test test971()2288 public void test971() throws Exception { 2289 performTest(fgTestSetup.getDuplicatesPackage(), "A", COMPARE_WITH_OUTPUT, "duplicates_out", null, null, 1); // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=160853 2290 } 2291 2292 @Test test972()2293 public void test972() throws Exception { 2294 duplicatesTest(); // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=160853 2295 } 2296 2297 @Test test980()2298 public void test980() throws Exception { 2299 duplicatesTest(); // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=264606 2300 } 2301 2302 @Test test981()2303 public void test981() throws Exception { 2304 duplicatesTest(); // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=264606 2305 } 2306 2307 @Test test982()2308 public void test982() throws Exception { 2309 duplicatesTest(); // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=264606 2310 } 2311 2312 @Test test983()2313 public void test983() throws Exception { 2314 duplicatesTest(); // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=264606 2315 } 2316 2317 @Test test984()2318 public void test984() throws Exception { 2319 duplicatesTest(); // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=264606 2320 } 2321 2322 @Test test985()2323 public void test985() throws Exception { 2324 duplicatesTest(); // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=264606 2325 } 2326 2327 @Test test986()2328 public void test986() throws Exception { 2329 duplicatesTest(); // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=264606 2330 } 2331 2332 @Test test987()2333 public void test987() throws Exception { 2334 duplicatesTest(); // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=264606 2335 } 2336 2337 @Test test988()2338 public void test988() throws Exception{ 2339 duplicatesTest(); 2340 } 2341 2342 @Test test989()2343 public void test989() throws Exception{ 2344 duplicatesTest(); 2345 } 2346 2347 @Test test990()2348 public void test990() throws Exception { 2349 duplicatesTest(); 2350 } 2351 2352 @Test test991()2353 public void test991() throws Exception { 2354 duplicatesTest(); 2355 } 2356 2357 @Test test992()2358 public void test992() throws Exception { 2359 duplicatesTest(); 2360 } 2361 2362 //---- Test code in initializers ----------------------------------------------- 2363 2364 @Test test1000()2365 public void test1000() throws Exception { 2366 initializerTest(); 2367 } 2368 2369 @Test test1001()2370 public void test1001() throws Exception { 2371 initializerTest(); 2372 } 2373 2374 @Test test1002()2375 public void test1002() throws Exception { 2376 initializerTest(); 2377 } 2378 2379 @Test test1003()2380 public void test1003() throws Exception { 2381 initializerTest(); 2382 } 2383 2384 //---- Test destination ----------------------------------------------- 2385 2386 @Test test1050()2387 public void test1050() throws Exception { 2388 destinationTest(1); 2389 } 2390 2391 @Test test1051()2392 public void test1051() throws Exception { 2393 destinationTest(1); 2394 } 2395 2396 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=152004 2397 @Test test1052()2398 public void test1052() throws Exception { 2399 destinationTest(1); 2400 } 2401 2402 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=152004 2403 @Test test1053()2404 public void test1053() throws Exception { 2405 destinationTest(1); 2406 } 2407 2408 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=318127 2409 @Test test1054()2410 public void test1054() throws Exception { 2411 destinationTest(1); 2412 } 2413 2414 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=318127 2415 @Test test1055()2416 public void test1055() throws Exception { 2417 destinationTest(2); 2418 } 2419 2420 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=318127 2421 @Test test1056()2422 public void test1056() throws Exception { 2423 destinationTest(2); 2424 } 2425 2426 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=318127 2427 @Test test1057()2428 public void test1057() throws Exception { 2429 destinationTest(1); 2430 } 2431 2432 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=318609 2433 @Test test1058()2434 public void test1058() throws Exception { 2435 destinationTest(2); 2436 } 2437 2438 @Test test1059()2439 public void test1059() throws Exception { 2440 destinationTest(0); 2441 } 2442 2443 @Test test1060()2444 public void test1060() throws Exception { 2445 destinationTest(1); 2446 } 2447 2448 @Test test1061()2449 public void test1061() throws Exception { 2450 destinationTest(1); 2451 } 2452 2453 @Test test1062()2454 public void test1062() throws Exception { 2455 destinationTest(2); 2456 } 2457 2458 //---- Test Generics -------------------------------------------------- 2459 2460 @Test test1100()2461 public void test1100() throws Exception { 2462 genericTest(); 2463 } 2464 2465 @Test test1101()2466 public void test1101() throws Exception { 2467 genericTest(); 2468 } 2469 2470 @Test test1102()2471 public void test1102() throws Exception { 2472 genericTest(); 2473 } 2474 2475 @Test test1103()2476 public void test1103() throws Exception { 2477 genericTest(); 2478 } 2479 2480 @Test test1104()2481 public void test1104() throws Exception { 2482 genericTest(); 2483 } 2484 2485 @Test test1105()2486 public void test1105() throws Exception { 2487 genericTest(); 2488 } 2489 2490 @Test test1106()2491 public void test1106() throws Exception { 2492 genericTest(); 2493 } 2494 2495 @Test test1107()2496 public void test1107() throws Exception { 2497 genericTest(); 2498 } 2499 2500 @Test test1108()2501 public void test1108() throws Exception { 2502 genericTest(); 2503 } 2504 2505 @Test test1109()2506 public void test1109() throws Exception { 2507 genericTest(); 2508 } 2509 2510 @Test test1110()2511 public void test1110() throws Exception { 2512 genericTest(); 2513 } 2514 2515 @Test test1111()2516 public void test1111() throws Exception { 2517 genericTest(); 2518 } 2519 2520 @Test test1112()2521 public void test1112() throws Exception { 2522 genericTest(); 2523 } 2524 2525 @Test test1113()2526 public void test1113() throws Exception { 2527 genericTest(); 2528 } 2529 2530 @Test test1114()2531 public void test1114() throws Exception { 2532 genericTest(); 2533 } 2534 2535 @Test test1115()2536 public void test1115() throws Exception { 2537 genericTest(); 2538 } 2539 2540 @Test test1116()2541 public void test1116() throws Exception { 2542 genericTest(); 2543 } 2544 2545 @Test test1117()2546 public void test1117() throws Exception { 2547 genericTest(); 2548 } 2549 2550 @Test test1118()2551 public void test1118() throws Exception { 2552 genericTest(); 2553 } 2554 2555 @Test test1119()2556 public void test1119() throws Exception { 2557 genericTest(); 2558 } 2559 2560 @Test test1120()2561 public void test1120() throws Exception { 2562 genericTest(); //https://bugs.eclipse.org/bugs/show_bug.cgi?id=369295 2563 } 2564 2565 @Test test1121()2566 public void test1121() throws Exception { 2567 genericTest(); 2568 } 2569 2570 @Test test1122()2571 public void test1122() throws Exception { 2572 genericTest(); 2573 } 2574 2575 //---- Test enums --------------------------------- 2576 2577 @Test test1150()2578 public void test1150() throws Exception { 2579 enumTest(); 2580 } 2581 2582 @Test test1151()2583 public void test1151() throws Exception { 2584 enumTest(); 2585 } 2586 2587 @Test test1152()2588 public void test1152() throws Exception { 2589 enumTest(); 2590 } 2591 2592 //---- Test varargs --------------------------------- 2593 varargsTest()2594 protected void varargsTest() throws Exception { 2595 performTest(fgTestSetup.getVarargsPackage(), "A", COMPARE_WITH_OUTPUT, "varargs_out"); 2596 } 2597 2598 @Test test1200()2599 public void test1200() throws Exception { 2600 varargsTest(); 2601 } 2602 2603 @Test test1201()2604 public void test1201() throws Exception { 2605 varargsTest(); 2606 } 2607 2608 @Test test1202()2609 public void test1202() throws Exception { 2610 varargsTest(); 2611 } 2612 2613 //---- Test field initializer --------------------------------- 2614 fieldInitializerTest()2615 protected void fieldInitializerTest() throws Exception { 2616 performTest(fgTestSetup.getFieldInitializerPackage(), "A", COMPARE_WITH_OUTPUT, "fieldInitializer_out"); 2617 } 2618 2619 @Test test1250()2620 public void test1250() throws Exception { 2621 fieldInitializerTest(); 2622 } 2623 2624 @Test test1251()2625 public void test1251() throws Exception { 2626 fieldInitializerTest(); 2627 } 2628 2629 @Test test1252()2630 public void test1252() throws Exception { 2631 fieldInitializerTest(); 2632 } 2633 2634 //---- Test copied from http://c2.com/cgi/wiki?RefactoringBenchmarksForExtractMethod 2635 2636 @Test test2001()2637 public void test2001() throws Exception { 2638 wikiTest(); 2639 } 2640 2641 @Test test2002()2642 public void test2002() throws Exception { 2643 wikiTest(); 2644 } 2645 2646 @Test test2003()2647 public void test2003() throws Exception { 2648 wikiTest(); 2649 } 2650 2651 @Test test2004()2652 public void test2004() throws Exception { 2653 wikiTest(); 2654 } 2655 2656 @Test test2005()2657 public void test2005() throws Exception { 2658 wikiTest(); 2659 } 2660 } 2661