Lines 1016-1019
Link Here
|
1016 |
this.deleteProject("PS2"); |
1016 |
this.deleteProject("PS2"); |
1017 |
} |
1017 |
} |
1018 |
} |
1018 |
} |
|
|
1019 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=249027 |
1020 |
public void testBug249027a() throws Exception { |
1021 |
try { |
1022 |
// create P1 |
1023 |
this.createJavaProject( |
1024 |
"P1", |
1025 |
new String[]{"src"}, |
1026 |
new String[]{}, |
1027 |
"bin"); |
1028 |
|
1029 |
this.createFolder("/P1/src/p1"); |
1030 |
this.createFile( |
1031 |
"/P1/src/p1/C1.java", |
1032 |
"package p1;\n"+ |
1033 |
"public class C1 {\n" + |
1034 |
"}"); |
1035 |
|
1036 |
this.createFolder("/P1/src/p1/C1"); |
1037 |
this.createFile( |
1038 |
"/P1/src/p1/C1/C2.java", |
1039 |
"package p1.C1;\n"+ |
1040 |
"public class C2 {\n" + |
1041 |
" C1 f;\n" + |
1042 |
"}"); |
1043 |
|
1044 |
waitUntilIndexesReady(); |
1045 |
|
1046 |
// do code select |
1047 |
ICompilationUnit cu= getCompilationUnit("P1", "src", "p1.C1", "C2.java"); |
1048 |
|
1049 |
String str = cu.getSource(); |
1050 |
|
1051 |
String selection = "C1"; |
1052 |
int start = str.lastIndexOf(selection); |
1053 |
int length = selection.length(); |
1054 |
IJavaElement[] elements = cu.codeSelect(start, length); |
1055 |
|
1056 |
assertElementsEqual( |
1057 |
"Unexpected elements", |
1058 |
"C1 [in C1.java [in p1 [in src [in P1]]]]", |
1059 |
elements |
1060 |
); |
1061 |
} finally { |
1062 |
this.deleteProject("P1"); |
1063 |
} |
1064 |
} |
1065 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=249027 |
1066 |
public void testBug249027b() throws Exception { |
1067 |
try { |
1068 |
// create P1 |
1069 |
this.createJavaProject( |
1070 |
"P1", |
1071 |
new String[]{"src"}, |
1072 |
new String[]{}, |
1073 |
"bin"); |
1074 |
|
1075 |
this.createFolder("/P1/src/p1"); |
1076 |
this.createFile( |
1077 |
"/P1/src/p1/C1.java", |
1078 |
"package p1;\n"+ |
1079 |
"public class C1 {\n" + |
1080 |
"}"); |
1081 |
|
1082 |
this.createFolder("/P1/src/p2"); |
1083 |
this.createFile( |
1084 |
"/P1/src/p2/C2.java", |
1085 |
"package p3;\n"+ |
1086 |
"public class C2 {\n" + |
1087 |
" C1 f;\n" + |
1088 |
"}"); |
1089 |
|
1090 |
waitUntilIndexesReady(); |
1091 |
|
1092 |
// do code select |
1093 |
ICompilationUnit cu= getCompilationUnit("P1", "src", "p2", "C2.java"); |
1094 |
|
1095 |
String str = cu.getSource(); |
1096 |
|
1097 |
String selection = "C1"; |
1098 |
int start = str.lastIndexOf(selection); |
1099 |
int length = selection.length(); |
1100 |
IJavaElement[] elements = cu.codeSelect(start, length); |
1101 |
|
1102 |
assertElementsEqual( |
1103 |
"Unexpected elements", |
1104 |
"C1 [in C1.java [in p1 [in src [in P1]]]]", |
1105 |
elements |
1106 |
); |
1107 |
} finally { |
1108 |
this.deleteProject("P1"); |
1109 |
} |
1110 |
} |
1019 |
} |
1111 |
} |