* Expectation: passes
*/
@Test
public void t30_DeRegisterServerCallTwice() throws Exception {
SCMPRegisterServerCall registerServerCall = new SCMPRegisterServerCall(this.requester, TestConstants.pubServerName1);
TestCallback cbk = new TestCallback();
registerServerCall.setMaxSessions(10);
registerServerCall.setMaxConnections(10);
registerServerCall.setCheckRegistrationIntervalSeconds(0);
registerServerCall.setPortNumber(51000);
registerServerCall.setImmediateConnect(true);
registerServerCall.setKeepAliveIntervalSeconds(360);
registerServerCall.setVersion(SCMPMessage.SC_VERSION.toString());
registerServerCall.setLocalDateTime(DateTimeUtility.getCurrentTimeZoneMillis());
registerServerCall.invoke(cbk, 10000);
TestUtil.checkReply(cbk.getMessageSync(10000));
// first deregister server call
SCMPDeRegisterServerCall deRegisterServerCall = new SCMPDeRegisterServerCall(this.requester, TestConstants.pubServerName1);
cbk = new TestCallback();
deRegisterServerCall.invoke(cbk, 10000);
TestUtil.checkReply(cbk.getMessageSync(10000));
// second deregister server call
cbk = new TestCallback();
deRegisterServerCall.invoke(cbk, 10000);
SCMPMessage reply = cbk.getMessageSync(10000);
Assert.assertTrue(reply.isFault());
Assert.assertEquals(SCMPMsgType.DEREGISTER_SERVER.getValue(), reply.getHeader(SCMPHeaderAttributeKey.MSG_TYPE));
Assert.assertEquals(SCMPError.SERVER_NOT_FOUND.getErrorCode(), reply.getHeaderInt(SCMPHeaderAttributeKey.SC_ERROR_CODE)
.intValue());
}