Package org.apache.qpid.jndi

Examples of org.apache.qpid.jndi.PropertiesFileInitialContextFactory


        super.tearDown();
    }

    public void testPriority() throws JMSException, NamingException, AMQException
    {
        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@PRIORITY_TEST_ID" + VHOST + "?brokerlist='" + BROKER + "'");
        env.put("queue.queue", QUEUE);

        Context context = factory.getInitialContext(env);

        Connection producerConnection = ((ConnectionFactory) context.lookup("connection")).createConnection();

        Session producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here


        catch (Exception e)
        {
            fail("Unable to create broker: " + e);
        }

        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        if (_clientID == null)
        {
            _clientID = this.getClass().getName();
        }

        if (_virtualhost == null)
        {
            _virtualhost = "/test";
        }

        if (_brokerlist == null)
        {
            _brokerlist = "vm://:1";
        }

        env.put("connectionfactory.connection", "amqp://guest:guest@" + _clientID + _virtualhost + "?brokerlist='"
            + _brokerlist + "'");

        for (Map.Entry<String, String> c : _connections.entrySet())
        {
            env.put("connectionfactory." + c.getKey(), c.getValue());
        }

        env.put("queue.queue", "queue");

        for (Map.Entry<String, String> q : _queues.entrySet())
        {
            env.put("queue." + q.getKey(), q.getValue());
        }

        env.put("topic.topic", "topic");

        for (Map.Entry<String, String> t : _topics.entrySet())
        {
            env.put("topic." + t.getKey(), t.getValue());
        }

        _context = factory.getInitialContext(env);
    }
View Full Code Here

        if (BROKER.contains("vm://"))
        {
            TransportConnection.createVMBroker(1);
        }

        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@MLT_ID/" + VHOST + "?brokerlist='" + BROKER + "'");
        env.put("queue.queue", "MessageListenerTest");

        _context = factory.getInitialContext(env);

        Queue queue = (Queue) _context.lookup("queue");

        // Create Client
        _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
View Full Code Here

    {
        if (BROKER.startsWith("vm://"))
        {
            TransportConnection.createVMBroker(1);
        }
        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@TTL_TEST_ID" + VHOST + "?brokerlist='" + BROKER + "'");
        env.put("queue.queue", QUEUE);

        _context = factory.getInitialContext(env);

        _queue = (Queue) _context.lookup("queue");

        //Create Client 1
        _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
View Full Code Here

        TransportConnection.createVMBroker(1);

        oldImmediatePrefetch = System.getProperty(AMQSession.IMMEDIATE_PREFETCH);
        System.setProperty(AMQSession.IMMEDIATE_PREFETCH, "true");

        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@MLT_ID/test?brokerlist='vm://:1'");
        env.put("queue.queue", "direct://amq.direct//ResetMessageListenerTest");

        _context = factory.getInitialContext(env);

        Queue queue = (Queue) _context.lookup("queue");

        // Create Client 1
        _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
View Full Code Here

    protected void setUp() throws Exception
    {
        super.setUp();
        TransportConnection.createVMBroker(1);

        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@MLT_ID/test?brokerlist='vm://:1'");
        env.put("queue.queue", "direct://amq.direct//" + this.getClass().getName());

        _context = factory.getInitialContext(env);

        _queue = (Queue) _context.lookup("queue");

        // Create Client 1
        _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
View Full Code Here

        if (usingInVMBroker())
        {
            TransportConnection.createVMBroker(1);
        }

        InitialContextFactory factory = new PropertiesFileInitialContextFactory();
        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@PRIORITY_TEST_ID" + VHOST + "?brokerlist='" + BROKER + "'");
        env.put("queue.queue", QUEUE);

        context = factory.getInitialContext(env);
        producerConnection = ((ConnectionFactory) context.lookup("connection")).createConnection();
        producerSession = producerConnection.createSession(true, Session.AUTO_ACKNOWLEDGE);

        producerConnection.start();
       
View Full Code Here

        if (BROKER.startsWith("vm://"))
        {
            TransportConnection.createVMBroker(1);
        }
        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@TTL_TEST_ID/" + VHOST + "?brokerlist='" + BROKER + "'");
        env.put("queue.queue", QUEUE);

        _context = factory.getInitialContext(env);

    }
View Full Code Here

        super.tearDown();
    }

    public void testPassiveTTL() throws JMSException, NamingException
    {
        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@TTL_TEST_ID" + VHOST + "?brokerlist='" + BROKER + "'");
        env.put("queue.queue", QUEUE);
                                          
        Context context = factory.getInitialContext(env);

        Queue queue = (Queue) context.lookup("queue");

        //Create Client 1
        Connection clientConnection = ((ConnectionFactory) context.lookup("connection")).createConnection();
View Full Code Here

    protected void setUp() throws Exception
    {
        super.setUp();
        TransportConnection.createVMBroker(1);

        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@MLT_ID/test?brokerlist='vm://:1'");
        env.put("queue.queue", "MessageListenerTest");

        _context = factory.getInitialContext(env);

        Queue queue = (Queue) _context.lookup("queue");

        // Create Client 1
        _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
View Full Code Here

TOP

Related Classes of org.apache.qpid.jndi.PropertiesFileInitialContextFactory

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.