You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2013/05/02 23:07:41 UTC

svn commit: r1478549 - in /activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp: AmqpTestSupport.java JMSClientTest.java

Author: chirino
Date: Thu May  2 21:07:41 2013
New Revision: 1478549

URL: http://svn.apache.org/r1478549
Log:
Remove commented out tests.

Modified:
    activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java
    activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java

Modified: activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java?rev=1478549&r1=1478548&r2=1478549&view=diff
==============================================================================
--- activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java (original)
+++ activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java Thu May  2 21:07:41 2013
@@ -99,210 +99,4 @@ public class AmqpTestSupport {
         autoFailTestSupport.stopAutoFailThread();
     }
 
-
-
-//    @Test
-//    public void testSendAndReceiveAMQP() throws Exception {
-//        addAMQPConnector(brokerService);
-//        brokerService.start();
-//        AMQP amqp = new AMQP();
-//        final BlockingConnection subscribeConnection = amqp.blockingConnection();
-//        subscribeConnection.connect();
-//        Topic topic = new Topic("foo/bah",QoS.AT_MOST_ONCE);
-//        Topic[] topics = {topic};
-//        subscribeConnection.subscribe(topics);
-//        final CountDownLatch latch = new CountDownLatch(numberOfMessages);
-//
-//        Thread thread = new Thread(new Runnable() {
-//            public void run() {
-//                for (int i = 0; i < numberOfMessages; i++){
-//                    try {
-//                        Message message = subscribeConnection.receive();
-//                        message.ack();
-//                        latch.countDown();
-//                    } catch (Exception e) {
-//                        e.printStackTrace();
-//                        break;
-//                    }
-//
-//                }
-//            }
-//        });
-//        thread.start();
-//
-//        BlockingConnection publisherConnection = amqp.blockingConnection();
-//        publisherConnection.connect();
-//        for (int i = 0; i < numberOfMessages; i++){
-//            String payload = "Message " + i;
-//            publisherConnection.publish(topic.name().toString(),payload.getBytes(),QoS.AT_LEAST_ONCE,false);
-//        }
-//
-//        latch.await(10, TimeUnit.SECONDS);
-//        assertEquals(0, latch.getCount());
-//    }
-//
-//    @Test
-//    public void testSendAndReceiveAtMostOnce() throws Exception {
-//        addAMQPConnector(brokerService);
-//        brokerService.start();
-//        AMQP amqp = createAMQPConnection();
-//        amqp.setKeepAlive(Short.MAX_VALUE);
-//        BlockingConnection connection = amqp.blockingConnection();
-//
-//        connection.connect();
-//
-//
-//        Topic[] topics = {new Topic(utf8("foo"), QoS.AT_MOST_ONCE)};
-//        connection.subscribe(topics);
-//        for (int i = 0; i < numberOfMessages; i++) {
-//            String payload = "Test Message: " + i;
-//            connection.publish("foo", payload.getBytes(), QoS.AT_MOST_ONCE, false);
-//            Message message = connection.receive();
-//            assertEquals(payload, new String(message.getPayload()));
-//        }
-//        connection.disconnect();
-//    }
-//
-//    @Test
-//    public void testSendAndReceiveAtLeastOnce() throws Exception {
-//        addAMQPConnector(brokerService);
-//        brokerService.start();
-//        AMQP amqp = createAMQPConnection();
-//        amqp.setKeepAlive(Short.MAX_VALUE);
-//        BlockingConnection connection = amqp.blockingConnection();
-//
-//        connection.connect();
-//
-//        Topic[] topics = {new Topic(utf8("foo"), QoS.AT_LEAST_ONCE)};
-//        connection.subscribe(topics);
-//        for (int i = 0; i < numberOfMessages; i++) {
-//            String payload = "Test Message: " + i;
-//            connection.publish("foo", payload.getBytes(), QoS.AT_LEAST_ONCE, false);
-//            Message message = connection.receive();
-//            message.ack();
-//            assertEquals(payload, new String(message.getPayload()));
-//        }
-//        connection.disconnect();
-//    }
-//
-//    @Test
-//    public void testSendAndReceiveExactlyOnce() throws Exception {
-//        addAMQPConnector(brokerService);
-//        brokerService.start();
-//        AMQP publisher = createAMQPConnection();
-//        BlockingConnection pubConnection = publisher.blockingConnection();
-//
-//        pubConnection.connect();
-//
-//        AMQP subscriber = createAMQPConnection();
-//        BlockingConnection subConnection = subscriber.blockingConnection();
-//
-//        subConnection.connect();
-//
-//        Topic[] topics = {new Topic(utf8("foo"), QoS.EXACTLY_ONCE)};
-//        subConnection.subscribe(topics);
-//        for (int i = 0; i < numberOfMessages; i++) {
-//            String payload = "Test Message: " + i;
-//            pubConnection.publish("foo", payload.getBytes(), QoS.EXACTLY_ONCE, false);
-//            Message message = subConnection.receive();
-//            message.ack();
-//            assertEquals(payload, new String(message.getPayload()));
-//        }
-//        subConnection.disconnect();
-//        pubConnection.disconnect();
-//    }
-//
-//    @Test
-//    public void testSendAndReceiveLargeMessages() throws Exception {
-//        byte[] payload = new byte[1024 * 32];
-//        for (int i = 0; i < payload.length; i++){
-//            payload[i] = '2';
-//        }
-//        addAMQPConnector(brokerService);
-//        brokerService.start();
-//
-//        AMQP publisher = createAMQPConnection();
-//        BlockingConnection pubConnection = publisher.blockingConnection();
-//
-//        pubConnection.connect();
-//
-//        AMQP subscriber = createAMQPConnection();
-//        BlockingConnection subConnection = subscriber.blockingConnection();
-//
-//        subConnection.connect();
-//
-//        Topic[] topics = {new Topic(utf8("foo"), QoS.AT_LEAST_ONCE)};
-//        subConnection.subscribe(topics);
-//        for (int i = 0; i < 10; i++) {
-//            pubConnection.publish("foo", payload, QoS.AT_LEAST_ONCE, false);
-//            Message message = subConnection.receive();
-//            message.ack();
-//            assertArrayEquals(payload, message.getPayload());
-//        }
-//        subConnection.disconnect();
-//        pubConnection.disconnect();
-//    }
-//
-//
-//    @Test
-//    public void testSendAMQPReceiveJMS() throws Exception {
-//        addAMQPConnector(brokerService);
-//        brokerService.addConnector(ActiveMQConnectionFactory.DEFAULT_BROKER_BIND_URL);
-//        brokerService.start();
-//        AMQP amqp = createAMQPConnection();
-//        BlockingConnection connection = amqp.blockingConnection();
-//        final String DESTINATION_NAME = "foo.*";
-//        connection.connect();
-//
-//        ActiveMQConnection activeMQConnection = (ActiveMQConnection) new ActiveMQConnectionFactory().createConnection();
-//        activeMQConnection.start();
-//        Session s = activeMQConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-//        javax.jms.Topic jmsTopic = s.createTopic(DESTINATION_NAME);
-//        MessageConsumer consumer = s.createConsumer(jmsTopic);
-//
-//        for (int i = 0; i < numberOfMessages; i++) {
-//            String payload = "Test Message: " + i;
-//            connection.publish("foo/bah", payload.getBytes(), QoS.AT_LEAST_ONCE, false);
-//            ActiveMQMessage message = (ActiveMQMessage) consumer.receive();
-//            ByteSequence bs = message.getContent();
-//            assertEquals(payload, new String(bs.data, bs.offset, bs.length));
-//        }
-//
-//
-//        activeMQConnection.close();
-//        connection.disconnect();
-//    }
-//
-//    @Test
-//    public void testSendJMSReceiveAMQP() throws Exception {
-//        addAMQPConnector(brokerService);
-//        brokerService.addConnector(ActiveMQConnectionFactory.DEFAULT_BROKER_BIND_URL);
-//        brokerService.start();
-//        AMQP amqp = createAMQPConnection();
-//        amqp.setKeepAlive(Short.MAX_VALUE);
-//        BlockingConnection connection = amqp.blockingConnection();
-//        connection.connect();
-//
-//        ActiveMQConnection activeMQConnection = (ActiveMQConnection) new ActiveMQConnectionFactory().createConnection();
-//        activeMQConnection.start();
-//        Session s = activeMQConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-//        javax.jms.Topic jmsTopic = s.createTopic("foo.far");
-//        MessageProducer producer = s.createProducer(jmsTopic);
-//
-//        Topic[] topics = {new Topic(utf8("foo/+"), QoS.AT_MOST_ONCE)};
-//        connection.subscribe(topics);
-//        for (int i = 0; i < numberOfMessages; i++) {
-//            String payload = "This is Test Message: " + i;
-//            TextMessage sendMessage = s.createTextMessage(payload);
-//            producer.send(sendMessage);
-//            Message message = connection.receive();
-//            message.ack();
-//            assertEquals(payload, new String(message.getPayload()));
-//        }
-//        connection.disconnect();
-//    }
-//
-//
-
-
 }
\ No newline at end of file

Modified: activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java?rev=1478549&r1=1478548&r2=1478549&view=diff
==============================================================================
--- activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java (original)
+++ activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java Thu May  2 21:07:41 2013
@@ -64,77 +64,6 @@ public class JMSClientTest extends AmqpT
 
     }
 
-//    @Test
-//    public void testSendReceive() throws Exception {
-//        ActiveMQAdmin.enableJMSFrameTracing();
-//        QueueImpl queue = new QueueImpl("queue://testqueue");
-//        int nMsgs = 1;
-//        final String dataFormat = "%01024d";
-//
-//
-//        try {
-//            Connection connection = createConnection();
-//            {
-//                Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-//                MessageProducer p = session.createProducer(queue);
-//                for (int i = 0; i < nMsgs; i++) {
-//                    System.out.println("Sending " + i);
-//                    p.send(session.createTextMessage(String.format(dataFormat, i)));
-//                }
-//            }
-//            connection.close();
-//
-//            System.out.println("=======================================================================================");
-//            System.out.println(" failing a receive ");
-//            System.out.println("=======================================================================================");
-//            connection = createConnection();
-//            {
-//                Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-//                MessageConsumer c = session.createConsumer(queue);
-//
-//                // Receive messages non-transacted
-//                int i = 0;
-//                while ( i < 1) {
-//                    TextMessage msg = (TextMessage) c.receive();
-//                    if( msg!=null ) {
-//                        String s = msg.getText();
-//                        assertEquals(String.format(dataFormat, i), s);
-//                        System.out.println("Received: " + i);
-//                        i++;
-//                    }
-//                }
-//            }
-//            connection.close();
-//
-//
-//            System.out.println("=======================================================================================");
-//            System.out.println(" receiving ");
-//            System.out.println("=======================================================================================");
-//            connection = createConnection();
-//            {
-//                Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-//                MessageConsumer c = session.createConsumer(queue);
-//
-//                // Receive messages non-transacted
-//                int i = 0;
-//                while ( i < nMsgs) {
-//                    TextMessage msg = (TextMessage) c.receive();
-//                    if( msg!=null ) {
-//                        String s = msg.getText();
-//                        assertEquals(String.format(dataFormat, i), s);
-//                        System.out.println("Received: " + i);
-//                        i++;
-//                    }
-//                }
-//            }
-//            connection.close();
-//
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//
-//    }
-
     private Connection createConnection() throws JMSException {
         final ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port, "admin", "password");
         final Connection connection = factory.createConnection();