1 22 package org.jboss.ejb3.test.jca.inflow; 23 24 import javax.resource.spi.endpoint.MessageEndpoint ; 25 26 import org.jboss.logging.Logger; 27 28 34 public class TestResourceAdapterInflow 35 { 36 private static final Logger log = Logger.getLogger(TestResourceAdapterInflow.class); 37 38 TestResourceAdapter adapter; 39 public TestResourceAdapterInflow(TestResourceAdapter adapter) 40 { 41 this.adapter = adapter; 42 } 43 44 public TestResourceAdapterInflowResults run() throws Exception 45 { 46 TestResourceAdapterInflowResults results = new TestResourceAdapterInflowResults(); 47 try 48 { 49 basicTest(); 50 results.basicTest.pass(); 51 } 52 catch (Throwable t) 53 { 54 results.basicTest.fail(t); 55 } 56 57 return results; 58 } 59 60 public void basicTest() throws Exception 61 { 62 MessageEndpoint endpoint = adapter.getEndpoint("testInflow"); 63 if (endpoint == null) 64 throw new Exception ("Null endpoint"); 65 TestMessage message = new TestMessage(); 66 67 ((TestMessageListener) endpoint).deliverMessage(message); 68 if (message.acknowledged == false) 69 throw new Exception ("MDB did not acknowledge the message"); 70 } 71 } 72 | Popular Tags |