[Jboss-cvs] JBoss Messaging SVN: r1186 - in trunk: . tests tests/src/org/jboss/test/messaging/jms
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Aug 3 15:38:54 EDT 2006
Author: ovidiu.feodorov at jboss.com
Date: 2006-08-03 15:38:52 -0400 (Thu, 03 Aug 2006)
New Revision: 1186
Modified:
trunk/
trunk/messaging.iml
trunk/tests/build.xml
trunk/tests/src/org/jboss/test/messaging/jms/CTSMiscellaneousTest.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-485
Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
- output
thirdparty
+ output
thirdparty
messaging.iws
Modified: trunk/messaging.iml
===================================================================
--- trunk/messaging.iml 2006-08-03 19:35:10 UTC (rev 1185)
+++ trunk/messaging.iml 2006-08-03 19:38:52 UTC (rev 1186)
@@ -143,6 +143,24 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/junit/lib/junit.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/oswego-concurrent/lib/concurrent.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: trunk/tests/build.xml
===================================================================
--- trunk/tests/build.xml 2006-08-03 19:35:10 UTC (rev 1185)
+++ trunk/tests/build.xml 2006-08-03 19:38:52 UTC (rev 1186)
@@ -128,6 +128,10 @@
<pathelement path="${jboss.mbeans.lib}/jboss-mbeans.jar"/>
</path>
+ <path id="jboss.naming.classpath">
+ <pathelement path="${jboss.naming.lib}/jnp-client.jar"/>
+ </path>
+
<!--
JDBC Drivers.
-->
@@ -163,7 +167,6 @@
-->
<path id="test.execution.classpath">
- <pathelement location="../lib/jnp-client.jar"/>
<pathelement location="${tests.root}/etc"/>
<pathelement location="${build.tests.classes}"/>
<pathelement location="${project.root}/src/etc"/> <!-- server's configuration files -->
@@ -172,6 +175,7 @@
<path refid="apache.log4j.classpath"/>
<path refid="apache.xerces.classpath"/>
<path refid="jboss.mbeans.classpath"/>
+ <path refid="jboss.naming.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
<path refid="mysql.jdbc.driver.classpath"/>
<path refid="oracle.jdbc.driver.classpath"/>
Modified: trunk/tests/src/org/jboss/test/messaging/jms/CTSMiscellaneousTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/CTSMiscellaneousTest.java 2006-08-03 19:35:10 UTC (rev 1185)
+++ trunk/tests/src/org/jboss/test/messaging/jms/CTSMiscellaneousTest.java 2006-08-03 19:38:52 UTC (rev 1186)
@@ -209,185 +209,99 @@
}
}
- /*
- * I don't think this test is valid since it assumes the message is going to go cons2 on rollback-
- * whereas in reality the point to point router will give it to the first available consumer
- * which in this case is cons, not cons2.
- */
- public void testContestedQueueOnRollback() throws Exception
- {
- ConnectionFactory cf = (JBossConnectionFactory)ic.lookup("/ConnectionFactory");
- Queue queue = (Queue)ic.lookup("/queue/Queue");
+ // Temporarily commented out. See http://jira.jboss.org/jira/browse/JBMESSAGING-485
- Connection c = cf.createConnection();
- try
- {
- Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
- TextMessage tm = s.createTextMessage("blah");
- s.createProducer(queue).send(tm);
- }
- finally
- {
- c.close();
- }
+// public void testContestedQueueOnRollback() throws Exception
+// {
+// ConnectionFactory cf = (JBossConnectionFactory)ic.lookup("/ConnectionFactory");
+// Queue queue = (Queue)ic.lookup("/queue/Queue");
+//
+// Connection c = cf.createConnection();
+// try
+// {
+// Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
+// TextMessage tm = s.createTextMessage("blah");
+// s.createProducer(queue).send(tm);
+// }
+// finally
+// {
+// c.close();
+// }
+//
+// // message is in the queue
+// log.debug("message is in the queue");
+//
+// c = cf.createConnection();
+// c.start();
+//
+// try
+// {
+// Session s = c.createSession(true, Session.SESSION_TRANSACTED);
+// MessageConsumer cons = s.createConsumer(queue);
+//
+// Session s2 = c.createSession(true, Session.SESSION_TRANSACTED);
+// final MessageConsumer cons2 = s2.createConsumer(queue);
+//
+// Session sessionToRollback = s;
+// MessageConsumer cc = cons2;
+// TextMessage rm = (TextMessage)cons.receiveNoWait();
+//
+// if (rm == null)
+// {
+// sessionToRollback = s2;
+// cc = cons;
+// rm = (TextMessage)cons.receiveNoWait();
+// }
+//
+// assertEquals("blah", rm.getText());
+//
+// final Slot slot = new Slot();
+// final MessageConsumer contestingConsumer = cc;
+//
+// new Thread(new Runnable()
+// {
+// public void run()
+// {
+// try
+// {
+// log.debug("contester blocking to receive");
+// Message m = contestingConsumer.receive(8000);
+// log.debug("contester received " + m);
+//
+// if (m != null)
+// {
+// // if I receive a message, unlock the slot
+// slot.put(m);
+// }
+// }
+// catch(Exception e)
+// {
+// log.error("contested receive failed", e);
+// }
+// }
+// }, "Contester Thread").start();
+//
+// // wait for the contested thread to start receiving
+// Thread.sleep(2000);
+//
+// // send the message back to the queue
+// log.debug("rolling back");
+// sessionToRollback.rollback();
+// log.debug("rolled back");
+//
+// // wait for the contester to receive
+// TextMessage rm2 = (TextMessage)slot.poll(5000);
+//
+// assertEquals("blah", rm2.getText());
+// }
+// finally
+// {
+// log.debug("closing connection");
+// c.close();
+// }
+// }
- // message is in the queue
- log.debug("message is in the queue");
- c = cf.createConnection();
- c.start();
-
- try
- {
- Session s = c.createSession(true, Session.SESSION_TRANSACTED);
- MessageConsumer cons = s.createConsumer(queue);
-
- Session s2 = c.createSession(true, Session.SESSION_TRANSACTED);
- final MessageConsumer cons2 = s2.createConsumer(queue);
-
- TextMessage rm = (TextMessage)cons.receive();
-
- assertEquals("blah", rm.getText());
-
- final Slot slot = new Slot();
-
- new Thread(new Runnable()
- {
- public void run()
- {
- try
- {
- log.debug("contester blocking to receive");
- Message m = cons2.receive(8000);
- log.debug("contester received " + m);
-
- if (m != null)
- {
- // if I receive a message, unlock the slot
- slot.put(m);
- }
- }
- catch(Exception e)
- {
- log.error("contested receive failed", e);
- }
- }
- }, "Contester Thread").start();
-
- // wait for the contested thread to start receiving
- Thread.sleep(2000);
-
- // send the message back to the queue
- log.debug("rolling back");
- s.rollback();
- log.debug("rolled back");
-
- // wait for the contester to receive
- TextMessage rm2 = (TextMessage)slot.poll(5000);
-
- assertEquals("blah", rm2.getText());
- }
- finally
- {
- c.close();
- }
-
-
- }
-
- public void testContestedQueueOnRollback2() throws Exception
- {
- ConnectionFactory cf = (JBossConnectionFactory)ic.lookup("/ConnectionFactory");
- Queue queue = (Queue)ic.lookup("/queue/Queue");
-
- Connection c = cf.createConnection();
- try
- {
- Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
- TextMessage tm = s.createTextMessage("blah");
- s.createProducer(queue).send(tm);
- }
- finally
- {
- c.close();
- }
-
- // message is in the queue
- log.debug("message is in the queue");
-
- c = cf.createConnection();
- c.start();
-
- try
- {
- Session s = c.createSession(true, Session.SESSION_TRANSACTED);
- MessageConsumer cons = s.createConsumer(queue);
-
- Session s2 = c.createSession(true, Session.SESSION_TRANSACTED);
- final MessageConsumer cons2 = s2.createConsumer(queue);
-
- Session sessionToRollback = s;
- MessageConsumer cc = cons2;
- TextMessage rm = (TextMessage)cons.receiveNoWait();
-
- if (rm == null)
- {
- sessionToRollback = s2;
- cc = cons;
- rm = (TextMessage)cons.receiveNoWait();
- }
-
- assertEquals("blah", rm.getText());
-
- final Slot slot = new Slot();
- final MessageConsumer contestingConsumer = cc;
-
- new Thread(new Runnable()
- {
- public void run()
- {
- try
- {
- log.debug("contester blocking to receive");
- Message m = contestingConsumer.receive(8000);
- log.debug("contester received " + m);
-
- if (m != null)
- {
- // if I receive a message, unlock the slot
- slot.put(m);
- }
- }
- catch(Exception e)
- {
- log.error("contested receive failed", e);
- }
- }
- }, "Contester Thread").start();
-
- // wait for the contested thread to start receiving
- Thread.sleep(2000);
-
- // send the message back to the queue
- log.debug("rolling back");
- sessionToRollback.rollback();
- log.debug("rolled back");
-
- // wait for the contester to receive
- TextMessage rm2 = (TextMessage)slot.poll(5000);
-
- assertEquals("blah", rm2.getText());
- }
- finally
- {
- log.debug("closing connection");
- c.close();
- }
-
-
- }
-
-
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
More information about the jboss-cvs-commits
mailing list