[ 
https://issues.apache.org/jira/browse/JDO-582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630431#action_12630431
 ] 

Craig Russell commented on JDO-582:
-----------------------------------

In the JDOHelperConfigTest, I don't think you're testing the error condition. 
What JDOHelper is doing is iterating over the services entries and finding 
classes to load. So there is a need for Negative09/09a/META-INF/services that 
contains a bad class and another Negative09/09b/META-INF/services that contains 
another bad class.

I'd suggest using two of the bad classes from JDOHelperTest (except that these 
are private). I've checked in a patch to JDOHelperTest that makes the inner 
classes public so they can be referenced outside the test class. 

Then the services/javax.jdo.PersistenceManagerHelper files can have one-liners: 
javax.jdo.JDOHelper$BadPMFNoGetPMFMethod and 
javax.jdo.JDOHelper$BadPMFNonStaticGetPMFMethod. 

And the test should test that the nestedThrowable array contains two elements.

> Test case needed for JDOFatalUserException nested exception argument needs 
> cast to Throwable[]
> ----------------------------------------------------------------------------------------------
>
>                 Key: JDO-582
>                 URL: https://issues.apache.org/jira/browse/JDO-582
>             Project: JDO
>          Issue Type: Bug
>          Components: api2, api2-legacy
>            Reporter: Erik Bengtson
>            Assignee: Richard Schilling
>             Fix For: JDO 2 maintenance release 2
>
>         Attachments: 20080710-jdo-582.diff, 20080710-jdo-582.diff, 
> 20080911-jdo-582-JDOHelper.patch, 20080911-jdo-582-JDOHelperConfigTest.patch, 
> 20080911-jdo-582-Negative09.patch, 20080911-jdo-582.patch, 
> 20080911-jdo-582.patch, estedExceptionJDOHelper.patch, Negative09.zip
>
>
> After collecting exceptions from invoking getPersistenceManagerFactory on all 
> implementations, if no implementation has succeeded in returning a 
> PersistenceManagerFactory, an exception is thrown, and the argument should be 
> a Throwable[]. Otherwise, it's treated as a failed object instead of nested 
> exceptions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to