From ad4d94560baaffcd4f80782437c13ce03a409cf3 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Thu, 9 Oct 2008 13:57:43 +0000 Subject: [PATCH] CronTrigger expressions may now contain any amount of whitespace between fields. Also, removed inaccessible core TestUtils dependency from the mail module. --- .../integration/mail/SubscribableMailSourceTests.java | 5 +++-- .../integration/scheduling/CronSequenceGenerator.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/org.springframework.integration.mail/src/test/java/org/springframework/integration/mail/SubscribableMailSourceTests.java b/org.springframework.integration.mail/src/test/java/org/springframework/integration/mail/SubscribableMailSourceTests.java index 13f16ec8e1..246e6ab094 100644 --- a/org.springframework.integration.mail/src/test/java/org/springframework/integration/mail/SubscribableMailSourceTests.java +++ b/org.springframework.integration.mail/src/test/java/org/springframework/integration/mail/SubscribableMailSourceTests.java @@ -26,10 +26,11 @@ import javax.mail.internet.MimeMessage; import org.easymock.classextension.EasyMock; import org.junit.Test; +import org.springframework.core.task.SimpleAsyncTaskExecutor; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.message.Message; +import org.springframework.integration.scheduling.SimpleTaskScheduler; import org.springframework.integration.scheduling.TaskScheduler; -import org.springframework.integration.util.TestUtils; /** * @author Jonas Partner @@ -41,7 +42,7 @@ public class SubscribableMailSourceTests { javax.mail.Message message = EasyMock.createMock(MimeMessage.class); StubFolderConnection folderConnection = new StubFolderConnection(message); QueueChannel channel = new QueueChannel(); - TaskScheduler scheduler = TestUtils.createTaskScheduler(5); + TaskScheduler scheduler = new SimpleTaskScheduler(new SimpleAsyncTaskExecutor()); scheduler.start(); ListeningMailSource mailSource = new ListeningMailSource(folderConnection); mailSource.setTaskScheduler(scheduler); diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/CronSequenceGenerator.java b/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/CronSequenceGenerator.java index 56cb676f32..6e6c07b9a7 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/CronSequenceGenerator.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/CronSequenceGenerator.java @@ -63,7 +63,7 @@ public class CronSequenceGenerator { /** * Construct a {@link CronSequenceGenerator} from the pattern provided. * - * @param pattern a single space separated list of time fields + * @param pattern a space separated list of time fields * * @throws IllegalArgumentException if the pattern cannot be parsed */ @@ -175,7 +175,7 @@ public class CronSequenceGenerator { * @param expression */ private void parse(String expression) throws IllegalArgumentException { - String[] fields = StringUtils.delimitedListToStringArray(expression, " "); + String[] fields = StringUtils.tokenizeToStringArray(expression, " "); if (fields.length != 6) { throw new IllegalArgumentException(String.format("Expression must consist of 6 fields (found %d in %s)", fields.length, expression));