Lines 1317-1322
Link Here
|
1317 |
} |
1317 |
} |
1318 |
|
1318 |
|
1319 |
/** |
1319 |
/** |
|
|
1320 |
* @bug 186113: [model] classpath variable deprecation messages not initialized when called |
1321 |
* @test Verify that deprecation message can be get through {@link JavaCore#getClasspathVariableDeprecationMessage(String)} |
1322 |
* even if the variable initializer was not called before |
1323 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=186113" |
1324 |
*/ |
1325 |
public void testVariableInitializerBug186113_Initializing() throws CoreException { |
1326 |
assertEquals("Invalid deprecation message!", |
1327 |
JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS_MESSAGE, |
1328 |
JavaCore.getClasspathVariableDeprecationMessage("TEST_DEPRECATED_READ_ONLY") |
1329 |
); |
1330 |
} |
1331 |
public void testVariableInitializerBug186113_Ready() throws CoreException, InterruptedException { |
1332 |
String message = JavaCore.getClasspathVariableDeprecationMessage("TEST_DEPRECATED_READ_ONLY"); |
1333 |
int n = 0; |
1334 |
while (message == JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS_MESSAGE) { |
1335 |
Thread.sleep(100); |
1336 |
if (++n >= 10) { |
1337 |
throw new InterruptedException("TEST_DEPRECATED_READ_ONLY should have been initialized after 1s!!!"); |
1338 |
} |
1339 |
message = JavaCore.getClasspathVariableDeprecationMessage("TEST_DEPRECATED_READ_ONLY"); |
1340 |
} |
1341 |
assertEquals("Invalid deprecation message!", |
1342 |
"A deprecated and read-only initializer", |
1343 |
message |
1344 |
); |
1345 |
} |
1346 |
|
1347 |
/** |
1320 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=61872" |
1348 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=61872" |
1321 |
*/ |
1349 |
*/ |
1322 |
public void testUserLibraryInitializer1() throws CoreException { |
1350 |
public void testUserLibraryInitializer1() throws CoreException { |