Testing the Message-Driven Bean

Testing a message-driven bean is similar to testing a session or entity bean. You must develop a client; a client needs to produce a message to the queue. In this case, our program will be a console-based application (see Listing 24.5).

Listing 24.5. Client Test Application (MessageClient.java)
package messagebean; 

import javax.jms.*; 
import javax.naming.*; 

/** 
 * <p>Title: </p> 
 * <p>Description: </p> 
 * <p>Copyright: Copyright (c) 2002</p> 
 * <p>Company: </p> 
 * @author unascribed 
 * @version 1.0 
 */ public class MessageClient { public static void main(String[] args) { Context cntx = null; QueueConnectionFactory qcf = null; QueueConnection qcon = null; QueueSession qses = null; Queue q = null; QueueSender qs = null; ...

Get Borland® JBuilder™ Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.