[jira] [Commented] (OFBIZ-6218) Unit tests throw exception in DBCP

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-6218) Unit tests throw exception in DBCP

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-6218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14489693#comment-14489693 ]

Nicolas Malin commented on OFBIZ-6218:
--------------------------------------

:) I blame these test myself !

{quote}
Right now my gut feeling is that this is not a problem in DBCP, but in our code.
{quote}
I know that, and it's THE problem because I don't understand where is the beast to kill.

To simplify the code reading,  I create a private function
{code}
    private List<GenericValue> getCompleteList(Map<String, Object> context) {
        EntityListIterator listIt = (EntityListIterator) context.get("listIt");
        List<GenericValue> foundElements = new LinkedList<GenericValue>();
        if (listIt != null) {
            try {
                foundElements = listIt.getCompleteList();
            } catch (GenericEntityException e) {
                Debug.logError(" Failed to extract values from EntityListIterator after a performFind service", module);
            } finally {
                try {
                    listIt.close();
                } catch (GenericEntityException e) {
                    Debug.logError(" Failed to close EntityListIterator after a performFind service", module);
                }
            }
        }
        return foundElements;
    }
{code}

It's the only location where I use an EntityListIterator in performFind tests

> Unit tests throw exception in DBCP
> ----------------------------------
>
>                 Key: OFBIZ-6218
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6218
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Adrian Crum
>
> Details in comments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)