Lines 4574-4580
Link Here
|
4574 |
assertEquals("Invalid number of working copies kept between tests!", 5, workingCopies.length); |
4574 |
assertEquals("Invalid number of working copies kept between tests!", 5, workingCopies.length); |
4575 |
search("AxXA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); |
4575 |
search("AxXA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH); |
4576 |
this.discard = false; |
4576 |
this.discard = false; |
4577 |
assertSearchResults(""); |
4577 |
assertSearchResults( |
|
|
4578 |
"src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" + |
4579 |
"src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH" |
4580 |
); |
4578 |
} |
4581 |
} |
4579 |
|
4582 |
|
4580 |
public void testBug110060_AllTypeNames01() throws CoreException { |
4583 |
public void testBug110060_AllTypeNames01() throws CoreException { |
Lines 4755-4761
Link Here
|
4755 |
this.discard = false; |
4758 |
this.discard = false; |
4756 |
assertSearchResults( |
4759 |
assertSearchResults( |
4757 |
"Unexpected all type names", |
4760 |
"Unexpected all type names", |
4758 |
"", |
4761 |
"b110060.AA\n" + |
|
|
4762 |
"b110060.AAxx", |
4759 |
requestor); |
4763 |
requestor); |
4760 |
} |
4764 |
} |
4761 |
|
4765 |
|
Lines 5994-6000
Link Here
|
5994 |
); |
5998 |
); |
5995 |
} |
5999 |
} |
5996 |
|
6000 |
|
5997 |
|
|
|
5998 |
/** |
6001 |
/** |
5999 |
* To get these tests search matches in a workspace, do NOT forget to modify files |
6002 |
* To get these tests search matches in a workspace, do NOT forget to modify files |
6000 |
* to set them as working copies. |
6003 |
* to set them as working copies. |
Lines 6036-6041
Link Here
|
6036 |
search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); |
6039 |
search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH); |
6037 |
this.discard = false; |
6040 |
this.discard = false; |
6038 |
assertSearchResults( |
6041 |
assertSearchResults( |
|
|
6042 |
"src/b130390/Npe.java b130390.Npe [Npe] EXACT_MATCH\n" + |
6039 |
"src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" |
6043 |
"src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH" |
6040 |
); |
6044 |
); |
6041 |
} |
6045 |
} |
Lines 6094-6097
Link Here
|
6094 |
"src/b130390/TimeZone.java b130390.TimeZone [TimeZone] EXACT_MATCH" |
6098 |
"src/b130390/TimeZone.java b130390.TimeZone [TimeZone] EXACT_MATCH" |
6095 |
); |
6099 |
); |
6096 |
} |
6100 |
} |
|
|
6101 |
/** |
6102 |
* To get these tests search matches in a workspace, do NOT forget to modify files |
6103 |
* to set them as working copies. |
6104 |
* |
6105 |
* @test Bug 137087: Open Type - missing matches when using mixed case pattern |
6106 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=137087" |
6107 |
*/ |
6108 |
public void testBug137087() throws CoreException { |
6109 |
// Search CamelCase |
6110 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6111 |
String pattern = "runtimeEx"; |
6112 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6113 |
assertSearchResults( |
6114 |
""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" |
6115 |
); |
6116 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6117 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6118 |
if (validatedRule != matchRule) { |
6119 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6120 |
} |
6121 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6122 |
assertSearchResults( |
6123 |
""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH\n" + |
6124 |
""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" |
6125 |
); |
6126 |
} |
6127 |
public void testBug137087b() throws CoreException { |
6128 |
// Search CamelCase |
6129 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6130 |
String pattern = "Runtimeex"; |
6131 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6132 |
assertSearchResults( |
6133 |
""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" |
6134 |
); |
6135 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6136 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6137 |
if (validatedRule != matchRule) { |
6138 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6139 |
} |
6140 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6141 |
assertSearchResults( |
6142 |
""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH\n" + |
6143 |
""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" |
6144 |
); |
6145 |
} |
6146 |
public void testBug137087c() throws CoreException { |
6147 |
// Search CamelCase |
6148 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6149 |
String pattern = "runtimeexception"; |
6150 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6151 |
assertSearchResults( |
6152 |
"" // no match expected as this is not a valid camel case |
6153 |
); |
6154 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6155 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6156 |
if (validatedRule != matchRule) { |
6157 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6158 |
} |
6159 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6160 |
assertSearchResults( |
6161 |
""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH" |
6162 |
); |
6163 |
} |
6164 |
public void testBug137087d() throws CoreException { |
6165 |
// Search CamelCase |
6166 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6167 |
String pattern = "Runtimexception"; |
6168 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6169 |
assertSearchResults( |
6170 |
"" // no match expected as pattern is missing a 'e' |
6171 |
); |
6172 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6173 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6174 |
if (validatedRule != matchRule) { |
6175 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6176 |
} |
6177 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6178 |
assertSearchResults( |
6179 |
"" // no match expected as pattern is missing a 'e' |
6180 |
); |
6181 |
} |
6182 |
public void testBug137087e() throws CoreException { |
6183 |
// Search CamelCase |
6184 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6185 |
String pattern = "IllegalMSException"; |
6186 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6187 |
assertSearchResults( |
6188 |
""+ getExternalJCLPathString("1.5") + " java.lang.IllegalMonitorStateException EXACT_MATCH" |
6189 |
); |
6190 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6191 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6192 |
if (validatedRule != matchRule) { |
6193 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6194 |
} |
6195 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6196 |
assertSearchResults( |
6197 |
""+ getExternalJCLPathString("1.5") + " java.lang.IllegalMonitorStateException EXACT_MATCH\n" + |
6198 |
""+ getExternalJCLPathString("1.5") + " java.lang.IllegalMonitorStateException EXACT_MATCH" |
6199 |
); |
6200 |
} |
6201 |
public void testBug137087f() throws CoreException { |
6202 |
// Search CamelCase |
6203 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6204 |
String pattern = "illegalMsExceptionSException"; |
6205 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6206 |
assertSearchResults( |
6207 |
"" // expected no result as uppercase characters in pattern do not match any camelcase ones in existing types |
6208 |
); |
6209 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6210 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6211 |
if (validatedRule != matchRule) { |
6212 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6213 |
} |
6214 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6215 |
assertSearchResults( |
6216 |
"" // expected no result as uppercase characters in pattern do not match any camelcase ones in existing types |
6217 |
); |
6218 |
} |
6219 |
public void testBug137087g() throws CoreException { |
6220 |
// Search CamelCase |
6221 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6222 |
String pattern = "clonenotsupportedex"; |
6223 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6224 |
assertSearchResults( |
6225 |
"" // no match expected as this is not a valid camel case |
6226 |
); |
6227 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6228 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6229 |
if (validatedRule != matchRule) { |
6230 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6231 |
} |
6232 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6233 |
assertSearchResults( |
6234 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6235 |
); |
6236 |
} |
6237 |
public void testBug137087h() throws CoreException { |
6238 |
// Search CamelCase |
6239 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6240 |
String pattern = "CloneNotSupportedEx"; |
6241 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6242 |
assertSearchResults( |
6243 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6244 |
); |
6245 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6246 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6247 |
if (validatedRule != matchRule) { |
6248 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6249 |
} |
6250 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6251 |
assertSearchResults( |
6252 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" + |
6253 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6254 |
); |
6255 |
} |
6256 |
public void testBug137087i() throws CoreException { |
6257 |
// Search CamelCase |
6258 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6259 |
String pattern = "cloneNotsupportedEx"; |
6260 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6261 |
assertSearchResults( |
6262 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6263 |
); |
6264 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6265 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6266 |
if (validatedRule != matchRule) { |
6267 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6268 |
} |
6269 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6270 |
assertSearchResults( |
6271 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" + |
6272 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6273 |
); |
6274 |
} |
6275 |
public void testBug137087j() throws CoreException { |
6276 |
// Search CamelCase |
6277 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6278 |
String pattern = "ClonenotSupportedexc"; |
6279 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6280 |
assertSearchResults( |
6281 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6282 |
); |
6283 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6284 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6285 |
if (validatedRule != matchRule) { |
6286 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6287 |
} |
6288 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6289 |
assertSearchResults( |
6290 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" + |
6291 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6292 |
); |
6293 |
} |
6294 |
public void testBug137087k() throws CoreException { |
6295 |
// Search CamelCase |
6296 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6297 |
String pattern = "cloneNotSupportedExcep"; |
6298 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6299 |
assertSearchResults( |
6300 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6301 |
); |
6302 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6303 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6304 |
if (validatedRule != matchRule) { |
6305 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6306 |
} |
6307 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6308 |
assertSearchResults( |
6309 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" + |
6310 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6311 |
); |
6312 |
} |
6313 |
public void testBug137087l() throws CoreException { |
6314 |
// Search CamelCase |
6315 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6316 |
String pattern = "Clonenotsupportedexception"; |
6317 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6318 |
assertSearchResults( |
6319 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6320 |
); |
6321 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6322 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6323 |
if (validatedRule != matchRule) { |
6324 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6325 |
} |
6326 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6327 |
assertSearchResults( |
6328 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" + |
6329 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6330 |
); |
6331 |
} |
6332 |
public void testBug137087m() throws CoreException { |
6333 |
// Search CamelCase |
6334 |
int matchRule = SearchPattern.R_CAMELCASE_MATCH; |
6335 |
String pattern = "CloneNotSupportedException"; |
6336 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6337 |
assertSearchResults( |
6338 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6339 |
); |
6340 |
// Search like UI does (ie. replace it with prefix if it's not a valid CamelCase) |
6341 |
int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule); |
6342 |
if (validatedRule != matchRule) { |
6343 |
matchRule = SearchPattern.R_PREFIX_MATCH; |
6344 |
} |
6345 |
search(pattern, TYPE, DECLARATIONS, matchRule); |
6346 |
assertSearchResults( |
6347 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" + |
6348 |
""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH" |
6349 |
); |
6350 |
} |
6097 |
} |
6351 |
} |