From 7f80b7230bce52c854dcf015480dbf43267091df Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Wed, 7 Jun 2023 15:45:51 +0200 Subject: [PATCH] Remove System.err.println from tests --- .../support/JobRegistryBeanPostProcessorTests.java | 4 ++-- .../configuration/xml/ChunkElementParserTests.java | 6 +----- .../xml/StepWithSimpleTaskJobParserTests.java | 4 ++-- .../batch/core/repository/dao/DateFormatTests.java | 4 ++-- .../item/FaultTolerantStepFactoryBeanRetryTests.java | 1 - .../core/step/tasklet/AsyncTaskletStepTests.java | 2 -- .../batch/config/DatasourceTests.java | 3 +-- .../springframework/batch/config/MessagingTests.java | 3 +-- .../support/TransactionAwareListItemReaderTests.java | 4 +--- .../batch/jms/ExternalRetryInBatchTests.java | 5 ----- .../batch/repeat/jms/AsynchronousTests.java | 2 -- .../batch/repeat/listener/RepeatListenerTests.java | 3 +-- .../repeat/support/SimpleRepeatTemplateTests.java | 2 -- .../TaskExecutorRepeatTemplateAsynchronousTests.java | 2 -- ...kExecutorRepeatTemplateBulkAsynchronousTests.java | 12 ++---------- .../batch/retry/jms/SynchronousTests.java | 3 --- .../batch/support/ReflectionUtilsTests.java | 5 ++--- .../ChunkMessageItemWriterIntegrationTests.java | 3 +-- .../batch/integration/chunk/ChunkRequestTests.java | 6 ++++-- .../batch/integration/chunk/ChunkResponseTests.java | 7 +++++-- ...RemoteChunkFaultTolerantStepIntegrationTests.java | 3 +-- .../file/ResourceSplitterIntegrationTests.java | 4 ++-- ...ryRepeatTransactionalPollingIntegrationTests.java | 3 +-- .../RetryTransactionalPollingIntegrationTests.java | 3 +-- .../batch/sample/SkipSampleFunctionalTests.java | 2 -- 25 files changed, 30 insertions(+), 66 deletions(-) diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessorTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessorTests.java index 6a1a495b5..a7913ed0b 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessorTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 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. @@ -30,6 +30,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; /** * @author Dave Syer + * @author Mahmoud Ben Hassine * */ class JobRegistryBeanPostProcessorTests { @@ -103,7 +104,6 @@ class JobRegistryBeanPostProcessorTests { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("test-context.xml", getClass()); MapJobRegistry registry = (MapJobRegistry) context.getBean("registry"); Collection configurations = registry.getJobNames(); - // System.err.println(configurations); String[] names = context.getBeanNamesForType(JobSupport.class); int count = names.length; // Each concrete bean of type JobConfiguration is registered... diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkElementParserTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkElementParserTests.java index feecf382b..9e6bde205 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkElementParserTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkElementParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 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. @@ -169,7 +169,6 @@ class ChunkElementParserTests { @Test void testRetryable() throws Exception { Map, Boolean> retryable = getRetryableExceptionClasses("s1", getContext()); - System.err.println(retryable); assertEquals(3, retryable.size()); containsClassified(retryable, PessimisticLockingFailureException.class, true); containsClassified(retryable, CannotSerializeTransactionException.class, false); @@ -178,7 +177,6 @@ class ChunkElementParserTests { @Test void testRetryableInherited() throws Exception { Map, Boolean> retryable = getRetryableExceptionClasses("s3", getContext()); - System.err.println(retryable); assertEquals(2, retryable.size()); containsClassified(retryable, IOException.class, true); } @@ -186,7 +184,6 @@ class ChunkElementParserTests { @Test void testRetryableInheritedMerge() throws Exception { Map, Boolean> retryable = getRetryableExceptionClasses("s4", getContext()); - System.err.println(retryable); assertEquals(3, retryable.size()); containsClassified(retryable, IOException.class, true); } @@ -194,7 +191,6 @@ class ChunkElementParserTests { @Test void testInheritSkippable() throws Exception { Map, Boolean> skippable = getSkippableExceptionClasses("s1", getContext()); - System.err.println(skippable); assertEquals(5, skippable.size()); containsClassified(skippable, NullPointerException.class, true); containsClassified(skippable, ArithmeticException.class, true); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepWithSimpleTaskJobParserTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepWithSimpleTaskJobParserTests.java index 80db3683a..bafa0abeb 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepWithSimpleTaskJobParserTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepWithSimpleTaskJobParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 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.util.ReflectionTestUtils; /** * @author Thomas Risberg + * @author Mahmoud Ben Hassine */ @SpringJUnitConfig class StepWithSimpleTaskJobParserTests { @@ -74,7 +75,6 @@ class StepWithSimpleTaskJobParserTests { } private TestTasklet assertTasklet(Job job, String stepName, String taskletName) { - System.err.println(((FlowJob) job).getStepNames()); Step step = ((FlowJob) job).getStep(stepName); assertTrue(step instanceof TaskletStep, "Wrong type for step name=" + stepName + ": " + step); Object tasklet = ReflectionTestUtils.getField(step, "tasklet"); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/DateFormatTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/DateFormatTests.java index 261e94d6b..b485c6147 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/DateFormatTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/DateFormatTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 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.junit.jupiter.params.provider.MethodSource; * use in the ExecutionContext around daylight savings. * * @author Dave Syer + * @author Mahmoud Ben Hassine * */ class DateFormatTests { @@ -55,7 +56,6 @@ class DateFormatTests { GregorianCalendar calendar = new GregorianCalendar(TimeZone.getTimeZone("GMT"), Locale.UK); calendar.setTime(date); - // System.err.println(format.toPattern() + " + " + input + " --> " + // calendar.getTime()); // This assertion is true... diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java index 8f6c16582..05a8858b7 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java @@ -536,7 +536,6 @@ class FaultTolerantStepFactoryBeanRetryTests { assertEquals(7, provided.size()); // [a, b, c, a, b, c, a, b, c, a, b, c, a, b, c, a, b, c, d, e, f, d, // e, f, d, e, f, d, e, f, d, e, f, d, e, f] - // System.err.println(processed); assertEquals(36, processed.size()); // [b, d] assertEquals(2, recovered.size()); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/AsyncTaskletStepTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/AsyncTaskletStepTests.java index 29a352580..175d0c327 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/AsyncTaskletStepTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/AsyncTaskletStepTests.java @@ -134,8 +134,6 @@ class AsyncTaskletStepTests { assertTrue(stepExecution.getReadCount() >= 25); assertTrue(processed.size() >= 25); - // System.err.println(stepExecution.getCommitCount()); - // System.err.println(processed); // Check commit count didn't spin out of control waiting for other // threads to finish... assertTrue(stepExecution.getCommitCount() > processed.size() / 2, diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/config/DatasourceTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/config/DatasourceTests.java index 63e055a11..9ef8e8d3e 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/config/DatasourceTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/config/DatasourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 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. @@ -34,7 +34,6 @@ class DatasourceTests { @Transactional @Test void testTemplate() { - System.err.println(System.getProperty("java.class.path")); JdbcTestUtils.deleteFromTables(jdbcTemplate, "T_BARS"); int count = JdbcTestUtils.countRowsInTable(jdbcTemplate, "T_BARS"); assertEquals(0, count); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/config/MessagingTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/config/MessagingTests.java index addfcf808..5473cf3b9 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/config/MessagingTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/config/MessagingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 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. @@ -45,7 +45,6 @@ class MessagingTests { @Test void testMessaging() { List list = getMessages(); - System.err.println(list); assertEquals(2, list.size()); assertTrue(list.contains("foo")); } diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/TransactionAwareListItemReaderTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/TransactionAwareListItemReaderTests.java index 3d2d9050b..eaeed1a21 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/TransactionAwareListItemReaderTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/TransactionAwareListItemReaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 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. @@ -63,7 +63,6 @@ class TransactionAwareListItemReaderTests { taken.add(next); next = reader.read(); } - // System.err.println(taken); assertFalse(taken.contains("a")); } @@ -104,7 +103,6 @@ class TransactionAwareListItemReaderTests { taken.add(next); next = reader.read(); } - System.err.println(taken); assertTrue(taken.contains("a")); } diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java index 4f84f9425..d32529a28 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java @@ -181,15 +181,10 @@ class ExternalRetryInBatchTests { } } - finally { - System.err.println(i + ": " + recovered); - } } List msgs = getMessages(); - System.err.println(msgs); - assertEquals(2, recovered.size()); // The database portion committed once... diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/jms/AsynchronousTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/jms/AsynchronousTests.java index 72ed911c6..54460ca24 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/jms/AsynchronousTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/jms/AsynchronousTests.java @@ -113,8 +113,6 @@ class AsynchronousTests { // Need to sleep for at least a second here... waitFor(list, 2, 2000); - System.err.println(jdbcTemplate.queryForList("select * from T_BARS")); - assertEquals(2, list.size()); String foo = (String) jmsTemplate.receiveAndConvert("queue"); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/listener/RepeatListenerTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/listener/RepeatListenerTests.java index be77ab2c4..efb57c5d7 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/listener/RepeatListenerTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/listener/RepeatListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 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. @@ -262,7 +262,6 @@ class RepeatListenerTests { })); assertEquals("Bogus", exception.getMessage()); assertEquals(0, count); - System.err.println(calls); // The after is not executed on error... assertEquals("2", calls.get(0)); assertEquals("2", calls.get(calls.size() - 1)); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/SimpleRepeatTemplateTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/SimpleRepeatTemplateTests.java index 1289f4202..1dcea1588 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/SimpleRepeatTemplateTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/SimpleRepeatTemplateTests.java @@ -366,8 +366,6 @@ class SimpleRepeatTemplateTests extends AbstractTradeBatchTests { // 2 items were processed before completion signalled assertEquals(2, processor.count); - System.err.println(result); - // An exception was thrown by the template so result is still false assertFalse(result.isContinuable()); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateAsynchronousTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateAsynchronousTests.java index 718846d60..5e0191721 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateAsynchronousTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateAsynchronousTests.java @@ -205,7 +205,6 @@ class TaskExecutorRepeatTemplateAsynchronousTests extends AbstractTradeBatchTest assertEquals(NUMBER_OF_ITEMS, processor.count); assertTrue(threadNames.size() > 1); int frequency = Collections.frequency(items, "null"); - // System.err.println("Frequency: "+frequency); assertTrue(frequency <= throttleLimit); } @@ -251,7 +250,6 @@ class TaskExecutorRepeatTemplateAsynchronousTests extends AbstractTradeBatchTest // Because of the throttling and queueing internally to a TaskExecutor, // more than one thread will be used - the number used is the // concurrency limit in the task executor, plus 1. - // System.err.println(threadNames); assertTrue(threadNames.size() >= 1); } diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java index 3e9f2f710..e0bc67e39 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 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. @@ -45,6 +45,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; * though. * * @author Dave Syer + * @author Mahmoud Ben Hassine * */ class TaskExecutorRepeatTemplateBulkAsynchronousTests { @@ -121,8 +122,6 @@ class TaskExecutorRepeatTemplateBulkAsynchronousTests { template.iterate(callback); int frequency = Collections.frequency(items, "null"); - // System.err.println(items); - // System.err.println("Frequency: " + frequency); assertEquals(total, items.size() - frequency); assertTrue(frequency > 1); assertTrue(frequency <= throttleLimit + 1); @@ -136,8 +135,6 @@ class TaskExecutorRepeatTemplateBulkAsynchronousTests { template.iterate(callback); int frequency = Collections.frequency(items, "null"); - // System.err.println("Frequency: " + frequency); - // System.err.println("Items: " + items); assertEquals(total, items.size() - frequency); assertTrue(frequency > 1); assertTrue(frequency <= throttleLimit + 1); @@ -162,8 +159,6 @@ class TaskExecutorRepeatTemplateBulkAsynchronousTests { template.iterate(callback); int frequency = Collections.frequency(items, "null"); - // System.err.println("Frequency: " + frequency); - // System.err.println("Items: " + items); // Extra tasks will be submitted before the termination is detected assertEquals(total, items.size() - frequency); assertTrue(frequency <= throttleLimit + 1); @@ -188,8 +183,6 @@ class TaskExecutorRepeatTemplateBulkAsynchronousTests { template.iterate(callback); int frequency = Collections.frequency(items, "null"); - // System.err.println("Frequency: " + frequency); - // System.err.println("Items: " + items); assertEquals(total, items.size() - frequency); assertTrue(frequency <= throttleLimit + 1); @@ -204,7 +197,6 @@ class TaskExecutorRepeatTemplateBulkAsynchronousTests { template.iterate(callback); int frequency = Collections.frequency(items, "null"); assertEquals(10, items.size() - frequency); - // System.err.println("Frequency: " + frequency); assertEquals(0, frequency); } diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java index 16b46dadd..c7baf3ac2 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java @@ -120,7 +120,6 @@ public class SynchronousTests { public String doInTransaction(TransactionStatus status) { list.add(text); - System.err.println("Inserting: [" + list.size() + "," + text + "]"); jdbcTemplate.update("INSERT into T_BARS (id,name,foo_date) values (?,?,null)", list.size(), text); if (list.size() == 1) { @@ -174,7 +173,6 @@ public class SynchronousTests { public String doInTransaction(TransactionStatus status) { list.add(item); - System.err.println("Inserting: [" + list.size() + "," + item + "]"); jdbcTemplate.update("INSERT into T_BARS (id,name,foo_date) values (?,?,null)", list.size(), item); if (list.size() == 1) { @@ -239,7 +237,6 @@ public class SynchronousTests { public String doInTransaction(TransactionStatus nestedStatus) { list.add(text); - System.err.println("Inserting: [" + list.size() + "," + text + "]"); jdbcTemplate.update("INSERT into T_BARS (id,name,foo_date) values (?,?,null)", list.size(), text); return text; diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/ReflectionUtilsTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/ReflectionUtilsTests.java index 73e3ae9ed..6e1a5746a 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/ReflectionUtilsTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/ReflectionUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 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. @@ -28,6 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** * @author Michael Minella + * @author Mahmoud Ben Hassine * @since 2.2.6 */ class ReflectionUtilsTests { @@ -79,7 +80,6 @@ class ReflectionUtilsTests { public static class AnnotatedClass { public void methodOne() { - System.err.println("This is method 1"); } @Transactional @@ -93,7 +93,6 @@ class ReflectionUtilsTests { @Transactional public void methodOne() { - System.err.println("This is method 1 in the sub class"); } } diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkMessageItemWriterIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkMessageItemWriterIntegrationTests.java index 4022e3dea..b086386a7 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkMessageItemWriterIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkMessageItemWriterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2022 the original author or authors. + * Copyright 2021-2023 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. @@ -105,7 +105,6 @@ class ChunkMessageItemWriterIntegrationTests { // Drain queues Message message = replies.receive(10); while (message != null) { - System.err.println(message); message = replies.receive(10); } diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkRequestTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkRequestTests.java index 820750026..c4e64adfd 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkRequestTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 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. @@ -51,7 +51,9 @@ class ChunkRequestTests { @Test void testToString() { - System.err.println(request.toString()); + assertEquals( + "ChunkRequest: jobId=111, sequence=0, contribution=[StepContribution: read=0, written=0, filtered=0, readSkips=0, writeSkips=0, processSkips=0, exitStatus=EXECUTING], item count=2", + request.toString()); } @Test diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkResponseTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkResponseTests.java index dabbf8316..4552a1287 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkResponseTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/ChunkResponseTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 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. @@ -24,6 +24,7 @@ import org.springframework.util.SerializationUtils; /** * @author Dave Syer + * @author Mahmoud Ben Hassine * */ class ChunkResponseTests { @@ -43,7 +44,9 @@ class ChunkResponseTests { @Test void testToString() { - System.err.println(response.toString()); + assertEquals( + "ChunkResponse: jobId=111, sequence=0, stepContribution=[StepContribution: read=0, written=0, filtered=0, readSkips=0, writeSkips=0, processSkips=0, exitStatus=EXECUTING], successful=true", + response.toString()); } @Test diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests.java index 5667de85e..9eea995a3 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/RemoteChunkFaultTolerantStepIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2022 the original author or authors. + * Copyright 2010-2023 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. @@ -50,7 +50,6 @@ class RemoteChunkFaultTolerantStepIntegrationTests { void drain() { Message message = replies.receive(100L); while (message != null) { - // System.err.println(message); message = replies.receive(100L); } } diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/file/ResourceSplitterIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/file/ResourceSplitterIntegrationTests.java index c635c4fe8..be6f6e19f 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/file/ResourceSplitterIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/file/ResourceSplitterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 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. @@ -35,6 +35,7 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; /** * @author Dave Syer + * @author Mahmoud Ben Hassine * */ @SpringJUnitConfig @@ -58,7 +59,6 @@ class ResourceSplitterIntegrationTests { @Splitter(inputChannel = "resources", outputChannel = "requests") public Resource[] handle(Resource[] message) { List list = Arrays.asList(message); - System.err.println(list); return message; } diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/retry/RetryRepeatTransactionalPollingIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/retry/RetryRepeatTransactionalPollingIntegrationTests.java index c315ee457..737e83972 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/retry/RetryRepeatTransactionalPollingIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/retry/RetryRepeatTransactionalPollingIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2022 the original author or authors. + * Copyright 2010-2023 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. @@ -98,7 +98,6 @@ class RetryRepeatTransactionalPollingIntegrationTests implements ApplicationCont service.setExpected(expected); waitForResults(lifecycle, expected.size(), 60); // (a,b), (fail), (fail), // ([fail],d), (e,f) - System.err.println(service.getProcessed()); assertEquals(7, service.getProcessed().size()); // a,b,fail,fail,d,e,f assertEquals(1, recoverer.getRecovered().size()); // fail assertEquals(expected, service.getProcessed()); diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/retry/RetryTransactionalPollingIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/retry/RetryTransactionalPollingIntegrationTests.java index 5cf701a7f..82be45cf1 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/retry/RetryTransactionalPollingIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/retry/RetryTransactionalPollingIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2022 the original author or authors. + * Copyright 2010-2023 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. @@ -100,7 +100,6 @@ public class RetryTransactionalPollingIntegrationTests implements ApplicationCon List expected = Arrays.asList(StringUtils.commaDelimitedListToStringArray("a,b,fail,fail,d,e")); service.setExpected(expected); waitForResults(bus, expected.size(), 100); // a, b, (fail, fail, [fail]), d, e - // System.err.println(service.getProcessed()); assertEquals(6, service.getProcessed().size()); // a,b,fail,fail,d,e assertEquals(1, recoverer.getRecovered().size()); // fail assertEquals(expected, service.getProcessed()); diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/SkipSampleFunctionalTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/SkipSampleFunctionalTests.java index a04c759d1..d50260fa5 100644 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/SkipSampleFunctionalTests.java +++ b/spring-batch-samples/src/test/java/org/springframework/batch/sample/SkipSampleFunctionalTests.java @@ -265,7 +265,6 @@ class SkipSampleFunctionalTests { // Step2: 7 input records, 1 skipped on process, 1 on write => 5 written // to output - // System.err.println(jdbcTemplate.queryForList("SELECT * FROM TRADE")); assertEquals(5, JdbcTestUtils.countRowsInTableWhere(jdbcTemplate, "TRADE", "VERSION=1")); // 1 record skipped in processing second step @@ -281,7 +280,6 @@ class SkipSampleFunctionalTests { jdbcTemplate.queryForObject("SELECT MESSAGE from ERROR_LOG where JOB_NAME = ? and STEP_NAME = ?", String.class, "skipJob", "step2")); - System.err.println(jobExecution.getExecutionContext()); assertEquals(new BigDecimal("340.45"), jobExecution.getExecutionContext().get(TradeWriter.TOTAL_AMOUNT_KEY)); Map step1Execution = getStepExecutionAsMap(jobExecution, "step1");