From 4663862ea6e2c7f017594ec18ebf7cdf307ae601 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Tue, 11 Jul 2017 11:52:11 -0400 Subject: [PATCH] Resolve deprecations since the latest SF --- ...SourcePersistentFilterIntegrationTests.java | 18 +++++++++--------- ...layerHandlerRescheduleIntegrationTests.java | 5 +++-- ...layerHandlerRescheduleIntegrationTests.java | 6 +++--- ...OutboundChannelAdapterWithinChainTests.java | 5 +++-- ...layerHandlerRescheduleIntegrationTests.java | 5 +++-- ...layerHandlerRescheduleIntegrationTests.java | 5 +++-- 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/FileReadingMessageSourcePersistentFilterIntegrationTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/FileReadingMessageSourcePersistentFilterIntegrationTests.java index a06330af98..3ac32c67e8 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/FileReadingMessageSourcePersistentFilterIntegrationTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/FileReadingMessageSourcePersistentFilterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2017 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. @@ -96,27 +96,27 @@ public class FileReadingMessageSourcePersistentFilterIntegrationTests { @Test public void configured() throws Exception { - DirectFieldAccessor accessor = new DirectFieldAccessor(pollableFileSource); + DirectFieldAccessor accessor = new DirectFieldAccessor(this.pollableFileSource); assertEquals(inputDir, accessor.getPropertyValue("directory")); } @Test public void getFiles() throws Exception { - Message received1 = pollableFileSource.receive(); + Message received1 = this.pollableFileSource.receive(); assertNotNull("This should return the first message", received1); - Message received2 = pollableFileSource.receive(); + Message received2 = this.pollableFileSource.receive(); assertNotNull(received2); - Message received3 = pollableFileSource.receive(); + Message received3 = this.pollableFileSource.receive(); assertNotNull(received3); assertNotSame(received1 + " == " + received2, received1.getPayload(), received2.getPayload()); assertNotSame(received1 + " == " + received3, received1.getPayload(), received3.getPayload()); assertNotSame(received2 + " == " + received3, received2.getPayload(), received3.getPayload()); - this.context.destroy(); + this.context.close(); - this.loadContextAndGetMessageSource(); - Message received4 = pollableFileSource.receive(); + loadContextAndGetMessageSource(); + Message received4 = this.pollableFileSource.receive(); assertNull(received4); - this.context.destroy(); + this.context.close(); } } diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/DelayerHandlerRescheduleIntegrationTests.java b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/DelayerHandlerRescheduleIntegrationTests.java index 4f7646ec85..f81564afed 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/DelayerHandlerRescheduleIntegrationTests.java +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/DelayerHandlerRescheduleIntegrationTests.java @@ -50,6 +50,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; /** * @author Artem Bilan * @author Gary Russell + * * @since 3.0 */ public class DelayerHandlerRescheduleIntegrationTests { @@ -100,7 +101,7 @@ public class DelayerHandlerRescheduleIntegrationTests { (ThreadPoolTaskScheduler) IntegrationContextUtils.getTaskScheduler(context); taskScheduler.shutdown(); taskScheduler.getScheduledExecutor().awaitTermination(10, TimeUnit.SECONDS); - context.destroy(); + context.close(); try { context.getBean("input", MessageChannel.class); @@ -144,7 +145,7 @@ public class DelayerHandlerRescheduleIntegrationTests { } assertEquals(0, messageStore.messageGroupSize(delayerMessageGroupId)); - context.destroy(); + context.close(); } } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/DelayerHandlerRescheduleIntegrationTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/DelayerHandlerRescheduleIntegrationTests.java index 143c388562..3b5768a057 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/DelayerHandlerRescheduleIntegrationTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/DelayerHandlerRescheduleIntegrationTests.java @@ -100,7 +100,7 @@ public class DelayerHandlerRescheduleIntegrationTests { (ThreadPoolTaskScheduler) IntegrationContextUtils.getTaskScheduler(context); taskScheduler.shutdown(); taskScheduler.getScheduledExecutor().awaitTermination(10, TimeUnit.SECONDS); - context.destroy(); + context.close(); try { context.getBean("input", MessageChannel.class); @@ -143,7 +143,7 @@ public class DelayerHandlerRescheduleIntegrationTests { assertEquals(1, messageStore.getMessageGroupCount()); assertEquals(0, messageStore.messageGroupSize(delayerMessageGroupId)); - context.destroy(); + context.close(); } @Test //INT-2649 @@ -163,7 +163,7 @@ public class DelayerHandlerRescheduleIntegrationTests { assertEquals(1, messageStore.messageGroupSize(delayerMessageGroupId)); //To check that 'rescheduling' works in the transaction boundaries too - context.destroy(); + context.close(); context.refresh(); assertTrue(RollbackTxSync.latch.await(20, TimeUnit.SECONDS)); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundChannelAdapterWithinChainTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundChannelAdapterWithinChainTests.java index 0ec6fcd0af..d172779de9 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundChannelAdapterWithinChainTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundChannelAdapterWithinChainTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2017 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. @@ -36,6 +36,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * @author Artem Bilan + * * @since 2.2 */ @ContextConfiguration @@ -65,7 +66,7 @@ public class StoredProcOutboundChannelAdapterWithinChainTests { assertEquals("Wrong email", "email", map.get("EMAIL")); // embeddedDatabase can be in working state. So other tests with the same embeddedDatabase beanId, type and init scripts // may be failed with Exception like: object in the DB already exists - this.context.destroy(); + this.context.close(); } } diff --git a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/DelayerHandlerRescheduleIntegrationTests.java b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/DelayerHandlerRescheduleIntegrationTests.java index cae21481c5..c1a3dda550 100644 --- a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/DelayerHandlerRescheduleIntegrationTests.java +++ b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/DelayerHandlerRescheduleIntegrationTests.java @@ -46,6 +46,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; /** * @author Artem Bilan + * * @since 3.0 */ public class DelayerHandlerRescheduleIntegrationTests extends MongoDbAvailableTests { @@ -104,7 +105,7 @@ public class DelayerHandlerRescheduleIntegrationTests extends MongoDbAvailableTe .getOriginal(); assertThat(message1, Matchers.anyOf(Matchers.is(original1), Matchers.is(original2))); - context.destroy(); + context.close(); context.refresh(); @@ -123,7 +124,7 @@ public class DelayerHandlerRescheduleIntegrationTests extends MongoDbAvailableTe messageStore = context.getBean("messageStore", MessageGroupStore.class); assertEquals(0, messageStore.messageGroupSize(delayerMessageGroupId)); - context.destroy(); + context.close(); } } diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/store/DelayerHandlerRescheduleIntegrationTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/store/DelayerHandlerRescheduleIntegrationTests.java index dfc12d53a9..4d07b5285f 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/store/DelayerHandlerRescheduleIntegrationTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/store/DelayerHandlerRescheduleIntegrationTests.java @@ -47,6 +47,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; /** * @author Artem Bilan * @author Gary Russell + * * @since 3.0 */ public class DelayerHandlerRescheduleIntegrationTests extends RedisAvailableTests { @@ -83,7 +84,7 @@ public class DelayerHandlerRescheduleIntegrationTests extends RedisAvailableTest (ThreadPoolTaskScheduler) IntegrationContextUtils.getTaskScheduler(context); taskScheduler.shutdown(); taskScheduler.getScheduledExecutor().awaitTermination(10, TimeUnit.SECONDS); - context.destroy(); + context.close(); try { context.getBean("input", MessageChannel.class); @@ -128,7 +129,7 @@ public class DelayerHandlerRescheduleIntegrationTests extends RedisAvailableTest assertEquals(0, messageStore.messageGroupSize(delayerMessageGroupId)); messageStore.removeMessageGroup(delayerMessageGroupId); - context.destroy(); + context.close(); } }