Package org.apache.qpid.amqp_1_0.jms.impl

Examples of org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl.createConnection()


    @Test(timeout = 10000)
    public void testUnknownUser() throws Exception {
        try {
            ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port, "admin", "password");
            Connection connection = factory.createConnection("nosuchuser", "blah");
            connection.start();
            Thread.sleep(500);
            connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            fail("Expected JMSException");
        } catch (JMSException e)  {
View Full Code Here


    @Test(timeout = 10000)
    public void testKnownUserWrongPassword() throws Exception {
        try {
            ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port, "admin", "password");
            Connection connection = factory.createConnection("user", "wrongPassword");
            connection.start();
            Thread.sleep(500);
            connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            fail("Expected JMSException");
        } catch (JMSException e) {
View Full Code Here

    }

    @Test(timeout = 30000)
    public void testSendReceive() throws Exception {
        ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port, "admin", "password");
        Connection connection = factory.createConnection("user", "userPassword");
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        QueueImpl queue = new QueueImpl("queue://txqueue");
        MessageProducer p = session.createProducer(queue);
        TextMessage message = null;
        message = session.createTextMessage();
View Full Code Here

        openwireConn.close();
    }

    public Connection createAmqpConnection() throws JMSException {
        final ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", amqpPort, "admin", "password");
        final Connection connection = factory.createConnection();
        connection.setExceptionListener(new ExceptionListener() {
            @Override
            public void onException(JMSException exception) {
                exception.printStackTrace();
            }
View Full Code Here

    @Test
    public void canDetectTheAMQPProtocol() throws Exception {
        DetectingGateway gateway = createGateway();

        final ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", gateway.getBoundPort(), "admin", "password");
        Connection connection = factory.createConnection();
        connection.start();

        assertEquals(1, gateway.getSuccessfulConnectionAttempts());
        assertEquals(1, gateway.getConnectedClients().length);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.