Skip to content

Commit

Permalink
Merge pull request spring-projects#84 from ghillert/INTSAMPLES-102-2
Browse files Browse the repository at this point in the history
INTSAMPLES-102 - Fix intermittently failing tests
  • Loading branch information
ghillert committed Jan 11, 2013
2 parents 7928871 + f6e4f4d commit 9759373
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@

import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.support.converter.SimpleMessageConverter;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@DirtiesContext(classMode=ClassMode.AFTER_EACH_TEST_METHOD)
public class JmsMockTests {

private static final Logger LOGGER = Logger.getLogger(JmsMockTests.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.net.UnknownHostException;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
Expand All @@ -38,7 +38,7 @@ public class FtpOutboundChannelAdapterSample {

@Test
public void runDemo() throws Exception{
ApplicationContext ctx =
ConfigurableApplicationContext ctx =
new ClassPathXmlApplicationContext("META-INF/spring/integration/DynamicFtpOutboundChannelAdapterSample-context.xml");
MessageChannel channel = ctx.getBean("toDynRouter", MessageChannel.class);
File file = File.createTempFile("temp", "txt");
Expand Down Expand Up @@ -89,5 +89,7 @@ public void runDemo() throws Exception{
assertTrue(e.getCause().getCause() instanceof UnknownHostException);
assertEquals("host.for.cust1", e.getCause().getCause().getMessage());
}

ctx.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void runDemo() throws Exception{
assertNotNull(message2);
assertNull("Was NOT expecting a third message.", message3);

ctx.close();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public void testLsGetRm() throws Exception {

assertTrue("Expected FTP remote directory to be empty", new File(TestSuite.FTP_ROOT_DIR).delete());

ctx.close();
}

}

0 comments on commit 9759373

Please sign in to comment.