[
http://jira.magnolia-cms.com/browse/MGNLMIGRATION-111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jan Haderka reopened MGNLMIGRATION-111:
---------------------------------------
{noformat}
+ 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);
{noformat}
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:
{noformat}
+ try {
+ customMap.put(key, value); // the UnsupportedOperationException
must be thrown here
+ fail("Exception should have been thrown on put()");
+ } catch (UnsupportedOperationException ex) {
+ exceptionThrown = true;
+ }
{noformat}
and even better is to not catch exception at all, but use annotation to tell
the test you expect UOE to be thrown.
> PersistentMap Main Task: Review Test cases
> ------------------------------------------
>
> Key: MGNLMIGRATION-111
> URL: http://jira.magnolia-cms.com/browse/MGNLMIGRATION-111
> Project: Magnolia Migration
> Issue Type: Sub-task
> Affects Versions: 1.2
> Reporter: Eric Hechinger
> Assignee: Jozef Chocholacek
> Fix For: 1.2
>
>
> Review the current test class and make them working again.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------