Package com.cloudhopper.smpp

Examples of com.cloudhopper.smpp.SmppServerSession


            Thread.sleep(200);

            Assert.assertEquals(1, serverHandler.sessions.size());
            Assert.assertEquals(1, server0.getChannels().size());

            SmppServerSession serverSession0 = serverHandler.sessions.iterator().next();
            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());

            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();
        }
    }
View Full Code Here


            // this should actually work
            SmppSession session0 = client0.bind(sessionConfig0);

            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());

            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();
        }
    }
View Full Code Here

            // 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 still 3.3
            Assert.assertEquals(SmppConstants.VERSION_3_3, serverSession0.getConfiguration().getInterfaceVersion());
            // verify the session interface version is normalized to 3.3
            Assert.assertEquals(SmppConstants.VERSION_3_3, serverSession0.getInterfaceVersion());
            Assert.assertEquals(false, serverSession0.areOptionalParametersSupported());

            // verify client session version settings are correct
            Assert.assertEquals((byte)0x33, session0.getConfiguration().getInterfaceVersion());
            Assert.assertEquals((byte)0x33, session0.getInterfaceVersion());
            Assert.assertEquals(false, session0.areOptionalParametersSupported());

            // verify NO optional parameters were included in bind response
            Assert.assertEquals(0, bindResponse.getOptionalParameterCount());
            Assert.assertEquals("cloudhopper", bindResponse.getSystemId());

            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();
        }
    }
View Full Code Here

            // 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.1
            Assert.assertEquals((byte)0x31, serverSession0.getConfiguration().getInterfaceVersion());
            // verify the session interface version is normalized to 3.3
            Assert.assertEquals(SmppConstants.VERSION_3_3, serverSession0.getInterfaceVersion());
            Assert.assertEquals(false, serverSession0.areOptionalParametersSupported());

            // verify client session version settings are correct
            Assert.assertEquals((byte)0x31, session0.getConfiguration().getInterfaceVersion());
            Assert.assertEquals((byte)0x33, session0.getInterfaceVersion());
            Assert.assertEquals(false, session0.areOptionalParametersSupported());

            // verify NO optional parameters were included in bind response
            Assert.assertEquals(0, bindResponse.getOptionalParameterCount());
            Assert.assertEquals("cloudhopper", bindResponse.getSystemId());

            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();
        }
    }
View Full Code Here

            // 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();
        }
    }
View Full Code Here

            // 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.5
            Assert.assertEquals((byte)0x35, 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)0x35, 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();
        }
    }
View Full Code Here

TOP

Related Classes of com.cloudhopper.smpp.SmppServerSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.