@@ -194,10 +194,6 @@ class ExtendedAbstractJobTests {
|
||||
*/
|
||||
private static class StubJob extends AbstractJob {
|
||||
|
||||
/**
|
||||
* @param name
|
||||
* @param jobRepository
|
||||
*/
|
||||
private StubJob(String name, JobRepository jobRepository) {
|
||||
super(name);
|
||||
try {
|
||||
|
||||
@@ -63,7 +63,7 @@ public class JobSupport implements BeanNameAware, Job, StepLocator {
|
||||
|
||||
/**
|
||||
* Convenience constructor to immediately add name (which is mandatory but not final).
|
||||
* @param name
|
||||
* @param name the job name
|
||||
*/
|
||||
public JobSupport(String name) {
|
||||
super();
|
||||
|
||||
@@ -544,23 +544,17 @@ class SimpleJobTests {
|
||||
private ExecutionContext passedInJobContext;
|
||||
|
||||
/**
|
||||
* @param string
|
||||
* @param string the step name
|
||||
*/
|
||||
public StubStep(String string, JobRepository jobRepository) {
|
||||
super(string);
|
||||
this.jobRepository = jobRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param exception
|
||||
*/
|
||||
public void setProcessException(Throwable exception) {
|
||||
this.exception = exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param runnable
|
||||
*/
|
||||
public void setCallback(Runnable runnable) {
|
||||
this.runnable = runnable;
|
||||
}
|
||||
|
||||
@@ -702,11 +702,6 @@ public class FlowJobTests {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jobExecution
|
||||
* @param stepName
|
||||
* @return the StepExecution corresponding to the specified step
|
||||
*/
|
||||
private StepExecution getStepExecution(JobExecution jobExecution, String stepName) {
|
||||
for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
|
||||
if (stepExecution.getStepName().equals(stepName)) {
|
||||
|
||||
@@ -220,7 +220,7 @@ class SimpleFlowTests {
|
||||
protected static class StubState extends StateSupport {
|
||||
|
||||
/**
|
||||
* @param string
|
||||
* @param string the state name
|
||||
*/
|
||||
public StubState(String string) {
|
||||
super(string);
|
||||
|
||||
@@ -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.
|
||||
@@ -22,11 +22,11 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.batch.core.BatchStatus;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.job.flow.FlowExecutionStatus;
|
||||
import org.springframework.batch.core.job.flow.FlowExecutor;
|
||||
import org.springframework.batch.core.job.flow.support.JobFlowExecutorSupport;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
* @author Mahmoud Ben Hassine
|
||||
*
|
||||
*/
|
||||
class EndStateTests {
|
||||
@@ -38,10 +38,6 @@ class EndStateTests {
|
||||
jobExecution = new JobExecution(0L);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link EndState#handle(FlowExecutor)}.
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testHandleRestartSunnyDay() throws Exception {
|
||||
|
||||
@@ -59,10 +55,6 @@ class EndStateTests {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link EndState#handle(FlowExecutor)}.
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testHandleOngoingSunnyDay() throws Exception {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2009-2022 the original author or authors.
|
||||
* Copyright 2009-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.
|
||||
@@ -48,7 +48,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
/**
|
||||
* CONDITION: ExecutionContext contains {key, key2}. keys = {key}. statuses is not set
|
||||
* (defaults to {COMPLETED}).
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: key is promoted. key2 is not.
|
||||
*/
|
||||
@Test
|
||||
@@ -77,7 +77,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
/**
|
||||
* CONDITION: ExecutionContext contains {key, key2}. keys = {key, key2}. statuses =
|
||||
* {status}. ExitStatus = status
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: key is promoted. key2 is not.
|
||||
*/
|
||||
@Test
|
||||
@@ -108,7 +108,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
/**
|
||||
* CONDITION: ExecutionContext contains {key, key2}. keys = {key, key2}. statuses =
|
||||
* {status}. ExitStatus = status2
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: no promotions.
|
||||
*/
|
||||
@Test
|
||||
@@ -137,7 +137,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
|
||||
/**
|
||||
* CONDITION: keys = {key, key2}. statuses = {statusWildcard}. ExitStatus = status
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: key is promoted. key2 is not.
|
||||
*/
|
||||
@Test
|
||||
@@ -166,7 +166,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
|
||||
/**
|
||||
* CONDITION: keys = {key, key2}. Only {key} exists in the ExecutionContext.
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: key is promoted. key2 is not.
|
||||
*/
|
||||
@Test
|
||||
@@ -193,7 +193,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
|
||||
/**
|
||||
* CONDITION: keys = {key}. key is already in job but not in step.
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: key is not erased.
|
||||
*/
|
||||
@Test
|
||||
@@ -220,7 +220,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
/**
|
||||
* CONDITION: strict = true. keys = {key, key2}. Only {key} exists in the
|
||||
* ExecutionContext.
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: IllegalArgumentException
|
||||
*/
|
||||
@Test
|
||||
|
||||
@@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -264,7 +263,7 @@ class MulticasterBatchListenerTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(java.util.List)}
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(Chunk)}
|
||||
* .
|
||||
*/
|
||||
@Test
|
||||
@@ -275,7 +274,7 @@ class MulticasterBatchListenerTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(java.util.List)}
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(Chunk)}
|
||||
* .
|
||||
*/
|
||||
@Test
|
||||
@@ -289,7 +288,7 @@ class MulticasterBatchListenerTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(List)}
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(Chunk)}
|
||||
* .
|
||||
*/
|
||||
@Test
|
||||
@@ -300,7 +299,7 @@ class MulticasterBatchListenerTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(List)}
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(Chunk)}
|
||||
* .
|
||||
*/
|
||||
@Test
|
||||
@@ -314,7 +313,7 @@ class MulticasterBatchListenerTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, java.util.List)}
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, Chunk)}
|
||||
* .
|
||||
*/
|
||||
@Test
|
||||
@@ -325,7 +324,7 @@ class MulticasterBatchListenerTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, java.util.List)}
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, Chunk)}
|
||||
* .
|
||||
*/
|
||||
@Test
|
||||
|
||||
@@ -80,9 +80,8 @@ class SimpleStepExecutionSplitterTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Tests the results of BATCH-2490
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testAddressabilityOfSetResults() throws Exception {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2013 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,7 @@ public class StepSupport implements Step, BeanNameAware {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string
|
||||
* @param string the step name
|
||||
*/
|
||||
public StepSupport(String string) {
|
||||
super();
|
||||
|
||||
@@ -88,12 +88,11 @@ class RegisterMultiListenerTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* The times the beforeChunkCalled occurs are: - Before chunk 1 (item1, item2) -
|
||||
* Before the re-attempt of item1 (scanning) - Before the re-attempt of item2
|
||||
* (scanning) - Before the checking that scanning is complete - Before chunk 2 (item3,
|
||||
* item4) - Before chunk 3 (null)
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testMultiListenerFaultTolerantStep() throws Exception {
|
||||
|
||||
@@ -185,7 +185,6 @@ class FaultTolerantChunkProcessorTests {
|
||||
|
||||
/**
|
||||
* An Error can be retried or skipped but by default it is just propagated
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testWriteSkipOnError() throws Exception {
|
||||
|
||||
@@ -275,7 +275,6 @@ class FaultTolerantStepFactoryBeanRetryTests {
|
||||
* N.B. this doesn't really test retry, since the retry is only on write failures, but
|
||||
* it does test that read errors are re-presented for another try when the retryLimit
|
||||
* is high enough (it is used to build an exception handler).
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
|
||||
@@ -175,7 +175,6 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* Non-skippable (and non-fatal) exception causes failure immediately.
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
@@ -1039,7 +1038,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* condition: skippable < fatal; exception is unclassified
|
||||
*
|
||||
* <p>
|
||||
* expected: false; default classification
|
||||
*/
|
||||
@Test
|
||||
@@ -1049,7 +1048,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* condition: skippable < fatal; exception is skippable
|
||||
*
|
||||
* <p>
|
||||
* expected: true
|
||||
*/
|
||||
@Test
|
||||
@@ -1059,7 +1058,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* condition: skippable < fatal; exception is fatal
|
||||
*
|
||||
* <p>
|
||||
* expected: false
|
||||
*/
|
||||
@Test
|
||||
@@ -1069,7 +1068,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* condition: fatal < skippable; exception is unclassified
|
||||
*
|
||||
* <p>
|
||||
* expected: false; default classification
|
||||
*/
|
||||
@Test
|
||||
@@ -1079,7 +1078,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* condition: fatal < skippable; exception is skippable
|
||||
*
|
||||
* <p>
|
||||
* expected: true
|
||||
*/
|
||||
@Test
|
||||
@@ -1089,7 +1088,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* condition: fatal < skippable; exception is fatal
|
||||
*
|
||||
* <p>
|
||||
* expected: false
|
||||
*/
|
||||
@Test
|
||||
|
||||
@@ -328,9 +328,8 @@ class SimpleStepFactoryBeanTests {
|
||||
assertTrue(writeListener.trail.startsWith("1234"), "Listener order not as expected: " + writeListener.trail);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Commit interval specified is not allowed to be zero or negative.
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testCommitIntervalMustBeGreaterThanZero() throws Exception {
|
||||
@@ -344,9 +343,8 @@ class SimpleStepFactoryBeanTests {
|
||||
assertThrows(IllegalStateException.class, factory::getObject);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Commit interval specified is not allowed to be zero or negative.
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testCommitIntervalAndCompletionPolicyBothSet() {
|
||||
|
||||
@@ -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.
|
||||
@@ -71,7 +71,7 @@ class LimitCheckingItemSkipPolicyTests {
|
||||
|
||||
/**
|
||||
* condition: skippable < fatal; exception is unclassified
|
||||
*
|
||||
* <p>
|
||||
* expected: false; default classification
|
||||
*/
|
||||
@Test
|
||||
@@ -81,7 +81,7 @@ class LimitCheckingItemSkipPolicyTests {
|
||||
|
||||
/**
|
||||
* condition: skippable < fatal; exception is skippable
|
||||
*
|
||||
* <p>
|
||||
* expected: true
|
||||
*/
|
||||
@Test
|
||||
@@ -91,7 +91,7 @@ class LimitCheckingItemSkipPolicyTests {
|
||||
|
||||
/**
|
||||
* condition: skippable < fatal; exception is fatal
|
||||
*
|
||||
* <p>
|
||||
* expected: false
|
||||
*/
|
||||
@Test
|
||||
@@ -108,7 +108,7 @@ class LimitCheckingItemSkipPolicyTests {
|
||||
|
||||
/**
|
||||
* condition: fatal < skippable; exception is unclassified
|
||||
*
|
||||
* <p>
|
||||
* expected: false; default classification
|
||||
*/
|
||||
@Test
|
||||
@@ -118,7 +118,7 @@ class LimitCheckingItemSkipPolicyTests {
|
||||
|
||||
/**
|
||||
* condition: fatal < skippable; exception is skippable
|
||||
*
|
||||
* <p>
|
||||
* expected: true
|
||||
*/
|
||||
@Test
|
||||
@@ -128,7 +128,7 @@ class LimitCheckingItemSkipPolicyTests {
|
||||
|
||||
/**
|
||||
* condition: fatal < skippable; exception is fatal
|
||||
*
|
||||
* <p>
|
||||
* expected: false
|
||||
*/
|
||||
@Test
|
||||
|
||||
@@ -227,9 +227,6 @@ class StepExecutorInterruptionTests {
|
||||
assertEquals(BatchStatus.FAILED, stepExecution.getStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
private Thread createThread(final StepExecution stepExecution) {
|
||||
Thread processingThread = new Thread(() -> {
|
||||
try {
|
||||
|
||||
@@ -838,10 +838,9 @@ class TaskletStepTests {
|
||||
assertEquals(3, stepExecution.getReadCount());
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Exception in {@link StepExecutionListener#afterStep(StepExecution)} doesn't cause
|
||||
* step failure.
|
||||
* @throws JobInterruptedException
|
||||
*/
|
||||
@Test
|
||||
void testStepFailureInAfterStepCallback() throws JobInterruptedException {
|
||||
|
||||
@@ -173,7 +173,7 @@ class ConcurrentTransactionTests {
|
||||
@Configuration
|
||||
static class DataSourceConfiguration {
|
||||
|
||||
/**
|
||||
/*
|
||||
* This datasource configuration configures the HSQLDB instance using MVCC. When
|
||||
* configured using the default behavior, transaction serialization errors are
|
||||
* thrown (default configuration example below).
|
||||
@@ -182,7 +182,6 @@ class ConcurrentTransactionTests {
|
||||
* addScript("classpath:org/springframework/batch/core/schema-drop-hsqldb.sql").
|
||||
* addScript("classpath:org/springframework/batch/core/schema-hsqldb.sql").
|
||||
* build());
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public DataSource dataSource() {
|
||||
|
||||
@@ -61,8 +61,8 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
/**
|
||||
* The official Docker image for SAP HANA is not publicly available. SAP HANA support is
|
||||
* tested manually. See
|
||||
* https://hub.docker.com/_/sap-hana-express-edition/plans/f2dc436a-d851-4c22-a2ba-9de07db7a9ac
|
||||
* tested manually. See <a href=
|
||||
* "https://hub.docker.com/_/sap-hana-express-edition/plans/f2dc436a-d851-4c22-a2ba-9de07db7a9ac">...</a>
|
||||
* FTR, from the previous link: "This installation does not support Docker for Windows or
|
||||
* Docker for Mac."
|
||||
*
|
||||
@@ -196,8 +196,8 @@ class HANAJobRepositoryIntegrationTests {
|
||||
/**
|
||||
* Accepts the license for the SAP HANA Express container by setting the
|
||||
* AGREE_TO_SAP_LICENSE=Y Calling this method will automatically accept the
|
||||
* license at:
|
||||
* https://www.sap.com/docs/download/cmp/2016/06/sap-hana-express-dev-agmt-and-exhibit.pdf
|
||||
* license at: <a href=
|
||||
* "https://www.sap.com/docs/download/cmp/2016/06/sap-hana-express-dev-agmt-and-exhibit.pdf">...</a>
|
||||
* @return The container itself with an environment variable accepting the SAP
|
||||
* HANA Express license
|
||||
*/
|
||||
|
||||
@@ -52,7 +52,8 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
/**
|
||||
* Official Docker images for Oracle are not publicly available. Oracle support is tested
|
||||
* semi-manually for the moment: 1. Build a docker image for oracle/database:11.2.0.2-xe:
|
||||
* https://github.com/oracle/docker-images/tree/main/OracleDatabase/SingleInstance#running-oracle-database-11gr2-express-edition-in-a-container
|
||||
* <a href=
|
||||
* "https://github.com/oracle/docker-images/tree/main/OracleDatabase/SingleInstance#running-oracle-database-11gr2-express-edition-in-a-container">...</a>
|
||||
* 2. Run the test `testJobExecution`
|
||||
*
|
||||
* @author Mahmoud Ben Hassine
|
||||
|
||||
@@ -244,9 +244,6 @@ class FaultTolerantStepFactoryBeanIntegrationTests {
|
||||
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
|
||||
/**
|
||||
* @param dataSource
|
||||
*/
|
||||
public SkipProcessorStub(DataSource dataSource) {
|
||||
jdbcTemplate = new JdbcTemplate(dataSource);
|
||||
}
|
||||
|
||||
@@ -270,9 +270,6 @@ class FaultTolerantStepFactoryBeanRollbackIntegrationTests {
|
||||
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
|
||||
/**
|
||||
* @param dataSource
|
||||
*/
|
||||
public SkipProcessorStub(DataSource dataSource) {
|
||||
jdbcTemplate = new JdbcTemplate(dataSource);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user