Remove System.err.println from tests

This commit is contained in:
Mahmoud Ben Hassine
2023-06-07 15:45:51 +02:00
parent 27e2ab02c0
commit 7f80b7230b
25 changed files with 30 additions and 66 deletions

View File

@@ -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);

View File

@@ -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<String> list = getMessages();
System.err.println(list);
assertEquals(2, list.size());
assertTrue(list.contains("foo"));
}

View File

@@ -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"));
}

View File

@@ -181,15 +181,10 @@ class ExternalRetryInBatchTests {
}
}
finally {
System.err.println(i + ": " + recovered);
}
}
List<String> msgs = getMessages();
System.err.println(msgs);
assertEquals(2, recovered.size());
// The database portion committed once...

View File

@@ -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");

View File

@@ -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));

View File

@@ -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());

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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");
}
}