[jboss-cvs] JBossAS SVN: r62203 - branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Apr 10 05:39:32 EDT 2007
Author: jaroslaw.kijanowski
Date: 2007-04-10 05:39:32 -0400 (Tue, 10 Apr 2007)
New Revision: 62203
Modified:
branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support/BasicMessageDrivenUnitTest.java
branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support/JMSContainerInvokerSimpleMessageDrivenUnitTest.java
branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support/SendMessageOperation.java
Log:
backport JBAS-4247 to fix testsuite after ASPATCH-176 was applied
Modified: branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support/BasicMessageDrivenUnitTest.java
===================================================================
--- branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support/BasicMessageDrivenUnitTest.java 2007-04-10 08:53:48 UTC (rev 62202)
+++ branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support/BasicMessageDrivenUnitTest.java 2007-04-10 09:39:32 UTC (rev 62203)
@@ -1,24 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.
-*/
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.messagedriven.support;
import java.util.ArrayList;
@@ -178,6 +178,7 @@
ConnectionFactory factory = (ConnectionFactory) lookup(connectionFactoryJNDI, ConnectionFactory.class);
connection = factory.createConnection();
+ connection.setExceptionListener(this);
return connection;
}
@@ -244,6 +245,7 @@
deploy(getMDBDeployment());
try
{
+ // FIXME Need to wait for asynchrounous bootstrap of container
Thread.sleep(5000);
startReceiverThread();
}
Modified: branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support/JMSContainerInvokerSimpleMessageDrivenUnitTest.java
===================================================================
--- branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support/JMSContainerInvokerSimpleMessageDrivenUnitTest.java 2007-04-10 08:53:48 UTC (rev 62202)
+++ branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support/JMSContainerInvokerSimpleMessageDrivenUnitTest.java 2007-04-10 09:39:32 UTC (rev 62203)
@@ -1,24 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.
-*/
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.messagedriven.support;
import java.util.Properties;
@@ -35,7 +35,7 @@
*/
public abstract class JMSContainerInvokerSimpleMessageDrivenUnitTest extends SimpleMessageDrivenUnitTest
{
- protected ObjectName persistenceManager = ObjectNameFactory.create("jboss.mq:service=DestinationManager");
+ protected ObjectName persistenceManager = ObjectNameFactory.create("jboss.mq:service=PersistenceManager");
protected ObjectName mdbInvoker = ObjectNameFactory.create("jboss.j2ee:service=EJB,jndiName=TestMDB,plugin=invoker,binding=jms-container-invoker-driven-bean");
Modified: branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support/SendMessageOperation.java
===================================================================
--- branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support/SendMessageOperation.java 2007-04-10 08:53:48 UTC (rev 62202)
+++ branches/JBoss_4_0_3_SP1_CP05/testsuite/src/main/org/jboss/test/messagedriven/support/SendMessageOperation.java 2007-04-10 09:39:32 UTC (rev 62203)
@@ -1,11 +1,27 @@
/*
- * JBoss, the OpenSource J2EE webOS
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.messagedriven.support;
+import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageProducer;
@@ -29,9 +45,26 @@
public void run() throws Exception
{
- MessageProducer producer = test.getMessageProducer();
- Message message = test.getTestMessage();
- message.setStringProperty(MESSAGEID, id);
- producer.send(message);
+ int retries = 5;
+ while (true)
+ {
+ try
+ {
+ MessageProducer producer = test.getMessageProducer();
+ Message message = test.getTestMessage();
+ message.setStringProperty(MESSAGEID, id);
+ producer.send(message);
+ // DONE
+ return;
+ }
+ catch (JMSException e)
+ {
+ // Got an error, sleep then retry
+ if (retries-- > 0)
+ Thread.sleep(1000);
+ else
+ throw e;
+ }
+ }
}
}
More information about the jboss-cvs-commits
mailing list