public void testEncode(){
  byte[] expectedReturn=binMessagesFixture.chngReqTestValue1;
  changeRequestAttribute=new ChangeRequestAttribute();
  changeRequestAttribute.setChangeIpFlag(MsgFixture.CHANGE_IP_FLAG_1);
  changeRequestAttribute.setChangePortFlag(MsgFixture.CHANGE_PORT_FLAG_1);
  byte[] actualReturn=changeRequestAttribute.encode();
  assertTrue("Object did not encode properly.",Arrays.equals(expectedReturn,actualReturn));
  expectedReturn=binMessagesFixture.chngReqTestValue2;
  changeRequestAttribute=new ChangeRequestAttribute();
  changeRequestAttribute.setChangeIpFlag(MsgFixture.CHANGE_IP_FLAG_2);
  changeRequestAttribute.setChangePortFlag(MsgFixture.CHANGE_PORT_FLAG_2);
  actualReturn=changeRequestAttribute.encode();
  assertTrue("Object did not encode properly.",Arrays.equals(expectedReturn,actualReturn));
}

public void testEncode ( ) { byte [ ] expectedReturn = binMessagesFixture . chngReqTestValue1 ; changeRequestAttribute = new ChangeRequestAttribute ( ) ; changeRequestAttribute . setChangeIpFlag ( MsgFixture . CHANGE_IP_FLAG_1 ) ; changeRequestAttribute . setChangePortFlag ( MsgFixture . CHANGE_PORT_FLAG_1 ) ; byte [ ] actualReturn = changeRequestAttribute . encode ( ) ; assertTrue ( "Object did not encode properly." , Arrays . equals ( expectedReturn , actualReturn ) ) ; expectedReturn = binMessagesFixture . chngReqTestValue2 ; changeRequestAttribute = new ChangeRequestAttribute ( ) ; changeRequestAttribute . setChangeIpFlag ( MsgFixture . CHANGE_IP_FLAG_2 ) ; changeRequestAttribute . setChangePortFlag ( MsgFixture . CHANGE_PORT_FLAG_2 ) ; actualReturn = changeRequestAttribute . encode ( ) ; assertTrue ( "Object did not encode properly." , Arrays . equals ( expectedReturn , actualReturn ) ) ; }
create sample objects and test whether they encode properly .
