[jboss-cvs] JBoss Messaging SVN: r1958 - branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/server/plugin.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jan 11 11:55:42 EST 2007
Author: clebert.suconic at jboss.com
Date: 2007-01-11 11:55:40 -0500 (Thu, 11 Jan 2007)
New Revision: 1958
Modified:
branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/server/plugin/JDBCChannelMapperTest.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-741
Modified: branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/server/plugin/JDBCChannelMapperTest.java
===================================================================
--- branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/server/plugin/JDBCChannelMapperTest.java 2007-01-11 12:55:47 UTC (rev 1957)
+++ branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/server/plugin/JDBCChannelMapperTest.java 2007-01-11 16:55:40 UTC (rev 1958)
@@ -108,6 +108,54 @@
super.tearDown();
}
+ // I had to place this test as the firs one one the list..
+ // it's dependent on the channelMapper empty..
+ // It won't affect the other tests
+ public void testSendRedeployAndConsume() throws Throwable
+ {
+ /* Deploy 'paradise' as destination queue */
+ channelMapper.deployCoreDestination(true, "paradise", ms, pm, null, 100, 20, 10);
+ /* Deploy 'earth' as queue to reply to */
+ channelMapper.deployCoreDestination(true, "earth", ms, pm, null, 100, 20, 10);
+
+ Channel channel = new SimpleChannel(0, ms);
+ /* Create a message for 'paradise' queue destination */
+ Message[] m = createMessages(1);
+ List refs = new ArrayList();
+ MessageReference ref1 = ms.reference(m[0]);
+
+ ref1.setOrdering(11);
+ refs.add(ref1);
+
+ /* We persist the message */
+ pm.addReferences(channel.getChannelID(), refs, false);
+
+ /* Delete the message from memory so that on redeployment, messaging is forced
+ * to retrieve it from the database */
+ ms.forgetMessage(0);
+
+ log.info("********************** UnDeploying coreDestination");
+ channelMapper.undeployCoreDestination(true, "paradise");
+ channelMapper.undeployCoreDestination(true, "earth");
+
+ log.info("********************** Deploying coreDestination");
+
+ /* We redeploy the target destination which will load the message from the database */
+ channelMapper.deployCoreDestination(true, "paradise", ms, pm, null, 100, 20, 10);
+
+ JBossDestination jd = channelMapper.getJBossDestination(0);
+ Queue q = (Queue) channelMapper.getCoreDestination(jd);
+
+ /* Browse the pending messages */
+ List l = q.browse();
+ JBossTextMessage message = (JBossTextMessage)l.get(0);
+ /* Browse the pending messages. There's only one and its destination should not be
+ * null, in fact, it should be 'paradise' */
+ assertNotNull(message.getJMSDestination());
+ assertEquals("Destination should be 'paradise'","paradise",
+ ((JBossDestination)message.getJMSDestination()).getName());
+ }
+
public void testCreateGetRemoveDurableSubscription() throws Exception
{
String topicName = new GUID().toString();
@@ -349,51 +397,6 @@
assertEquals(cd4.getId(), cd2.getId());
}
- public void testSendRedeployAndConsume() throws Throwable
- {
- /* Deploy 'paradise' as destination queue */
- channelMapper.deployCoreDestination(true, "paradise", ms, pm, null, 100, 20, 10);
- /* Deploy 'earth' as queue to reply to */
- channelMapper.deployCoreDestination(true, "earth", ms, pm, null, 100, 20, 10);
-
- Channel channel = new SimpleChannel(0, ms);
- /* Create a message for 'paradise' queue destination */
- Message[] m = createMessages(1);
- List refs = new ArrayList();
- MessageReference ref1 = ms.reference(m[0]);
-
- ref1.setOrdering(11);
- refs.add(ref1);
-
- /* We persist the message */
- pm.addReferences(channel.getChannelID(), refs, false);
-
- /* Delete the message from memory so that on redeployment, messaging is forced
- * to retrieve it from the database */
- ms.forgetMessage(0);
-
- log.info("********************** UnDeploying coreDestination");
- channelMapper.undeployCoreDestination(true, "paradise");
- channelMapper.undeployCoreDestination(true, "earth");
-
- log.info("********************** Deploying coreDestination");
-
- /* We redeploy the target destination which will load the message from the database */
- channelMapper.deployCoreDestination(true, "paradise", ms, pm, null, 100, 20, 10);
-
- JBossDestination jd = channelMapper.getJBossDestination(0);
- Queue q = (Queue) channelMapper.getCoreDestination(jd);
-
- /* Browse the pending messages */
- List l = q.browse();
- JBossTextMessage message = (JBossTextMessage)l.get(0);
- /* Browse the pending messages. There's only one and its destination should not be
- * null, in fact, it should be 'paradise' */
- assertNotNull(message.getJMSDestination());
- assertEquals("Destination should be 'paradise'","paradise",
- ((JBossDestination)message.getJMSDestination()).getName());
- }
-
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
More information about the jboss-cvs-commits
mailing list