1 22 package org.jboss.test.messagedriven.support; 23 24 30 public class CheckMessageSizeOperation extends Operation 31 { 32 protected int size; 33 protected long wait; 34 35 public CheckMessageSizeOperation(BasicMessageDrivenUnitTest test, int size, long wait) 36 { 37 super(test); 38 this.size = size; 39 } 40 41 public void run() throws Exception  42 { 43 test.waitMessages(size, wait); 44 int actual = test.getMessages().size(); 45 if (actual != size) 46 throw new Exception ("Wrong number of messages, expected=" + size + " got=" + actual); 47 } 48 } 49 | Popular Tags |