Lines 15484-15489
Link Here
|
15484 |
} |
15484 |
} |
15485 |
} |
15485 |
} |
15486 |
} |
15486 |
} |
|
|
15487 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=262932 |
15488 |
public void testConstructor1() throws JavaModelException { |
15489 |
this.workingCopies = new ICompilationUnit[2]; |
15490 |
this.workingCopies[0] = getWorkingCopy( |
15491 |
"/Completion/src/test/Test.java", |
15492 |
"package test;"+ |
15493 |
"public class Test {\n" + |
15494 |
" public void foo() {\n" + |
15495 |
" TestConstructor1[] var = new TestConstructor\n" + |
15496 |
" }\n" + |
15497 |
"}"); |
15498 |
this.workingCopies[1] = getWorkingCopy( |
15499 |
"/Completion/src/test/TestConstructor1.java", |
15500 |
"package test;"+ |
15501 |
"public class TestConstructor1 {\n" + |
15502 |
" public TestConstructor1(int i) {\n" + |
15503 |
" }\n" + |
15504 |
"}"); |
15505 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
15506 |
requestor.allowAllRequiredProposals(); |
15507 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
15508 |
String str = this.workingCopies[0].getSource(); |
15509 |
String completeBehind = "TestConstructor"; |
15510 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
15511 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
15512 |
|
15513 |
assertResults( |
15514 |
"TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
15515 |
"TestConstructor1[CONSTRUCTOR_INVOCATION]{(), Ltest.TestConstructor1;, (I)V, TestConstructor1, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
15516 |
" TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
15517 |
requestor.getResults()); |
15518 |
} |
15519 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=262932 |
15520 |
public void testConstructor2() throws JavaModelException { |
15521 |
this.workingCopies = new ICompilationUnit[2]; |
15522 |
this.workingCopies[0] = getWorkingCopy( |
15523 |
"/Completion/src/test/Test.java", |
15524 |
"package test;"+ |
15525 |
"public class Test {\n" + |
15526 |
" public void foo(TestConstructor1[] var) {\n" + |
15527 |
" foo(new TestConstructor\n" + |
15528 |
" }\n" + |
15529 |
"}"); |
15530 |
this.workingCopies[1] = getWorkingCopy( |
15531 |
"/Completion/src/test/TestConstructor1.java", |
15532 |
"package test;"+ |
15533 |
"public class TestConstructor1 {\n" + |
15534 |
" public TestConstructor1(int i) {\n" + |
15535 |
" }\n" + |
15536 |
"}"); |
15537 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
15538 |
requestor.allowAllRequiredProposals(); |
15539 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
15540 |
String str = this.workingCopies[0].getSource(); |
15541 |
String completeBehind = "TestConstructor"; |
15542 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
15543 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
15544 |
|
15545 |
assertResults( |
15546 |
"TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
15547 |
"TestConstructor1[CONSTRUCTOR_INVOCATION]{(), Ltest.TestConstructor1;, (I)V, TestConstructor1, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
15548 |
" TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
15549 |
requestor.getResults()); |
15550 |
} |
15551 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=262932 |
15552 |
public void testConstructor3() throws JavaModelException { |
15553 |
this.workingCopies = new ICompilationUnit[2]; |
15554 |
this.workingCopies[0] = getWorkingCopy( |
15555 |
"/Completion/src/test/Test.java", |
15556 |
"package test;"+ |
15557 |
"public class Test {\n" + |
15558 |
" public TestConstructor1[] foo() {\n" + |
15559 |
" return new TestConstructor\n" + |
15560 |
" }\n" + |
15561 |
"}"); |
15562 |
this.workingCopies[1] = getWorkingCopy( |
15563 |
"/Completion/src/test/TestConstructor1.java", |
15564 |
"package test;"+ |
15565 |
"public class TestConstructor1 {\n" + |
15566 |
" public TestConstructor1(int i) {\n" + |
15567 |
" }\n" + |
15568 |
"}"); |
15569 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
15570 |
requestor.allowAllRequiredProposals(); |
15571 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
15572 |
String str = this.workingCopies[0].getSource(); |
15573 |
String completeBehind = "TestConstructor"; |
15574 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
15575 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
15576 |
|
15577 |
assertResults( |
15578 |
"TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
15579 |
"TestConstructor1[CONSTRUCTOR_INVOCATION]{(), Ltest.TestConstructor1;, (I)V, TestConstructor1, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
15580 |
" TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
15581 |
requestor.getResults()); |
15582 |
} |
15583 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=262932 |
15584 |
public void testConstructor4() throws JavaModelException { |
15585 |
this.workingCopies = new ICompilationUnit[2]; |
15586 |
this.workingCopies[0] = getWorkingCopy( |
15587 |
"/Completion/src/test/Test.java", |
15588 |
"package test;"+ |
15589 |
"public class Test {\n" + |
15590 |
" public Test(TestConstructor1[] var) {}\n" + |
15591 |
" public void foo() {\n" + |
15592 |
" new Test(new TestConstructor\n" + |
15593 |
" }\n" + |
15594 |
"}"); |
15595 |
this.workingCopies[1] = getWorkingCopy( |
15596 |
"/Completion/src/test/TestConstructor1.java", |
15597 |
"package test;"+ |
15598 |
"public class TestConstructor1 {\n" + |
15599 |
" public TestConstructor1(int i) {\n" + |
15600 |
" }\n" + |
15601 |
"}"); |
15602 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
15603 |
requestor.allowAllRequiredProposals(); |
15604 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
15605 |
String str = this.workingCopies[0].getSource(); |
15606 |
String completeBehind = "TestConstructor"; |
15607 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
15608 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
15609 |
|
15610 |
assertResults( |
15611 |
"TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
15612 |
"TestConstructor1[CONSTRUCTOR_INVOCATION]{(), Ltest.TestConstructor1;, (I)V, TestConstructor1, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
15613 |
" TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
15614 |
requestor.getResults()); |
15615 |
} |
15616 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=262932 |
15617 |
public void testConstructor5() throws JavaModelException { |
15618 |
this.workingCopies = new ICompilationUnit[2]; |
15619 |
this.workingCopies[0] = getWorkingCopy( |
15620 |
"/Completion/src/test/Test.java", |
15621 |
"package test;"+ |
15622 |
"public class Test {\n" + |
15623 |
" public void foo(TestConstructor1[] var) {\n" + |
15624 |
" if (var == new TestConstructor) {}\n" + |
15625 |
" }\n" + |
15626 |
"}"); |
15627 |
this.workingCopies[1] = getWorkingCopy( |
15628 |
"/Completion/src/test/TestConstructor1.java", |
15629 |
"package test;"+ |
15630 |
"public class TestConstructor1 {\n" + |
15631 |
" public TestConstructor1(int i) {\n" + |
15632 |
" }\n" + |
15633 |
"}"); |
15634 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
15635 |
requestor.allowAllRequiredProposals(); |
15636 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
15637 |
String str = this.workingCopies[0].getSource(); |
15638 |
String completeBehind = "TestConstructor"; |
15639 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
15640 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
15641 |
|
15642 |
assertResults( |
15643 |
"TestConstructor1[CONSTRUCTOR_INVOCATION]{(), Ltest.TestConstructor1;, (I)V, TestConstructor1, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
15644 |
" TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
15645 |
requestor.getResults()); |
15646 |
} |
15647 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=262932 |
15648 |
public void testConstructor6() throws JavaModelException { |
15649 |
this.workingCopies = new ICompilationUnit[2]; |
15650 |
this.workingCopies[0] = getWorkingCopy( |
15651 |
"/Completion/src/test/Test.java", |
15652 |
"package test;"+ |
15653 |
"public class Test {\n" + |
15654 |
" public void foo(Object o) {\n" + |
15655 |
" o = (TestConstructor1[])new TestConstructor\n" + |
15656 |
" }\n" + |
15657 |
"}"); |
15658 |
this.workingCopies[1] = getWorkingCopy( |
15659 |
"/Completion/src/test/TestConstructor1.java", |
15660 |
"package test;"+ |
15661 |
"public class TestConstructor1 {\n" + |
15662 |
" public TestConstructor1(int i) {\n" + |
15663 |
" }\n" + |
15664 |
"}"); |
15665 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
15666 |
requestor.allowAllRequiredProposals(); |
15667 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
15668 |
String str = this.workingCopies[0].getSource(); |
15669 |
String completeBehind = "TestConstructor"; |
15670 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
15671 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
15672 |
|
15673 |
assertResults( |
15674 |
"TestConstructor1[CONSTRUCTOR_INVOCATION]{(), Ltest.TestConstructor1;, (I)V, TestConstructor1, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
15675 |
" TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
15676 |
requestor.getResults()); |
15677 |
} |
15487 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296 |
15678 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296 |
15488 |
public void testDeprecationCheck1() throws JavaModelException { |
15679 |
public void testDeprecationCheck1() throws JavaModelException { |
15489 |
Hashtable options = JavaCore.getOptions(); |
15680 |
Hashtable options = JavaCore.getOptions(); |