PersistentMap Main Task (MGNLMIGRATION-109)

[MGNLMIGRATION-111] PersistentMap Main Task: Review Test cases Created: 12/Oct/12  Updated: 03/Dec/12  Resolved: 03/Dec/12

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

Generated at Mon Feb 12 10:17:16 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.