Lines 2609-2612
Link Here
|
2609 |
elements |
2609 |
elements |
2610 |
); |
2610 |
); |
2611 |
} |
2611 |
} |
|
|
2612 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=299384 |
2613 |
public void testCodeSelectInHybrid1415Projects() throws CoreException, IOException { |
2614 |
String jarName = "bug299384.jar"; |
2615 |
String srcName = "bug299384_src.zip"; |
2616 |
try { |
2617 |
String[] pathAndContents = new String[] { |
2618 |
"TestSuite.java", |
2619 |
"public class TestSuite {\n" + |
2620 |
" public TestSuite(final Class<? extends TestCase> p) {}\n" + |
2621 |
"}\n" + |
2622 |
"class TestCase {}\n" |
2623 |
}; |
2624 |
|
2625 |
addLibrary(jarName, srcName, pathAndContents, JavaCore.VERSION_1_5); |
2626 |
|
2627 |
this.workingCopies = new ICompilationUnit[1]; |
2628 |
this.workingCopies[0] = getWorkingCopy( |
2629 |
"/Resolve/src/Test.java", |
2630 |
"public class TextEditTests extends TestCase {\n" + |
2631 |
" {\n" + |
2632 |
" new TestSuite(TextEditTests.class);\n" + |
2633 |
" }\n" + |
2634 |
"}\n"); |
2635 |
|
2636 |
|
2637 |
String str = this.workingCopies[0].getSource(); |
2638 |
int start = str.lastIndexOf("TestSuite"); |
2639 |
int length = "TestSuite".length(); |
2640 |
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length, this.wcOwner); |
2641 |
|
2642 |
assertElementsEqual( |
2643 |
"Unexpected elements", |
2644 |
"TestSuite(java.lang.Class<? extends TestCase>) [in TestSuite [in TestSuite.class [in <default> [in bug299384.jar [in Resolve]]]]]", |
2645 |
elements |
2646 |
); |
2647 |
} finally { |
2648 |
removeLibrary(this.currentProject, jarName, srcName); |
2649 |
} |
2650 |
} |
2612 |
} |
2651 |
} |