1 21 22 package org.jacorb.test.notification.engine; 23 24 import junit.framework.Test; 25 import junit.framework.TestSuite; 26 27 import org.jacorb.notification.engine.AlwaysDisposeRetryStrategy; 28 import org.jacorb.notification.engine.AbstractRetryStrategy; 29 30 34 public class AlwaysDisposeRetryStrategyTest extends AbstractRetryStrategyTest 35 { 36 41 public AlwaysDisposeRetryStrategyTest(String name) 42 { 43 super(name); 44 } 45 46 public void testRetryDisposesOperationAndConsumer() throws Exception 47 { 48 mockConsumer_.isRetryAllowed(); 49 controlConsumer_.setDefaultReturnValue(true); 50 51 mockConsumer_.destroy(); 52 controlConsumer_.replay(); 53 54 mockPushOperation_.dispose(); 55 controlPushOperation_.replay(); 56 57 objectUnderTest_.retry(); 58 59 controlConsumer_.verify(); 60 controlPushOperation_.verify(); 61 } 62 63 public void testRetryAllowedDisposesPushOperation() throws Exception 64 { 65 mockPushOperation_.dispose(); 66 67 controlPushOperation_.replay(); 68 69 mockConsumer_.isRetryAllowed(); 70 controlConsumer_.setDefaultReturnValue(true); 71 72 controlConsumer_.replay(); 73 74 objectUnderTest_.retry(); 75 76 controlPushOperation_.verify(); 77 } 78 79 protected void setUpTest() 80 { 81 } 83 84 protected AbstractRetryStrategy newRetryStrategy() 85 { 86 return new AlwaysDisposeRetryStrategy(mockConsumer_, mockPushOperation_); 87 } 88 89 90 public static Test suite() 91 { 92 return new TestSuite(AlwaysDisposeRetryStrategyTest.class); 93 } 94 } 95 | Popular Tags |