Skip to content

Commit 9dda1cb

Browse files
committed
Updated to do some polishing after rebase and merge
1 parent dc115df commit 9dda1cb

File tree

48 files changed

+66
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+66
-207
lines changed

.vscode/launch.json

Lines changed: 0 additions & 84 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

spring-batch-sample-apps/tasklet-sample-app/.vscode/launch.json

Lines changed: 0 additions & 29 deletions
This file was deleted.

spring-batch-sample-apps/tasklet-sample-app/.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

spring-batch-samples/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,6 @@
162162
<groupId>org.junit.jupiter</groupId>
163163
<artifactId>junit-jupiter-engine</artifactId>
164164
<version>${junit-jupiter.version}</version>
165-
</dependency>
166-
<dependency>
167-
<groupId>org.junit.jupiter</groupId>
168-
<artifactId>junit-jupiter-api</artifactId>
169-
<version>${junit-jupiter.version}</version>
170165
<scope>test</scope>
171166
</dependency>
172167
<dependency>

spring-batch-samples/src/test/java/org/springframework/batch/sample/AMQPJobFunctionalTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
@ExtendWith(SpringExtension.class)
4545
@ContextConfiguration(
4646
locations = { "/simple-job-launcher-context.xml", "/jobs/amqp-example-job.xml", "/job-runner-context.xml" })
47-
public class AMQPJobFunctionalTests {
47+
class AMQPJobFunctionalTests {
4848

4949
@Autowired
5050
private JobLauncherTestUtils jobLauncherTestUtils;

spring-batch-samples/src/test/java/org/springframework/batch/sample/CompositeItemWriterSampleFunctionalTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
@ExtendWith(SpringExtension.class)
4343
@ContextConfiguration(locations = { "/simple-job-launcher-context.xml", "/jobs/compositeItemWriterSampleJob.xml",
4444
"/job-runner-context.xml" })
45-
public class CompositeItemWriterSampleFunctionalTests {
45+
class CompositeItemWriterSampleFunctionalTests {
4646

4747
private static final String GET_TRADES = "SELECT isin, quantity, price, customer FROM TRADE order by isin";
4848

spring-batch-samples/src/test/java/org/springframework/batch/sample/CustomerFilterJobFunctionalTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
@ExtendWith(SpringExtension.class)
4444
@ContextConfiguration(
4545
locations = { "/simple-job-launcher-context.xml", "/jobs/customerFilterJob.xml", "/job-runner-context.xml" })
46-
public class CustomerFilterJobFunctionalTests {
46+
class CustomerFilterJobFunctionalTests {
4747

4848
private static final String GET_CUSTOMERS = "select NAME, CREDIT from CUSTOMER order by NAME";
4949

@@ -64,8 +64,7 @@ public void setDataSource(DataSource dataSource) {
6464
}
6565

6666
@BeforeEach
67-
68-
public void onSetUp() throws Exception {
67+
void onSetUp() {
6968
JdbcTestUtils.deleteFromTables(jdbcTemplate, "TRADE");
7069
JdbcTestUtils.deleteFromTableWhere(jdbcTemplate, "CUSTOMER", "ID > 4");
7170
jdbcTemplate.update("update CUSTOMER set credit=100000");
@@ -78,7 +77,7 @@ public void onSetUp() throws Exception {
7877
}
7978

8079
@AfterEach
81-
public void tearDown() throws Exception {
80+
void tearDown() {
8281
JdbcTestUtils.deleteFromTables(jdbcTemplate, "TRADE");
8382
JdbcTestUtils.deleteFromTableWhere(jdbcTemplate, "CUSTOMER", "ID > 4");
8483
}

spring-batch-samples/src/test/java/org/springframework/batch/sample/DatabaseShutdownFunctionalTests.java

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,20 @@
1616

1717
package org.springframework.batch.sample;
1818

19-
import static org.junit.jupiter.api.Assertions.assertEquals;
20-
import static org.junit.jupiter.api.Assertions.assertFalse;
21-
import static org.junit.jupiter.api.Assertions.assertNotNull;
22-
import static org.junit.jupiter.api.Assertions.assertTrue;
23-
24-
import org.apache.commons.logging.Log;
25-
import org.apache.commons.logging.LogFactory;
26-
import org.junit.jupiter.api.Test;
2719
import org.apache.commons.logging.Log;
2820
import org.apache.commons.logging.LogFactory;
2921
import org.junit.jupiter.api.Test;
3022
import org.junit.jupiter.api.extension.ExtendWith;
31-
3223
import org.springframework.batch.core.BatchStatus;
3324
import org.springframework.batch.core.Job;
3425
import org.springframework.batch.core.JobExecution;
3526
import org.springframework.batch.core.launch.JobOperator;
3627
import org.springframework.batch.test.JobLauncherTestUtils;
3728
import org.springframework.beans.factory.annotation.Autowired;
38-
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
3929
import org.springframework.test.context.ContextConfiguration;
4030
import org.springframework.test.context.junit.jupiter.SpringExtension;
4131

42-
import static org.junit.jupiter.api.Assertions.assertEquals;
43-
import static org.junit.jupiter.api.Assertions.assertNotNull;
44-
import static org.junit.jupiter.api.Assertions.assertTrue;
45-
import static org.springframework.test.util.AssertionErrors.assertFalse;
32+
import static org.junit.jupiter.api.Assertions.*;
4633

4734
/**
4835
* Functional test for graceful shutdown. A batch container is started in a new thread,
@@ -57,7 +44,7 @@
5744
@ExtendWith(SpringExtension.class)
5845
@ContextConfiguration(
5946
locations = { "/simple-job-launcher-context.xml", "/jobs/infiniteLoopJob.xml", "/job-runner-context.xml" })
60-
public class DatabaseShutdownFunctionalTests {
47+
class DatabaseShutdownFunctionalTests {
6148

6249
/** Logger */
6350
protected final Log logger = LogFactory.getLog(getClass());

spring-batch-samples/src/test/java/org/springframework/batch/sample/DelegatingJobFunctionalTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
@ExtendWith(SpringExtension.class)
3232
@ContextConfiguration(
3333
locations = { "/simple-job-launcher-context.xml", "/jobs/delegatingJob.xml", "/job-runner-context.xml" })
34-
public class DelegatingJobFunctionalTests {
34+
class DelegatingJobFunctionalTests {
3535

3636
@Autowired
3737
private JobLauncherTestUtils jobLauncherTestUtils;

spring-batch-samples/src/test/java/org/springframework/batch/sample/FootballJobFunctionalTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
@ExtendWith(SpringExtension.class)
3333
@ContextConfiguration(
3434
locations = { "/simple-job-launcher-context.xml", "/jobs/footballJob.xml", "/job-runner-context.xml" })
35-
public class FootballJobFunctionalTests {
35+
class FootballJobFunctionalTests {
3636

3737
@Autowired
3838
private JobLauncherTestUtils jobLauncherTestUtils;

spring-batch-samples/src/test/java/org/springframework/batch/sample/GracefulShutdownFunctionalTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
@ExtendWith(SpringExtension.class)
4242
@ContextConfiguration(
4343
locations = { "/simple-job-launcher-context.xml", "/jobs/infiniteLoopJob.xml", "/job-runner-context.xml" })
44-
public class GracefulShutdownFunctionalTests {
44+
class GracefulShutdownFunctionalTests {
4545

4646
/** Logger */
4747
private final Log logger = LogFactory.getLog(getClass());

spring-batch-samples/src/test/java/org/springframework/batch/sample/PartitionFileJobFunctionalTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
import static org.junit.jupiter.api.Assertions.assertEquals;
4444
import static org.junit.jupiter.api.Assertions.assertTrue;
45-
import static org.springframework.test.util.AssertionErrors.assertTrue;
4645

4746
@ExtendWith(SpringExtension.class)
4847
@ContextConfiguration(
@@ -88,7 +87,7 @@ void testUpdateCredit(@Autowired Job job) throws Exception {
8887

8988
assertEquals(inputs.size(), outputs.size());
9089
int itemCount = inputs.size();
91-
assertTrue("No entries were available in the input", itemCount > 0);
90+
assertTrue(itemCount > 0, "No entries were available in the input");
9291

9392
inputs.iterator();
9493
for (int i = 0; i < itemCount; i++) {

spring-batch-samples/src/test/java/org/springframework/batch/sample/PartitionJdbcJobFunctionalTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
import static org.junit.jupiter.api.Assertions.assertEquals;
4444
import static org.junit.jupiter.api.Assertions.assertTrue;
45-
import static org.springframework.test.util.AssertionErrors.assertTrue;
4645

4746
@ExtendWith(SpringExtension.class)
4847
@ContextConfiguration(
@@ -88,7 +87,7 @@ void testUpdateCredit(@Autowired Job job) throws Exception {
8887

8988
assertEquals(inputs.size(), outputs.size());
9089
int itemCount = inputs.size();
91-
assertTrue("Input from reader has no entries.", itemCount > 0);
90+
assertTrue(itemCount > 0, "Input from reader has no entries.");
9291

9392
inputs.iterator();
9493
for (int i = 0; i < itemCount; i++) {

spring-batch-samples/src/test/java/org/springframework/batch/sample/RestartFunctionalTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
@ExtendWith(SpringExtension.class)
4848
@ContextConfiguration(
4949
locations = { "/simple-job-launcher-context.xml", "/jobs/restartSample.xml", "/job-runner-context.xml" })
50-
public class RestartFunctionalTests {
50+
class RestartFunctionalTests {
5151

5252
private JdbcTemplate jdbcTemplate;
5353

spring-batch-samples/src/test/java/org/springframework/batch/sample/RetrySampleConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
@ExtendWith(SpringExtension.class)
4242
@ContextConfiguration(
4343
classes = { DataSourceConfiguration.class, RetrySampleConfiguration.class, JobRunnerConfiguration.class })
44-
public class RetrySampleConfigurationTests {
44+
class RetrySampleConfigurationTests {
4545

4646
@Autowired
4747
private GeneratingTradeItemReader itemGenerator;

spring-batch-samples/src/test/java/org/springframework/batch/sample/TradeJobFunctionalTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
@ExtendWith(SpringExtension.class)
4545
@ContextConfiguration(
4646
locations = { "/simple-job-launcher-context.xml", "/jobs/tradeJob.xml", "/job-runner-context.xml" })
47-
public class TradeJobFunctionalTests {
47+
class TradeJobFunctionalTests {
4848

4949
private static final String GET_TRADES = "select ISIN, QUANTITY, PRICE, CUSTOMER, ID, VERSION from TRADE order by ISIN";
5050

@@ -69,7 +69,7 @@ public void setDataSource(DataSource dataSource) {
6969
}
7070

7171
@BeforeEach
72-
public void onSetUp() throws Exception {
72+
void onSetUp() {
7373
JdbcTestUtils.deleteFromTables(jdbcTemplate, "TRADE");
7474
List<Map<String, Object>> list = jdbcTemplate.queryForList("select NAME, CREDIT from CUSTOMER");
7575

@@ -79,7 +79,7 @@ public void onSetUp() throws Exception {
7979
}
8080

8181
@AfterEach
82-
public void tearDown() throws Exception {
82+
void tearDown() {
8383
JdbcTestUtils.deleteFromTables(jdbcTemplate, "TRADE");
8484
}
8585

spring-batch-samples/src/test/java/org/springframework/batch/sample/common/CustomItemReaderTests.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,8 @@ class CustomItemReaderTests {
4242

4343
private ItemReader<String> itemReader;
4444

45-
/*
46-
* (non-Javadoc)
47-
*
48-
* @see junit.framework.TestCase#setUp()
49-
*/
5045
@BeforeEach
51-
public void setUp() throws Exception {
46+
void setUp() {
5247
List<String> items = new ArrayList<>();
5348
items.add("1");
5449
items.add("2");

spring-batch-samples/src/test/java/org/springframework/batch/sample/common/ExceptionThrowingItemReaderProxyTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import static org.junit.jupiter.api.Assertions.assertEquals;
2929
import static org.junit.jupiter.api.Assertions.assertTrue;
3030

31-
public class ExceptionThrowingItemReaderProxyTests {
31+
class ExceptionThrowingItemReaderProxyTests {
3232

3333
// expected call count before exception is thrown (exception should be thrown in next
3434
// iteration)

spring-batch-samples/src/test/java/org/springframework/batch/sample/common/OutputFileListenerTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,33 @@
2424

2525
public class OutputFileListenerTests {
2626

27-
private OutputFileListener listener = new OutputFileListener();
27+
private final OutputFileListener listener = new OutputFileListener();
2828

29-
private StepExecution stepExecution = new StepExecution("foo", new JobExecution(0L), 1L);
29+
private final StepExecution stepExecution = new StepExecution("foo", new JobExecution(0L), 1L);
3030

3131
@Test
32-
public void testCreateOutputNameFromInput() {
32+
void testCreateOutputNameFromInput() {
3333
listener.createOutputNameFromInput(stepExecution);
3434
assertEquals("{outputFile=file:./target/output/foo.csv}", stepExecution.getExecutionContext().toString());
3535
}
3636

3737
@Test
38-
public void testSetPath() {
38+
void testSetPath() {
3939
listener.setPath("spam/");
4040
listener.createOutputNameFromInput(stepExecution);
4141
assertEquals("{outputFile=spam/foo.csv}", stepExecution.getExecutionContext().toString());
4242
}
4343

4444
@Test
45-
public void testSetOutputKeyName() {
45+
void testSetOutputKeyName() {
4646
listener.setPath("");
4747
listener.setOutputKeyName("spam");
4848
listener.createOutputNameFromInput(stepExecution);
4949
assertEquals("{spam=foo.csv}", stepExecution.getExecutionContext().toString());
5050
}
5151

5252
@Test
53-
public void testSetInputKeyName() {
53+
void testSetInputKeyName() {
5454
listener.setPath("");
5555
listener.setInputKeyName("spam");
5656
stepExecution.getExecutionContext().putString("spam", "bar");

0 commit comments

Comments
 (0)