Package com.cloudhopper.smpp

Examples of com.cloudhopper.smpp.SmppSessionConfiguration


        // server has activated trust manager that refuses untrusted clients.
        DefaultSmppServer server0 = createSmppServer(createServerConfigurationStrongSSL());
        server0.start();

        DefaultSmppClient client0 = new DefaultSmppClient();
        SmppSessionConfiguration sessionConfig0 = createClientConfigurationWeakSSL();
        try {
            // this should fail
            SmppSession session0 = client0.bind(sessionConfig0);
            Assert.fail();
        } catch (Exception e) {
View Full Code Here


        //
        // setup configuration for a client session
        //
        DefaultSmppSessionHandler sessionHandler = new ClientSmppSessionHandler();

        SmppSessionConfiguration config0 = new SmppSessionConfiguration();
        config0.setWindowSize(1);
        config0.setName("Tester.Session.0");
        config0.setType(SmppBindType.TRANSCEIVER);
        config0.setHost("127.0.0.1");
        config0.setPort(2777);
        config0.setConnectTimeout(10000);
        config0.setSystemId("1234567890");
        config0.setPassword("password");
        config0.getLoggingOptions().setLogBytes(true);
        // to enable monitoring (request expiration)
        config0.setRequestExpiryTimeout(30000);
        config0.setWindowMonitorInterval(15000);
        config0.setCountersEnabled(true);
  //ssl
  config0.setUseSsl(true);

        //
        // create session, enquire link, submit an sms, close session
        //
        SmppSession session0 = null;
View Full Code Here

        logger.info("Stopping the boostrap inside test class");
        bootstrap.destroy();
    }

    public SmppSessionConfiguration createDefaultConfiguration() {
        SmppSessionConfiguration configuration = new SmppSessionConfiguration();
        configuration.setWindowSize(1);
        configuration.setName("Tester.Session.0");
        configuration.setType(SmppBindType.TRANSCEIVER);
        configuration.setHost("localhost");
        configuration.setPort(PORT);
        configuration.setConnectTimeout(100);
        configuration.setBindTimeout(100);
        configuration.setSystemId(SYSTEMID);
        configuration.setPassword(PASSWORD);
        configuration.getLoggingOptions().setLogBytes(true);
        return configuration;
    }
View Full Code Here

        server.getHandler().setDefaultPduProcessor(null);
    }

    @Test
    public void bindToBadPortThrowsSmppChannelConnectException() throws Exception {
        SmppSessionConfiguration configuration = createDefaultConfiguration();
        // change this to a port we know a server isn't running on
        configuration.setPort(PORT+1);
       
        DefaultSmppSession session = null;
        try {
            session = (DefaultSmppSession)bootstrap.bind(configuration);
            Assert.fail();
View Full Code Here

        }
    }

    @Test
    public void bindToUnknownHostThrowsSmppChannelConnectException() throws Exception {
        SmppSessionConfiguration configuration = createDefaultConfiguration();
        // change to a host that doesn't exist
        configuration.setHost("jfjdjdjdjdjjdjd");

        DefaultSmppSession session = null;
        try {
            session = (DefaultSmppSession)bootstrap.bind(configuration);
            Assert.fail();
View Full Code Here

        }
    }

    @Test
    public void bindToFirewalledHostThrowsSmppChannelConnectTimeoutException() throws Exception {
        SmppSessionConfiguration configuration = createDefaultConfiguration();
        // change to a host and port that are definitely firewalled
        configuration.setHost("www.twitter.com");
        configuration.setPort(81);

        DefaultSmppSession session = null;
        try {
            session = (DefaultSmppSession)bootstrap.bind(configuration);
            Assert.fail();
View Full Code Here

        }
    }

    @Test
    public void bindConnectsButNoResponseThrowsSmppTimeoutException() throws Exception {
        SmppSessionConfiguration configuration = createDefaultConfiguration();
        unregisterServerBindProcessor();

        DefaultSmppSession session = null;
        try {
            session = (DefaultSmppSession)bootstrap.bind(configuration);
View Full Code Here

        }
    }

    @Test
    public void bindWithBadCredentialsThrowsSmppBindException() throws Exception {
        SmppSessionConfiguration configuration = createDefaultConfiguration();
        registerServerBindProcessor();

        // set a bad system id
        configuration.setSystemId("BADID");

        DefaultSmppSession session = null;
        try {
            session = (DefaultSmppSession)bootstrap.bind(configuration);
            Assert.fail();
View Full Code Here

        }
    }

    @Test
    public void bindOK() throws Exception {
        SmppSessionConfiguration configuration = createDefaultConfiguration();
        registerServerBindProcessor();

        DefaultSmppSession session = (DefaultSmppSession)bootstrap.bind(configuration);

        // verify the session stuff...
View Full Code Here

        SmppSessionUtil.close(session);
    }

    @Test
    public void enquireLinkWithGenericNackResponse() throws Exception {
        SmppSessionConfiguration configuration = createDefaultConfiguration();
        registerServerBindProcessor();
        clearAllServerSessions();

        // bind and get the simulator session
        DefaultSmppSession session = (DefaultSmppSession)bootstrap.bind(configuration);
View Full Code Here

TOP

Related Classes of com.cloudhopper.smpp.SmppSessionConfiguration

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.