INT-1719 added delivery-persistent attribute to outbound-gateway, deprecated delivery-mode

This commit is contained in:
Oleg Zhurakousky
2011-01-20 16:58:47 -05:00
parent c3ea9d279a
commit 2cc182a667
3 changed files with 61 additions and 2 deletions

View File

@@ -24,8 +24,11 @@ import static org.mockito.Mockito.verify;
import java.util.Properties;
import javax.jms.DeliveryMode;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
@@ -47,6 +50,18 @@ import org.springframework.jms.support.converter.MessageConverter;
* @author Oleg Zhurakousky
*/
public class JmsOutboundGatewayParserTests {
@Test
public void testWithDelivertPersistentAttribute(){
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
"jmsOutboundGatewayWithDeliveryPersistent.xml", this.getClass());
EventDrivenConsumer endpoint = (EventDrivenConsumer) context.getBean("jmsGateway");
DirectFieldAccessor accessor = new DirectFieldAccessor(endpoint);
JmsOutboundGateway gateway = (JmsOutboundGateway) accessor.getPropertyValue("handler");
accessor = new DirectFieldAccessor(gateway);
int deliveryMode = (Integer)accessor.getPropertyValue("deliveryMode");
assertEquals(DeliveryMode.PERSISTENT, deliveryMode);
}
@Test
public void testDefault(){