[jboss-cvs] JBoss Messaging SVN: r2246 - branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 9 20:44:52 EST 2007


Author: ovidiu.feodorov at jboss.com
Date: 2007-02-09 20:44:52 -0500 (Fri, 09 Feb 2007)
New Revision: 2246

Modified:
   branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/JMSTest.java
Log:
extra simple test to play with

Modified: branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/JMSTest.java
===================================================================
--- branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/JMSTest.java	2007-02-09 19:24:25 UTC (rev 2245)
+++ branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/JMSTest.java	2007-02-10 01:44:52 UTC (rev 2246)
@@ -49,22 +49,22 @@
  */
 public class JMSTest extends MessagingTestCase
 {
-   // Constants -----------------------------------------------------
+   // Constants ------------------------------------------------------------------------------------
 
-   // Static --------------------------------------------------------
+   // Static ---------------------------------------------------------------------------------------
 
-   // Attributes ----------------------------------------------------
+   // Attributes -----------------------------------------------------------------------------------
 
    InitialContext ic;
 
-   // Constructors --------------------------------------------------
+   // Constructors ---------------------------------------------------------------------------------
 
    public JMSTest(String name)
    {
       super(name);
    }
 
-   // Public --------------------------------------------------------
+   // Public ---------------------------------------------------------------------------------------
 
    public void setUp() throws Exception
    {
@@ -87,6 +87,41 @@
 
       super.tearDown();
    }
+
+
+   public void testSimplest() throws Exception
+   {
+      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
+      Queue queue = (Queue)ic.lookup("/queue/JMSTestQueue");
+
+      Connection conn = null;
+
+      try
+      {
+         conn = cf.createConnection();
+         conn.start();
+
+         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         MessageProducer prod = session.createProducer(queue);
+         MessageConsumer cons = session.createConsumer(queue);
+
+         TextMessage m = session.createTextMessage("simplest");
+
+         prod.send(m);
+
+         TextMessage rm = (TextMessage)cons.receive(5000);
+
+         assertEquals("simplest", rm.getText());
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            conn.close();
+         }
+      }
+   }
    
    public void test_NonPersistent_NonTransactional() throws Exception
    {
@@ -232,7 +267,6 @@
       conn.close();
    }
 
-
    public void test_NonPersistent_Transactional_Acknowledgment() throws Exception
    {
       ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
@@ -402,14 +436,12 @@
       conn.close();
    }
 
+   // Package protected ----------------------------------------------------------------------------
 
+   // Protected ------------------------------------------------------------------------------------
 
-   // Package protected ---------------------------------------------
+   // Private --------------------------------------------------------------------------------------
 
-   // Protected -----------------------------------------------------
+   // Inner classes --------------------------------------------------------------------------------
 
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
 }




More information about the jboss-cvs-commits mailing list