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

ASF GitHub Bot commented on STORM-1610:
---------------------------------------

Github user satishd commented on the pull request:

    https://github.com/apache/storm/pull/1192#issuecomment-193793125
  
    @abhishekagarwal87 @hustfxj 
    I do not think @Before annotation can be used here as it needs to create 
storage for different HBServerMessageType instances in test methods.
    
    You may want to extract methods like below and use it in respective test 
methods.  
    ``` java
    public PaceMakerStateStorage 
createPaceMakerStateStorage(HBServerMessageType messageType) {
      return createPaceMakerStateStorage(createPaceMakerStateStorage, null);
    }
    
    public PaceMakerStateStorage 
createPaceMakerStateStorage(HBServerMessageType messageType, HBMessageData 
messageData) {
      HBMessage response = new HBMessage(messageType, messageData);
      PaceMakerClientProxy clientProxy = new PaceMakerClientProxy(response, 
null);
      PaceMakerStateStorage stateStorage = new 
PaceMakerStateStorage(clientProxy, null);
    ```


> port pacemaker-state-factory-test to java
> -----------------------------------------
>
>                 Key: STORM-1610
>                 URL: https://issues.apache.org/jira/browse/STORM-1610
>             Project: Apache Storm
>          Issue Type: New Feature
>            Reporter: John Fang
>            Assignee: John Fang
>




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

Reply via email to