Lines 9425-9428
Link Here
|
9425 |
"Test<T>[TYPE_REF]{, test, Ltest.Test<TT;>;, null, null, ["+startOffset+", "+endOffset+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9425 |
"Test<T>[TYPE_REF]{, test, Ltest.Test<TT;>;, null, null, ["+startOffset+", "+endOffset+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9426 |
requestor.getResults()); |
9426 |
requestor.getResults()); |
9427 |
} |
9427 |
} |
|
|
9428 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9429 |
public void testFavoriteImports001() throws JavaModelException { |
9430 |
this.workingCopies = new ICompilationUnit[2]; |
9431 |
this.workingCopies[0] = getWorkingCopy( |
9432 |
"/Completion/src3/test/Test.java", |
9433 |
"package test;\n" + |
9434 |
"public class Test {\n" + |
9435 |
" public void method() {\n" + |
9436 |
" foo\n" + |
9437 |
" }\n" + |
9438 |
"}"); |
9439 |
|
9440 |
this.workingCopies[1] = getWorkingCopy( |
9441 |
"/Completion/src3/test/p/ZZZ.java", |
9442 |
"package test.p;\n" + |
9443 |
"public class ZZZ {\n" + |
9444 |
" public static int foo;\n" + |
9445 |
"}"); |
9446 |
|
9447 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9448 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9449 |
|
9450 |
String str = this.workingCopies[0].getSource(); |
9451 |
String completeBehind = "foo"; |
9452 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9453 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9454 |
|
9455 |
assertResults( |
9456 |
"foo[FIELD_REF]{test.p.ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9457 |
requestor.getResults()); |
9458 |
} |
9459 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9460 |
public void testFavoriteImports002() throws JavaModelException { |
9461 |
this.workingCopies = new ICompilationUnit[2]; |
9462 |
this.workingCopies[0] = getWorkingCopy( |
9463 |
"/Completion/src3/test/Test.java", |
9464 |
"package test;\n" + |
9465 |
"public class Test {\n" + |
9466 |
" public void method() {\n" + |
9467 |
" foo\n" + |
9468 |
" }\n" + |
9469 |
"}"); |
9470 |
|
9471 |
this.workingCopies[1] = getWorkingCopy( |
9472 |
"/Completion/src3/test/p/ZZZ.java", |
9473 |
"package test.p;\n" + |
9474 |
"public class ZZZ {\n" + |
9475 |
" public static int foo(){}\n" + |
9476 |
"}"); |
9477 |
|
9478 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9479 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9480 |
|
9481 |
String str = this.workingCopies[0].getSource(); |
9482 |
String completeBehind = "foo"; |
9483 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9484 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9485 |
|
9486 |
assertResults( |
9487 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9488 |
requestor.getResults()); |
9489 |
} |
9490 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9491 |
public void testFavoriteImports003() throws JavaModelException { |
9492 |
this.workingCopies = new ICompilationUnit[2]; |
9493 |
this.workingCopies[0] = getWorkingCopy( |
9494 |
"/Completion/src3/test/Test.java", |
9495 |
"package test;\n" + |
9496 |
"public class Test {\n" + |
9497 |
" public void method() {\n" + |
9498 |
" foo\n" + |
9499 |
" }\n" + |
9500 |
"}"); |
9501 |
|
9502 |
this.workingCopies[1] = getWorkingCopy( |
9503 |
"/Completion/src3/test/p/ZZZ.java", |
9504 |
"package test.p;\n" + |
9505 |
"public class ZZZ {\n" + |
9506 |
" public static int foo;\n" + |
9507 |
"}"); |
9508 |
|
9509 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9510 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ"}); |
9511 |
|
9512 |
String str = this.workingCopies[0].getSource(); |
9513 |
String completeBehind = "foo"; |
9514 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9515 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9516 |
|
9517 |
assertResults( |
9518 |
"", |
9519 |
requestor.getResults()); |
9520 |
} |
9521 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9522 |
public void testFavoriteImports004() throws JavaModelException { |
9523 |
this.workingCopies = new ICompilationUnit[2]; |
9524 |
this.workingCopies[0] = getWorkingCopy( |
9525 |
"/Completion/src3/test/Test.java", |
9526 |
"package test;\n" + |
9527 |
"public class Test {\n" + |
9528 |
" public void method() {\n" + |
9529 |
" foo\n" + |
9530 |
" }\n" + |
9531 |
"}"); |
9532 |
|
9533 |
this.workingCopies[1] = getWorkingCopy( |
9534 |
"/Completion/src3/test/p/ZZZ.java", |
9535 |
"package test.p;\n" + |
9536 |
"public class ZZZ {\n" + |
9537 |
" public static int foo(){}\n" + |
9538 |
"}"); |
9539 |
|
9540 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9541 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ"}); |
9542 |
|
9543 |
String str = this.workingCopies[0].getSource(); |
9544 |
String completeBehind = "foo"; |
9545 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9546 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9547 |
|
9548 |
assertResults( |
9549 |
"", |
9550 |
requestor.getResults()); |
9551 |
} |
9552 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9553 |
public void testFavoriteImports005() throws JavaModelException { |
9554 |
this.workingCopies = new ICompilationUnit[2]; |
9555 |
this.workingCopies[0] = getWorkingCopy( |
9556 |
"/Completion/src3/test/Test.java", |
9557 |
"package test;\n" + |
9558 |
"public class Test {\n" + |
9559 |
" public void method() {\n" + |
9560 |
" foo\n" + |
9561 |
" }\n" + |
9562 |
"}"); |
9563 |
|
9564 |
this.workingCopies[1] = getWorkingCopy( |
9565 |
"/Completion/src3/test/p/ZZZ.java", |
9566 |
"package test.p;\n" + |
9567 |
"public class ZZZ {\n" + |
9568 |
" public static int foo;\n" + |
9569 |
"}"); |
9570 |
|
9571 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9572 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9573 |
|
9574 |
String str = this.workingCopies[0].getSource(); |
9575 |
String completeBehind = "foo"; |
9576 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9577 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9578 |
|
9579 |
assertResults( |
9580 |
"foo[FIELD_REF]{test.p.ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9581 |
requestor.getResults()); |
9582 |
} |
9583 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9584 |
public void testFavoriteImports006() throws JavaModelException { |
9585 |
this.workingCopies = new ICompilationUnit[2]; |
9586 |
this.workingCopies[0] = getWorkingCopy( |
9587 |
"/Completion/src3/test/Test.java", |
9588 |
"package test;\n" + |
9589 |
"public class Test {\n" + |
9590 |
" public void method() {\n" + |
9591 |
" foo\n" + |
9592 |
" }\n" + |
9593 |
"}"); |
9594 |
|
9595 |
this.workingCopies[1] = getWorkingCopy( |
9596 |
"/Completion/src3/test/p/ZZZ.java", |
9597 |
"package test.p;\n" + |
9598 |
"public class ZZZ {\n" + |
9599 |
" public static int foo(){}\n" + |
9600 |
"}"); |
9601 |
|
9602 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9603 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9604 |
|
9605 |
String str = this.workingCopies[0].getSource(); |
9606 |
String completeBehind = "foo"; |
9607 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9608 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9609 |
|
9610 |
assertResults( |
9611 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9612 |
requestor.getResults()); |
9613 |
} |
9614 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9615 |
public void testFavoriteImports007() throws JavaModelException { |
9616 |
this.workingCopies = new ICompilationUnit[2]; |
9617 |
this.workingCopies[0] = getWorkingCopy( |
9618 |
"/Completion/src3/test/Test.java", |
9619 |
"package test;\n" + |
9620 |
"import test.p.ZZZ.*;\n" + |
9621 |
"public class Test {\n" + |
9622 |
" public void method() {\n" + |
9623 |
" foo\n" + |
9624 |
" }\n" + |
9625 |
"}"); |
9626 |
|
9627 |
this.workingCopies[1] = getWorkingCopy( |
9628 |
"/Completion/src3/test/p/ZZZ.java", |
9629 |
"package test.p;\n" + |
9630 |
"public class ZZZ {\n" + |
9631 |
" public static int foo(){}\n" + |
9632 |
"}"); |
9633 |
|
9634 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9635 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9636 |
|
9637 |
String str = this.workingCopies[0].getSource(); |
9638 |
String completeBehind = "foo"; |
9639 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9640 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9641 |
|
9642 |
assertResults( |
9643 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9644 |
requestor.getResults()); |
9645 |
} |
9646 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9647 |
public void testFavoriteImports008() throws JavaModelException { |
9648 |
this.workingCopies = new ICompilationUnit[2]; |
9649 |
this.workingCopies[0] = getWorkingCopy( |
9650 |
"/Completion/src3/test/Test.java", |
9651 |
"package test;\n" + |
9652 |
"import static test.p.ZZZ.*;\n" + |
9653 |
"public class Test {\n" + |
9654 |
" public void method() {\n" + |
9655 |
" foo\n" + |
9656 |
" }\n" + |
9657 |
"}"); |
9658 |
|
9659 |
this.workingCopies[1] = getWorkingCopy( |
9660 |
"/Completion/src3/test/p/ZZZ.java", |
9661 |
"package test.p;\n" + |
9662 |
"public class ZZZ {\n" + |
9663 |
" public static int foo(){}\n" + |
9664 |
"}"); |
9665 |
|
9666 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9667 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9668 |
|
9669 |
String str = this.workingCopies[0].getSource(); |
9670 |
String completeBehind = "foo"; |
9671 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9672 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9673 |
|
9674 |
assertResults( |
9675 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED +R_NON_RESTRICTED)+"}", |
9676 |
requestor.getResults()); |
9677 |
} |
9678 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9679 |
public void testFavoriteImports009() throws JavaModelException { |
9680 |
this.workingCopies = new ICompilationUnit[2]; |
9681 |
this.workingCopies[0] = getWorkingCopy( |
9682 |
"/Completion/src3/test/Test.java", |
9683 |
"package test;\n" + |
9684 |
"import test.p.ZZZ.*;\n" + |
9685 |
"public class Test {\n" + |
9686 |
" public void method() {\n" + |
9687 |
" foo\n" + |
9688 |
" }\n" + |
9689 |
"}"); |
9690 |
|
9691 |
this.workingCopies[1] = getWorkingCopy( |
9692 |
"/Completion/src3/test/p/ZZZ.java", |
9693 |
"package test.p;\n" + |
9694 |
"public class ZZZ {\n" + |
9695 |
" public static int foo(){}\n" + |
9696 |
"}"); |
9697 |
|
9698 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9699 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9700 |
|
9701 |
String str = this.workingCopies[0].getSource(); |
9702 |
String completeBehind = "foo"; |
9703 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9704 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9705 |
|
9706 |
assertResults( |
9707 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9708 |
requestor.getResults()); |
9709 |
} |
9710 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9711 |
public void testFavoriteImports010() throws JavaModelException { |
9712 |
this.workingCopies = new ICompilationUnit[2]; |
9713 |
this.workingCopies[0] = getWorkingCopy( |
9714 |
"/Completion/src3/test/Test.java", |
9715 |
"package test;\n" + |
9716 |
"import static test.p.ZZZ.*;\n" + |
9717 |
"public class Test {\n" + |
9718 |
" public void method() {\n" + |
9719 |
" foo\n" + |
9720 |
" }\n" + |
9721 |
"}"); |
9722 |
|
9723 |
this.workingCopies[1] = getWorkingCopy( |
9724 |
"/Completion/src3/test/p/ZZZ.java", |
9725 |
"package test.p;\n" + |
9726 |
"public class ZZZ {\n" + |
9727 |
" public static int foo(){}\n" + |
9728 |
"}"); |
9729 |
|
9730 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9731 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9732 |
|
9733 |
String str = this.workingCopies[0].getSource(); |
9734 |
String completeBehind = "foo"; |
9735 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9736 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9737 |
|
9738 |
assertResults( |
9739 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9740 |
requestor.getResults()); |
9741 |
} |
9742 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9743 |
public void testFavoriteImports011() throws JavaModelException { |
9744 |
this.workingCopies = new ICompilationUnit[2]; |
9745 |
this.workingCopies[0] = getWorkingCopy( |
9746 |
"/Completion/src3/test/Test.java", |
9747 |
"package test;\n" + |
9748 |
"import test.p.ZZZ.foo;\n" + |
9749 |
"public class Test {\n" + |
9750 |
" public void method() {\n" + |
9751 |
" foo\n" + |
9752 |
" }\n" + |
9753 |
"}"); |
9754 |
|
9755 |
this.workingCopies[1] = getWorkingCopy( |
9756 |
"/Completion/src3/test/p/ZZZ.java", |
9757 |
"package test.p;\n" + |
9758 |
"public class ZZZ {\n" + |
9759 |
" public static int foo(){}\n" + |
9760 |
"}"); |
9761 |
|
9762 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9763 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9764 |
|
9765 |
String str = this.workingCopies[0].getSource(); |
9766 |
String completeBehind = "foo"; |
9767 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9768 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9769 |
|
9770 |
assertResults( |
9771 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9772 |
requestor.getResults()); |
9773 |
} |
9774 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9775 |
public void testFavoriteImports012() throws JavaModelException { |
9776 |
this.workingCopies = new ICompilationUnit[2]; |
9777 |
this.workingCopies[0] = getWorkingCopy( |
9778 |
"/Completion/src3/test/Test.java", |
9779 |
"package test;\n" + |
9780 |
"import static test.p.ZZZ.foo;\n" + |
9781 |
"public class Test {\n" + |
9782 |
" public void method() {\n" + |
9783 |
" foo\n" + |
9784 |
" }\n" + |
9785 |
"}"); |
9786 |
|
9787 |
this.workingCopies[1] = getWorkingCopy( |
9788 |
"/Completion/src3/test/p/ZZZ.java", |
9789 |
"package test.p;\n" + |
9790 |
"public class ZZZ {\n" + |
9791 |
" public static int foo(){}\n" + |
9792 |
"}"); |
9793 |
|
9794 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9795 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9796 |
|
9797 |
String str = this.workingCopies[0].getSource(); |
9798 |
String completeBehind = "foo"; |
9799 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9800 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9801 |
|
9802 |
assertResults( |
9803 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9804 |
requestor.getResults()); |
9805 |
} |
9806 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9807 |
public void testFavoriteImports013() throws JavaModelException { |
9808 |
this.workingCopies = new ICompilationUnit[2]; |
9809 |
this.workingCopies[0] = getWorkingCopy( |
9810 |
"/Completion/src3/test/Test.java", |
9811 |
"package test;\n" + |
9812 |
"import test.p.ZZZ.foo;\n" + |
9813 |
"public class Test {\n" + |
9814 |
" public void method() {\n" + |
9815 |
" foo\n" + |
9816 |
" }\n" + |
9817 |
"}"); |
9818 |
|
9819 |
this.workingCopies[1] = getWorkingCopy( |
9820 |
"/Completion/src3/test/p/ZZZ.java", |
9821 |
"package test.p;\n" + |
9822 |
"public class ZZZ {\n" + |
9823 |
" public static int foo(){}\n" + |
9824 |
"}"); |
9825 |
|
9826 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9827 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9828 |
|
9829 |
String str = this.workingCopies[0].getSource(); |
9830 |
String completeBehind = "foo"; |
9831 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9832 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9833 |
|
9834 |
assertResults( |
9835 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9836 |
requestor.getResults()); |
9837 |
} |
9838 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9839 |
public void testFavoriteImports014() throws JavaModelException { |
9840 |
this.workingCopies = new ICompilationUnit[2]; |
9841 |
this.workingCopies[0] = getWorkingCopy( |
9842 |
"/Completion/src3/test/Test.java", |
9843 |
"package test;\n" + |
9844 |
"import static test.p.ZZZ.foo;\n" + |
9845 |
"public class Test {\n" + |
9846 |
" public void method() {\n" + |
9847 |
" foo\n" + |
9848 |
" }\n" + |
9849 |
"}"); |
9850 |
|
9851 |
this.workingCopies[1] = getWorkingCopy( |
9852 |
"/Completion/src3/test/p/ZZZ.java", |
9853 |
"package test.p;\n" + |
9854 |
"public class ZZZ {\n" + |
9855 |
" public static int foo(){}\n" + |
9856 |
"}"); |
9857 |
|
9858 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9859 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9860 |
|
9861 |
String str = this.workingCopies[0].getSource(); |
9862 |
String completeBehind = "foo"; |
9863 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9864 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9865 |
|
9866 |
assertResults( |
9867 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9868 |
requestor.getResults()); |
9869 |
} |
9870 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9871 |
public void testFavoriteImports015() throws JavaModelException { |
9872 |
this.workingCopies = new ICompilationUnit[3]; |
9873 |
this.workingCopies[0] = getWorkingCopy( |
9874 |
"/Completion/src3/test/Test.java", |
9875 |
"package test;\n" + |
9876 |
"import static test.p.ZZZ.foo;\n" + |
9877 |
"public class Test {\n" + |
9878 |
" public void method() {\n" + |
9879 |
" foo\n" + |
9880 |
" }\n" + |
9881 |
"}"); |
9882 |
|
9883 |
this.workingCopies[1] = getWorkingCopy( |
9884 |
"/Completion/src3/test/p/ZZZ.java", |
9885 |
"package test.p;\n" + |
9886 |
"public class ZZZ {\n" + |
9887 |
" public static int foo(){}\n" + |
9888 |
"}"); |
9889 |
|
9890 |
this.workingCopies[2] = getWorkingCopy( |
9891 |
"/Completion/src3/test/q/ZZZ2.java", |
9892 |
"package test.q;\n" + |
9893 |
"public class ZZZ2 {\n" + |
9894 |
" public static int foo(){}\n" + |
9895 |
"}"); |
9896 |
|
9897 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9898 |
requestor.setFavoriteReferences(new String[]{"test.q.ZZZ2.foo"}); |
9899 |
|
9900 |
String str = this.workingCopies[0].getSource(); |
9901 |
String completeBehind = "foo"; |
9902 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9903 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9904 |
|
9905 |
assertResults( |
9906 |
"foo[METHOD_REF]{test.q.ZZZ2.foo(), Ltest.q.ZZZ2;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" + |
9907 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9908 |
requestor.getResults()); |
9909 |
} |
9910 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9911 |
public void testFavoriteImports016() throws JavaModelException { |
9912 |
this.workingCopies = new ICompilationUnit[2]; |
9913 |
this.workingCopies[0] = getWorkingCopy( |
9914 |
"/Completion/src3/test/Test.java", |
9915 |
"package test;\n" + |
9916 |
"public class Test {\n" + |
9917 |
" public class foo {\n" + |
9918 |
" public void method() {\n" + |
9919 |
" foo\n" + |
9920 |
" }\n" + |
9921 |
" }\n" + |
9922 |
"}"); |
9923 |
|
9924 |
this.workingCopies[1] = getWorkingCopy( |
9925 |
"/Completion/src3/test/p/ZZZ.java", |
9926 |
"package test.p;\n" + |
9927 |
"public class ZZZ {\n" + |
9928 |
" public static int foo(){}\n" + |
9929 |
"}"); |
9930 |
|
9931 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9932 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9933 |
|
9934 |
String str = this.workingCopies[0].getSource(); |
9935 |
String completeBehind = "foo"; |
9936 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9937 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9938 |
|
9939 |
assertResults( |
9940 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" + |
9941 |
"Test.foo[TYPE_REF]{foo, test, Ltest.Test$foo;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9942 |
requestor.getResults()); |
9943 |
} |
9944 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9945 |
public void testFavoriteImports017() throws JavaModelException { |
9946 |
this.workingCopies = new ICompilationUnit[2]; |
9947 |
this.workingCopies[0] = getWorkingCopy( |
9948 |
"/Completion/src3/test/Test.java", |
9949 |
"package test;\n" + |
9950 |
"public class Test {\n" + |
9951 |
" public void foo() {\n" + |
9952 |
" foo\n" + |
9953 |
" }\n" + |
9954 |
"}"); |
9955 |
|
9956 |
this.workingCopies[1] = getWorkingCopy( |
9957 |
"/Completion/src3/test/p/ZZZ.java", |
9958 |
"package test.p;\n" + |
9959 |
"public class ZZZ {\n" + |
9960 |
" public static int foo(){}\n" + |
9961 |
"}"); |
9962 |
|
9963 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9964 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9965 |
|
9966 |
String str = this.workingCopies[0].getSource(); |
9967 |
String completeBehind = "foo"; |
9968 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9969 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9970 |
|
9971 |
assertResults( |
9972 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" + |
9973 |
"foo[METHOD_REF]{foo(), Ltest.Test;, ()V, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9974 |
requestor.getResults()); |
9975 |
} |
9976 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9977 |
public void testFavoriteImports018() throws JavaModelException { |
9978 |
this.workingCopies = new ICompilationUnit[2]; |
9979 |
this.workingCopies[0] = getWorkingCopy( |
9980 |
"/Completion/src3/test/Test.java", |
9981 |
"package test;\n" + |
9982 |
"public class Test {\n" + |
9983 |
" public int foo;\n" + |
9984 |
" public void method() {\n" + |
9985 |
" foo\n" + |
9986 |
" }\n" + |
9987 |
"}"); |
9988 |
|
9989 |
this.workingCopies[1] = getWorkingCopy( |
9990 |
"/Completion/src3/test/p/ZZZ.java", |
9991 |
"package test.p;\n" + |
9992 |
"public class ZZZ {\n" + |
9993 |
" public static int foo(){}\n" + |
9994 |
"}"); |
9995 |
|
9996 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9997 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9998 |
|
9999 |
String str = this.workingCopies[0].getSource(); |
10000 |
String completeBehind = "foo"; |
10001 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10002 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10003 |
|
10004 |
assertResults( |
10005 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" + |
10006 |
"foo[FIELD_REF]{foo, Ltest.Test;, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
10007 |
requestor.getResults()); |
10008 |
} |
10009 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10010 |
public void testFavoriteImports019() throws JavaModelException { |
10011 |
this.workingCopies = new ICompilationUnit[2]; |
10012 |
this.workingCopies[0] = getWorkingCopy( |
10013 |
"/Completion/src3/test/Test.java", |
10014 |
"package test;\n" + |
10015 |
"public class Test {\n" + |
10016 |
" public void method() {\n" + |
10017 |
" int foo = 0;\n" + |
10018 |
" foo\n" + |
10019 |
" }\n" + |
10020 |
"}"); |
10021 |
|
10022 |
this.workingCopies[1] = getWorkingCopy( |
10023 |
"/Completion/src3/test/p/ZZZ.java", |
10024 |
"package test.p;\n" + |
10025 |
"public class ZZZ {\n" + |
10026 |
" public static int foo(){}\n" + |
10027 |
"}"); |
10028 |
|
10029 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
10030 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
10031 |
|
10032 |
String str = this.workingCopies[0].getSource(); |
10033 |
String completeBehind = "foo"; |
10034 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10035 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10036 |
|
10037 |
assertResults( |
10038 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" + |
10039 |
"foo[LOCAL_VARIABLE_REF]{foo, null, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
10040 |
requestor.getResults()); |
10041 |
} |
10042 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10043 |
public void testFavoriteImports020() throws JavaModelException { |
10044 |
this.workingCopies = new ICompilationUnit[2]; |
10045 |
this.workingCopies[0] = getWorkingCopy( |
10046 |
"/Completion/src3/test/Test.java", |
10047 |
"package test;\n" + |
10048 |
"public class Test {\n" + |
10049 |
" public void method() {\n" + |
10050 |
" foo\n" + |
10051 |
" }\n" + |
10052 |
"}"); |
10053 |
|
10054 |
this.workingCopies[1] = getWorkingCopy( |
10055 |
"/Completion/src3/test/p/ZZZ.java", |
10056 |
"package test.p;\n" + |
10057 |
"public class ZZZ {\n" + |
10058 |
" public static int foo(){}\n" + |
10059 |
" public static int foo(int i){}\n" + |
10060 |
"}"); |
10061 |
|
10062 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
10063 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
10064 |
|
10065 |
String str = this.workingCopies[0].getSource(); |
10066 |
String completeBehind = "foo"; |
10067 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10068 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10069 |
|
10070 |
assertResults( |
10071 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" + |
10072 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, (I)I, foo, (i), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
10073 |
requestor.getResults()); |
10074 |
} |
10075 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10076 |
public void testFavoriteImports021() throws JavaModelException { |
10077 |
this.workingCopies = new ICompilationUnit[2]; |
10078 |
this.workingCopies[0] = getWorkingCopy( |
10079 |
"/Completion/src3/test/Test.java", |
10080 |
"package test;\n" + |
10081 |
"public class Test {\n" + |
10082 |
" public void method() {\n" + |
10083 |
" <Object>foo\n" + |
10084 |
" }\n" + |
10085 |
"}"); |
10086 |
|
10087 |
this.workingCopies[1] = getWorkingCopy( |
10088 |
"/Completion/src3/test/p/ZZZ.java", |
10089 |
"package test.p;\n" + |
10090 |
"public class ZZZ {\n" + |
10091 |
" public static <T> int foo(){}\n" + |
10092 |
"}"); |
10093 |
|
10094 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
10095 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
10096 |
|
10097 |
String str = this.workingCopies[0].getSource(); |
10098 |
String completeBehind = "foo"; |
10099 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10100 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10101 |
|
10102 |
assertResults( |
10103 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, <T:Ljava.lang.Object;>()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
10104 |
requestor.getResults()); |
10105 |
} |
10106 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10107 |
public void testFavoriteImports022() throws JavaModelException { |
10108 |
this.workingCopies = new ICompilationUnit[2]; |
10109 |
this.workingCopies[0] = getWorkingCopy( |
10110 |
"/Completion/src3/test/Test.java", |
10111 |
"package test;\n" + |
10112 |
"public class Test {\n" + |
10113 |
" public void method() {\n" + |
10114 |
" foo();\n" + |
10115 |
" }\n" + |
10116 |
"}"); |
10117 |
|
10118 |
this.workingCopies[1] = getWorkingCopy( |
10119 |
"/Completion/src3/test/p/ZZZ.java", |
10120 |
"package test.p;\n" + |
10121 |
"public class ZZZ {\n" + |
10122 |
" public static int foo(){}\n" + |
10123 |
"}"); |
10124 |
|
10125 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
10126 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
10127 |
|
10128 |
String str = this.workingCopies[0].getSource(); |
10129 |
String completeBehind = "foo("; |
10130 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10131 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10132 |
|
10133 |
assertResults( |
10134 |
"", |
10135 |
requestor.getResults()); |
10136 |
} |
9428 |
} |
10137 |
} |