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