PersistentMap Main Task
(MGNLMIGRATION-109)
|
|
| Status: | Closed |
| Project: | Migration 4.4 to 4.5 (closed) |
| Component/s: | None |
| Affects Version/s: | 1.2 |
| Fix Version/s: | 1.2 |
| Type: | Sub-task | Priority: | Neutral |
| Reporter: | Eric Hechinger | Assignee: | Jozef Chocholacek |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Date of First Response: |
| Description |
|
Review the current test class and make them working again. |
| Comments |
| Comment by Jan Haderka [ 03/Dec/12 ] |
+ try {
+ customMap.put(key, value); // the UnsupportedOperationException must be thrown here
+ } catch (UnsupportedOperationException ex) {
+ exceptionThrown = true;
+ }
+ assertTrue("The UnsupportedOperationException has not been thrown when put() method was called on a custom map.",
+ exceptionThrown);
When you are not checking details of the exception, it's enough to just add fail() call after the call that you expect to throw exception like: + try {
+ customMap.put(key, value); // the UnsupportedOperationException must be thrown here
+ fail("Exception should have been thrown on put()");
+ } catch (UnsupportedOperationException ex) {
+ exceptionThrown = true;
+ }
and even better is to not catch exception at all, but use annotation to tell the test you expect UOE to be thrown. |
| Comment by Jozef Chocholacek [ 03/Dec/12 ] |
|
fixed |