diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/channel/MessageChannelTemplateTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/channel/MessageChannelTemplateTests.java index eb8dfe68f5..0248617913 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/channel/MessageChannelTemplateTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/channel/MessageChannelTemplateTests.java @@ -67,7 +67,12 @@ public class MessageChannelTemplateTests { @After public void tearDown() { - context.stop(); + try { + context.stop(); + } + catch (Exception e) { + // ignore + } } @Test diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/PollingEndpointErrorHandlingTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/PollingEndpointErrorHandlingTests.java index 39991a585f..2076acf8c1 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/PollingEndpointErrorHandlingTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/PollingEndpointErrorHandlingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,32 +13,33 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.integration.endpoint; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import org.junit.Test; + import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.integration.channel.PollableChannel; import org.springframework.integration.core.Message; import org.springframework.integration.message.ErrorMessage; /** - * * @author Jonas Partner - * */ public class PollingEndpointErrorHandlingTests { - - @SuppressWarnings("unchecked") + @Test - public void checkExcpetionPlacedOnErrorChannel() { + @SuppressWarnings("unchecked") + public void checkExceptionPlacedOnErrorChannel() { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "pollingEndpointErrorHandlingTests.xml", this.getClass()); PollableChannel errorChannel = (PollableChannel) context.getBean("errorChannel"); Message errorMessage = errorChannel.receive(5000); assertNotNull("No error message received", errorMessage); - assertEquals("Message recevied was not an ErrorMessage" ,ErrorMessage.class,errorMessage.getClass()); + assertEquals("Message received was not an ErrorMessage", ErrorMessage.class,errorMessage.getClass()); } } diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/PollingEndpointStub.java b/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/PollingEndpointStub.java index 63ca48dcb6..fbe2b4bb31 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/PollingEndpointStub.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/PollingEndpointStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,13 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.integration.endpoint; +/** + * @author Jonas Partner + */ public class PollingEndpointStub extends AbstractPollingEndpoint { @Override protected boolean doPoll() { - throw new RuntimeException("Poll failed"); + throw new RuntimeException("intentional test failure"); } }