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

stack commented on HBASE-3896:
------------------------------

bq. Mockito already can just mock those out (eg. ServerManager manager = 
Mockito.mock(ServerManager.class)), so another interface isn't really all that 
necessary.

That is true (I think that it this way in TestAM).

[[email protected]] I think we should close this issue given Jesses' 
reasoning.  This issue was filed in May of 2011 by me when I probably made my 
first attempt at trying to do a standalone AM and failed thinking I needed SM 
and CT to be Interfaces.  Later in the year, I wrote the first 
TestAssignmentManager implementation which stands up an AM w/o its Master 
wrapping using Mockito.  Therein I did the trick Jesse suggests of getting 
around the need of an Interface by doing ServerManager manager = 
Mockito.mock(ServerManager.class)).  I think I should have closed this issue at 
that time having done a workaround (And Jesse makes good argument that making 
Interfaces of SM and CT won't help elsewhere).  What you think?
                
> Make AssignmentManager standalone testable by having its constructor take 
> Interfaces rather than a CatalogTracker and a ServerManager
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-3896
>                 URL: https://issues.apache.org/jira/browse/HBASE-3896
>             Project: HBase
>          Issue Type: Task
>            Reporter: stack
>            Assignee: Cody Marcel
>
> If we could stand up an instance of AssignmentManager, a core fat class that 
> has a bunch of critical logic managing state transitions, then it'd be easier 
> writing unit tests around its logic.  Currently its hard because it takes a 
> ServerManager and a CatalogTracker, but a little bit of work could turn these 
> into Interfaces.  SM looks easy to do.  Changing CT into an Interface instead 
> might ripple a little through the code base but it'd probably be well worth 
> it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to