281 // JSR-Plugin-Test-Exception exists. |
281 // JSR-Plugin-Test-Exception exists. |
282 assertTrue("Test plugin did not throw exception like should have.", false); |
282 assertTrue("Test plugin did not throw exception like should have.", false); |
283 } |
283 } |
284 catch (InstallerException e) |
284 catch (InstallerException e) |
285 { |
285 { |
286 // OK, installation is cancelled ok |
286 // OK, expected exception |
|
287 } |
|
288 catch (Throwable t) |
|
289 { |
|
290 t.printStackTrace(); |
|
291 assertTrue("Test plugin threw unexpected exception: " + t, false); |
|
292 } |
|
293 |
|
294 att = new Attribute("JSR-Plugin-Test-Exception", "InstallerExtensionException"); |
|
295 iInstallerExtensionInfo.iAttributes.put("JSR-Plugin-Test-Exception", att); |
|
296 |
|
297 try |
|
298 { |
|
299 notif.notifyInstallation(iInstallerExtensionInfo); |
|
300 // Test plugin TestPlugin2 throws exception if JAD/JAR attribute |
|
301 // JSR-Plugin-Test-Exception2 exists. |
|
302 assertTrue("Test plugin did not throw exception like should have.", false); |
|
303 } |
|
304 catch (InstallerExtensionException iee) |
|
305 { |
|
306 // OK, expected exception |
|
307 } |
|
308 catch (Throwable t) |
|
309 { |
|
310 t.printStackTrace(); |
|
311 assertTrue("Test plugin threw unexpected exception: " + t, false); |
287 } |
312 } |
288 } |
313 } |
289 |
314 |
290 public void testNoPluginsToNotify() |
315 public void testNoPluginsToNotify() |
291 { |
316 { |
369 // JSR-Plugin-Test-Exception exists. |
394 // JSR-Plugin-Test-Exception exists. |
370 assertTrue("Test plugin did not throw exception like it should have.", false); |
395 assertTrue("Test plugin did not throw exception like it should have.", false); |
371 } |
396 } |
372 catch (InstallerException e) |
397 catch (InstallerException e) |
373 { |
398 { |
374 // OK, uninstallation is cancelled ok |
399 // OK, expected exception |
375 } |
400 } |
|
401 catch (Throwable t) |
|
402 { |
|
403 t.printStackTrace(); |
|
404 assertTrue("Test plugin threw unexpected exception: " + t, false); |
|
405 } |
|
406 |
|
407 att = new Attribute("JSR-Plugin-Test-Exception", "InstallerExtensionException"); |
|
408 iInstallerExtensionInfo.iAttributes.put("JSR-Plugin-Test-Exception", att); |
|
409 |
|
410 try |
|
411 { |
|
412 notif.notifyUninstallation(iInstallerExtensionInfo); |
|
413 // Test plugin TestPlugin2 throws exception if JAD/JAR attribute |
|
414 // JSR-Plugin-Test-Exception exists. |
|
415 assertTrue("Test plugin did not throw exception like it should have.", false); |
|
416 } |
|
417 catch (InstallerExtensionException iee) |
|
418 { |
|
419 // OK, expected exception |
|
420 } |
|
421 catch (Throwable t) |
|
422 { |
|
423 t.printStackTrace(); |
|
424 assertTrue("Test plugin threw unexpected exception: " + t, false); |
|
425 } |
|
426 |
376 } |
427 } |
377 |
428 |
378 public void testPluginCancelsUninstallation() |
429 public void testPluginCancelsUninstallation() |
379 { |
430 { |
380 JsrPluginNotifier notif = new JsrPluginNotifier(iIntegrityService); |
431 JsrPluginNotifier notif = new JsrPluginNotifier(iIntegrityService); |