1 22 package org.jboss.test.messagedriven.support; 23 24 import java.util.Properties ; 25 26 import javax.management.ObjectName ; 27 28 34 public abstract class SimpleMessageDrivenUnitTest extends BasicMessageDrivenUnitTest 35 { 36 public SimpleMessageDrivenUnitTest(String name, ObjectName jmxDestination, Properties defaultProps) 37 { 38 super(name, jmxDestination, defaultProps); 39 } 40 41 public void testSimpleRequired() throws Exception 42 { 43 runTest(getOperations(), defaultProps); 44 } 45 46 public void testSimpleNotSupported() throws Exception 47 { 48 Properties props = (Properties ) defaultProps.clone(); 49 props.put("transactionAttribute", "NotSupported"); 50 runTest(getOperations(), props); 51 } 52 53 public void testSimpleBMT() throws Exception 54 { 55 Properties props = (Properties ) defaultProps.clone(); 56 props.put("transactionType", "Bean"); 57 runTest(getOperations(), props); 58 } 59 60 public void testSimpleDLQ() throws Exception 61 { 62 Properties props = (Properties ) defaultProps.clone(); 63 props.put("rollback", "DLQ"); 64 runTest(getDLQOperations(), props); 65 } 66 67 public Operation[] getOperations() throws Exception 68 { 69 return new Operation[] 70 { 71 new SendMessageOperation(this, "1"), 72 new CheckMessageSizeOperation(this, 1, 0), 73 new CheckJMSDestinationOperation(this, 0, getDestination().toString()), 74 new CheckMessageIDOperation(this, 0, "1"), 75 }; 76 } 77 78 public Operation[] getDLQOperations() throws Exception 79 { 80 return new Operation[] 81 { 82 new SendMessageOperation(this, "1"), 83 new CheckMessageSizeOperation(this, 7, 0), 84 new CheckJMSDestinationOperation(this, 0, getDestination().toString()), 85 new CheckJMSDestinationOperation(this, 1, getDestination().toString()), 86 new CheckJMSDestinationOperation(this, 2, getDestination().toString()), 87 new CheckJMSDestinationOperation(this, 3, getDestination().toString()), 88 new CheckJMSDestinationOperation(this, 4, getDestination().toString()), 89 new CheckJMSDestinationOperation(this, 5, getDestination().toString()), 90 new CheckJMSDestinationOperation(this, 6, getDLQDestination().toString()), 91 new CheckMessageIDOperation(this, 0, "1"), 92 new CheckMessageIDOperation(this, 1, "1"), 93 new CheckMessageIDOperation(this, 2, "1"), 94 new CheckMessageIDOperation(this, 3, "1"), 95 new CheckMessageIDOperation(this, 4, "1"), 96 new CheckMessageIDOperation(this, 5, "1"), 97 new CheckMessageIDOperation(this, 6, "1") 98 }; 99 } 100 } 101 | Popular Tags |