// execute a bind request and wait for a bind response
BaseBindResp bindResponse = session0.bind(bindRequest, 200);
Thread.sleep(100);
SmppServerSession serverSession0 = serverHandler.sessions.iterator().next();
Assert.assertEquals(1, serverHandler.sessions.size());
Assert.assertEquals(1, server0.getChannels().size());
Assert.assertEquals(true, serverSession0.isBound());
Assert.assertEquals(SmppBindType.TRANSCEIVER, serverSession0.getBindType());
Assert.assertEquals(SmppSession.Type.SERVER, serverSession0.getLocalType());
Assert.assertEquals(SmppSession.Type.CLIENT, serverSession0.getRemoteType());
// verify "requested" version is 3.4
Assert.assertEquals((byte)0x34, serverSession0.getConfiguration().getInterfaceVersion());
// verify the session interface version is normalized to 3.4
Assert.assertEquals(SmppConstants.VERSION_3_4, serverSession0.getInterfaceVersion());
Assert.assertEquals(true, serverSession0.areOptionalParametersSupported());
// verify client session version settings are correct
Assert.assertEquals((byte)0x34, session0.getConfiguration().getInterfaceVersion());
Assert.assertEquals((byte)0x34, session0.getInterfaceVersion());
Assert.assertEquals(true, session0.areOptionalParametersSupported());
// verify 1 optional parameter was included in bind response
Assert.assertEquals(1, bindResponse.getOptionalParameterCount());
Assert.assertEquals("cloudhopper", bindResponse.getSystemId());
Tlv scInterfaceVersion = bindResponse.getOptionalParameter(SmppConstants.TAG_SC_INTERFACE_VERSION);
Assert.assertNotNull(scInterfaceVersion);
Assert.assertEquals(SmppConstants.VERSION_3_4, scInterfaceVersion.getValueAsByte());
serverSession0.close();
Thread.sleep(200);
Assert.assertEquals(0, serverHandler.sessions.size());
Assert.assertEquals(0, server0.getChannels().size());
Assert.assertEquals(false, serverSession0.isBound());
} finally {
server0.destroy();
}
}