[jboss-cvs] JBossAS SVN: r61349 - in branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test: invalidtxmdb/unit and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Mar 15 15:14:49 EDT 2007
Author: bdecoste
Date: 2007-03-15 15:14:49 -0400 (Thu, 15 Mar 2007)
New Revision: 61349
Modified:
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/descriptortypo/unit/TypoTestCase.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/invalidtxmdb/unit/MDBUnitTestCase.java
Log:
[EJBTHREE-831][EJBTHREE-897] fixed exception handling in tests
Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/descriptortypo/unit/TypoTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/descriptortypo/unit/TypoTestCase.java 2007-03-15 19:07:04 UTC (rev 61348)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/descriptortypo/unit/TypoTestCase.java 2007-03-15 19:14:49 UTC (rev 61349)
@@ -53,7 +53,7 @@
StatefulRemote sfsb = (StatefulRemote)jndiContext.lookup("StatefulBean/remote");
fail("StatefulBean should not have deployed");
}
- catch (Exception e)
+ catch (javax.naming.NameNotFoundException e)
{
}
@@ -62,7 +62,7 @@
StatelessRemote slsb = (StatelessRemote)jndiContext.lookup("StatelessBean/remote");
fail("StatelessBean should not have deployed");
}
- catch (Exception e)
+ catch (javax.naming.NameNotFoundException e)
{
}
}
Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/invalidtxmdb/unit/MDBUnitTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/invalidtxmdb/unit/MDBUnitTestCase.java 2007-03-15 19:07:04 UTC (rev 61348)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/invalidtxmdb/unit/MDBUnitTestCase.java 2007-03-15 19:14:49 UTC (rev 61349)
@@ -21,12 +21,8 @@
*/
package org.jboss.ejb3.test.invalidtxmdb.unit;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.TextMessage;
+
import javax.naming.InitialContext;
import javax.naming.NamingException;
@@ -51,26 +47,14 @@
public void testQueue() throws Exception
{
- TestStatus status = (TestStatus) getInitialContext().lookup(
- "TestStatusBean/remote");
- QueueConnection cnn = null;
- QueueSender sender = null;
- QueueSession session = null;
-
- Queue queue = (Queue) getInitialContext().lookup("queue/mdbtest");
- QueueConnectionFactory factory = getQueueConnectionFactory();
- cnn = factory.createQueueConnection();
- session = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
-
- TextMessage msg = session.createTextMessage("Hello World");
-
- sender = session.createSender(queue);
- sender.send(msg);
- session.close();
- cnn.close();
-
- Thread.sleep(2000);
- assertEquals(0, status.queueFired());
+ try
+ {
+ TestStatus status = (TestStatus) getInitialContext().lookup("TestStatusBean/remote");
+ fail("TestStatusBean should not have deployed");
+ }
+ catch (javax.naming.NameNotFoundException e)
+ {
+ }
}
protected QueueConnectionFactory getQueueConnectionFactory()
More information about the jboss-cvs-commits
mailing list