[Jboss-cvs] JBoss Messaging SVN: r1269 - in branches/Branch_1_0/tests: . src/org/jboss/test/messaging/jms/crash

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 7 19:18:21 EDT 2006


Author: clebert.suconic at jboss.com
Date: 2006-09-07 19:18:18 -0400 (Thu, 07 Sep 2006)
New Revision: 1269

Added:
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrashTest1.java
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrashTest2.java
Removed:
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrash1.java
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrash2.java
Modified:
   branches/Branch_1_0/tests/build.xml
Log:
Renaming test

Modified: branches/Branch_1_0/tests/build.xml
===================================================================
--- branches/Branch_1_0/tests/build.xml	2006-09-07 14:59:45 UTC (rev 1268)
+++ branches/Branch_1_0/tests/build.xml	2006-09-07 23:18:18 UTC (rev 1269)
@@ -608,13 +608,13 @@
    	<antcall target="stop-rmi-server"/>
     <antcall target="start-rmi-server"/>
     <antcall target="crash-test">
-       <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.DurableCrash1"/>
+       <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.DurableCrashTest1"/>
     </antcall>
 
    	<echo message="Waiting 3 minutes before starting DurableCrash2"/>
    	<sleep minutes="3"/> 
     <antcall target="crash-test">
-       <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.DurableCrash2"/>
+       <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.DurableCrashTest2"/>
     </antcall>
 
       <antcall target="stop-rmi-server"/>

Deleted: branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrash1.java
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrash1.java	2006-09-07 14:59:45 UTC (rev 1268)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrash1.java	2006-09-07 23:18:18 UTC (rev 1269)
@@ -1,123 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2006, RedHat Middle LLc, and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-
-package org.jboss.test.messaging.jms.crash;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.naming.InitialContext;
-
-import org.jboss.test.messaging.MessagingTestCase;
-import org.jboss.test.messaging.tools.ServerManagement;
-
-public class DurableCrash1 extends MessagingTestCase
-{
-	   // Constants -----------------------------------------------------
-
-	   // Static --------------------------------------------------------
-
-	   // Attributes ----------------------------------------------------
-
-	   protected InitialContext ic;
-
-	   // Constructors --------------------------------------------------
-
-	   public DurableCrash1(String name)
-	   {
-	      super(name);
-	   }
-
-	   // Public --------------------------------------------------------
-
-	   public void setUp() throws Exception
-	   {
-	      super.setUp();
-
-	      ServerManagement.start("all");
-	            
-	      ServerManagement.undeployTopic("TopicCrash");
-	      ServerManagement.deployTopic("TopicCrash");
-
-	      ic = new InitialContext(ServerManagement.getJNDIEnvironment());
-
-	      log.debug("setup done");
-	   }
-
-	   public void testSimplestDurableSubscription() throws Exception
-	   {
-	      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
-	      Topic topic = (Topic)ic.lookup("/topic/TopicCrash");
-	      
-	      Connection conn = cf.createConnection();
-	      conn.setClientID("client1");
-	      conn.start();
-
-	      Connection conn2 = cf.createConnection();
-	      conn2.setClientID("client2");
-	      conn2.start();
-
-	      Session s = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
-	      Session s2 = conn2.createSession(true, Session.AUTO_ACKNOWLEDGE);
-
-	      MessageProducer prod = s.createProducer(topic);
-	      prod.setDeliveryMode(DeliveryMode.PERSISTENT);
-
-	      MessageConsumer durable = s.createDurableSubscriber(topic, "subs1");
-	      MessageConsumer durable2 = s2.createDurableSubscriber(topic, "subs2");
-
-	      //conn2.close(); -- do not remote this comment. It was meant to not close the connection
-	      
-	      
-	      for (int i=0;i<10;i++)
-	      {
-	    	  prod.send(s.createTextMessage("k"+i));
-	      }
-	      s.commit();
-
-	      conn.close();
-	      conn = cf.createConnection();
-	      conn.setClientID("client1");
-	      conn.start();
-	      s = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
-	      durable = s.createDurableSubscriber(topic, "subs1");
-
-	      for (int i=0;i<2;i++)
-	      {
-	    	  TextMessage tm = (TextMessage)durable.receive(1000);
-	    	  assertNotNull(tm);
-	    	  s.commit();
-	    	  System.out.println(tm.getText());
-	    	  assertEquals("k" + i, tm.getText());
-	      }
-	      
-	      //conn.close();-- do not remote this comment. It was meant to not close the connection
-
-	      //System.exit(0); -- this is not needed as there is not tearDown, the client VM will simply be finished the same way an exit would do, and this is better since it will keep proper JUNIT report outputs
-	   }
-
-	}

Deleted: branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrash2.java
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrash2.java	2006-09-07 14:59:45 UTC (rev 1268)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrash2.java	2006-09-07 23:18:18 UTC (rev 1269)
@@ -1,107 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2006, RedHat Middle LLc, and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-
-package org.jboss.test.messaging.jms.crash;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageConsumer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.naming.InitialContext;
-
-import org.jboss.test.messaging.MessagingTestCase;
-import org.jboss.test.messaging.tools.ServerManagement;
-
-public class DurableCrash2 extends MessagingTestCase
-{
-	   // Constants -----------------------------------------------------
-
-	   // Static --------------------------------------------------------
-
-	   // Attributes ----------------------------------------------------
-
-	   protected InitialContext ic;
-
-	   // Constructors --------------------------------------------------
-
-	   public DurableCrash2(String name)
-	   {
-	      super(name);
-	   }
-
-	   // Public --------------------------------------------------------
-
-	   public void setUp() throws Exception
-	   {
-	      super.setUp();
-	      ic = new InitialContext(ServerManagement.getJNDIEnvironment());
-
-	      log.debug("setup done");
-	   }
-
-	   public void testSimplestDurableSubscription() throws Exception
-	   {
-		  
-	      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
-	      Topic topic = (Topic)ic.lookup("/topic/TopicCrash");
-	      
-	      Connection conn = null;
-	      Session s = null;
-	      MessageConsumer durable = null;
-
-	      Connection conn2 = cf.createConnection();
-	      conn2.setClientID("client2");
-	      conn2.start();
-	      Session s2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-	      MessageConsumer durable2 = s2.createDurableSubscriber(topic, "subs2");
-
-		  for (int i=0;i<10;i++)
-	      {
-	    	  TextMessage tm = (TextMessage)durable2.receive(1000);
-	    	  assertNotNull(tm);
-	    	  tm.acknowledge();
-	    	  System.out.println(tm.getText());
-	    	  assertEquals("k" + i, tm.getText());
-	      }
-		  
-	      conn = cf.createConnection();
-	      conn.setClientID("client1");
-	      conn.start();
-	      s = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
-	      durable = s.createDurableSubscriber(topic, "subs1");
-
-	      for (int i=2;i<10;i++)
-	      {
-	    	  TextMessage tm = (TextMessage)durable.receive(1000);
-	    	  assertNotNull(tm);
-	    	  s.commit();
-	    	  System.out.println(tm.getText());
-	    	  assertEquals("k" + i, tm.getText());
-	      }
-
-
-	   }
-
-	}

Copied: branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrashTest1.java (from rev 1267, branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrash1.java)
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrash1.java	2006-09-07 14:58:57 UTC (rev 1267)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrashTest1.java	2006-09-07 23:18:18 UTC (rev 1269)
@@ -0,0 +1,123 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2006, RedHat Middle LLc, and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.messaging.jms.crash;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.naming.InitialContext;
+
+import org.jboss.test.messaging.MessagingTestCase;
+import org.jboss.test.messaging.tools.ServerManagement;
+
+public class DurableCrashTest1 extends MessagingTestCase
+{
+	   // Constants -----------------------------------------------------
+
+	   // Static --------------------------------------------------------
+
+	   // Attributes ----------------------------------------------------
+
+	   protected InitialContext ic;
+
+	   // Constructors --------------------------------------------------
+
+	   public DurableCrashTest1(String name)
+	   {
+	      super(name);
+	   }
+
+	   // Public --------------------------------------------------------
+
+	   public void setUp() throws Exception
+	   {
+	      super.setUp();
+
+	      ServerManagement.start("all");
+	            
+	      ServerManagement.undeployTopic("TopicCrash");
+	      ServerManagement.deployTopic("TopicCrash");
+
+	      ic = new InitialContext(ServerManagement.getJNDIEnvironment());
+
+	      log.debug("setup done");
+	   }
+
+	   public void testSimplestDurableSubscription() throws Exception
+	   {
+	      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
+	      Topic topic = (Topic)ic.lookup("/topic/TopicCrash");
+	      
+	      Connection conn = cf.createConnection();
+	      conn.setClientID("client1");
+	      conn.start();
+
+	      Connection conn2 = cf.createConnection();
+	      conn2.setClientID("client2");
+	      conn2.start();
+
+	      Session s = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
+	      Session s2 = conn2.createSession(true, Session.AUTO_ACKNOWLEDGE);
+
+	      MessageProducer prod = s.createProducer(topic);
+	      prod.setDeliveryMode(DeliveryMode.PERSISTENT);
+
+	      MessageConsumer durable = s.createDurableSubscriber(topic, "subs1");
+	      MessageConsumer durable2 = s2.createDurableSubscriber(topic, "subs2");
+
+	      //conn2.close(); -- do not remote this comment. It was meant to not close the connection
+	      
+	      
+	      for (int i=0;i<10;i++)
+	      {
+	    	  prod.send(s.createTextMessage("k"+i));
+	      }
+	      s.commit();
+
+	      conn.close();
+	      conn = cf.createConnection();
+	      conn.setClientID("client1");
+	      conn.start();
+	      s = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
+	      durable = s.createDurableSubscriber(topic, "subs1");
+
+	      for (int i=0;i<2;i++)
+	      {
+	    	  TextMessage tm = (TextMessage)durable.receive(1000);
+	    	  assertNotNull(tm);
+	    	  s.commit();
+	    	  System.out.println(tm.getText());
+	    	  assertEquals("k" + i, tm.getText());
+	      }
+	      
+	      //conn.close();-- do not remote this comment. It was meant to not close the connection
+
+	      //System.exit(0); -- this is not needed as there is not tearDown, the client VM will simply be finished the same way an exit would do, and this is better since it will keep proper JUNIT report outputs
+	   }
+
+	}

Copied: branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrashTest2.java (from rev 1267, branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrash2.java)
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrash2.java	2006-09-07 14:58:57 UTC (rev 1267)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/crash/DurableCrashTest2.java	2006-09-07 23:18:18 UTC (rev 1269)
@@ -0,0 +1,107 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2006, RedHat Middle LLc, and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.messaging.jms.crash;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.naming.InitialContext;
+
+import org.jboss.test.messaging.MessagingTestCase;
+import org.jboss.test.messaging.tools.ServerManagement;
+
+public class DurableCrashTest2 extends MessagingTestCase
+{
+	   // Constants -----------------------------------------------------
+
+	   // Static --------------------------------------------------------
+
+	   // Attributes ----------------------------------------------------
+
+	   protected InitialContext ic;
+
+	   // Constructors --------------------------------------------------
+
+	   public DurableCrashTest2(String name)
+	   {
+	      super(name);
+	   }
+
+	   // Public --------------------------------------------------------
+
+	   public void setUp() throws Exception
+	   {
+	      super.setUp();
+	      ic = new InitialContext(ServerManagement.getJNDIEnvironment());
+
+	      log.debug("setup done");
+	   }
+
+	   public void testSimplestDurableSubscription() throws Exception
+	   {
+		  
+	      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
+	      Topic topic = (Topic)ic.lookup("/topic/TopicCrash");
+	      
+	      Connection conn = null;
+	      Session s = null;
+	      MessageConsumer durable = null;
+
+	      Connection conn2 = cf.createConnection();
+	      conn2.setClientID("client2");
+	      conn2.start();
+	      Session s2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+	      MessageConsumer durable2 = s2.createDurableSubscriber(topic, "subs2");
+
+		  for (int i=0;i<10;i++)
+	      {
+	    	  TextMessage tm = (TextMessage)durable2.receive(1000);
+	    	  assertNotNull(tm);
+	    	  tm.acknowledge();
+	    	  System.out.println(tm.getText());
+	    	  assertEquals("k" + i, tm.getText());
+	      }
+		  
+	      conn = cf.createConnection();
+	      conn.setClientID("client1");
+	      conn.start();
+	      s = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
+	      durable = s.createDurableSubscriber(topic, "subs1");
+
+	      for (int i=2;i<10;i++)
+	      {
+	    	  TextMessage tm = (TextMessage)durable.receive(1000);
+	    	  assertNotNull(tm);
+	    	  s.commit();
+	    	  System.out.println(tm.getText());
+	    	  assertEquals("k" + i, tm.getText());
+	      }
+
+
+	   }
+
+	}




More information about the jboss-cvs-commits mailing list