[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-364) Make Hibernate Search fully mockable

Emmanuel Bernard (JIRA) noreply at atlassian.com
Fri Jul 3 09:52:15 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33521#action_33521 ] 

Emmanuel Bernard commented on HSEARCH-364:
------------------------------------------

Thinking this through
We could create two interfaces

interface FullTextService {
    FullTextSession getFullTextSession(Session session);
}

interface FullTextService {
    FullTextEntityManager getFullEntityManager(EntityManager em);
}

with the default impl being

class DefaultFullTextService {
    FullTextSession getFullTextSession(Session session) {
        return Search.getFullTextSession(session);
    }
}

and someone could write an impl to mock the generation of FTSession or FTEM.

But that looks quite simple, should we really add that to Hibernate Search? Esp with JSR-299 and the like, providing a FullTextSession injection is trivial.

> Make Hibernate Search fully mockable
> ------------------------------------
>
>                 Key: HSEARCH-364
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-364
>             Project: Hibernate Search
>          Issue Type: Improvement
>            Reporter: Emmanuel Bernard
>             Fix For: 3.2.0
>
>
> Today Search.getFullTextEntityManager(em) is a static ref that cannot be mocked/

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list