Added checkstyle
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>io.spring.cloud</groupId>
|
||||
@@ -14,7 +16,7 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.1.2.RELEASE</version>
|
||||
<relativePath />
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2018 the original author or authors.
|
||||
* Copyright 2015-2019 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.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.spring;
|
||||
|
||||
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2015-2019 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.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.spring.configuration;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -45,31 +46,31 @@ public class JobConfiguration {
|
||||
|
||||
@Bean
|
||||
public Job job1() {
|
||||
return jobBuilderFactory.get("job1")
|
||||
.start(stepBuilderFactory.get("job1step1")
|
||||
.tasklet(new Tasklet() {
|
||||
@Override
|
||||
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
|
||||
logger.info("Job1 was run");
|
||||
return RepeatStatus.FINISHED;
|
||||
}
|
||||
})
|
||||
.build())
|
||||
.build();
|
||||
return this.jobBuilderFactory.get("job1")
|
||||
.start(this.stepBuilderFactory.get("job1step1")
|
||||
.tasklet(new Tasklet() {
|
||||
@Override
|
||||
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
|
||||
logger.info("Job1 was run");
|
||||
return RepeatStatus.FINISHED;
|
||||
}
|
||||
})
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Job job2() {
|
||||
return jobBuilderFactory.get("job2")
|
||||
.start(stepBuilderFactory.get("job2step1")
|
||||
.tasklet(new Tasklet() {
|
||||
@Override
|
||||
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
|
||||
logger.info("Job2 was run");
|
||||
return RepeatStatus.FINISHED;
|
||||
}
|
||||
})
|
||||
.build())
|
||||
.build();
|
||||
return this.jobBuilderFactory.get("job2")
|
||||
.start(this.stepBuilderFactory.get("job2step1")
|
||||
.tasklet(new Tasklet() {
|
||||
@Override
|
||||
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
|
||||
logger.info("Job2 was run");
|
||||
return RepeatStatus.FINISHED;
|
||||
}
|
||||
})
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-2019 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,23 +50,23 @@ public class BatchJobApplicationTests {
|
||||
|
||||
String output = this.outputCapture.toString();
|
||||
assertTrue("Unable to find the timestamp: " + output,
|
||||
output.contains(JOB_RUN_MESSAGE));
|
||||
output.contains(JOB_RUN_MESSAGE));
|
||||
assertTrue("Test results do not show create task message: " + output,
|
||||
output.contains(CREATE_TASK_MESSAGE));
|
||||
output.contains(CREATE_TASK_MESSAGE));
|
||||
assertTrue("Test results do not show success message: " + output,
|
||||
output.contains(UPDATE_TASK_MESSAGE));
|
||||
output.contains(UPDATE_TASK_MESSAGE));
|
||||
assertTrue("Test results do not show success message: " + output,
|
||||
output.contains(EXIT_CODE_MESSAGE));
|
||||
output.contains(EXIT_CODE_MESSAGE));
|
||||
|
||||
int i = output.indexOf(JOB_ASSOCIATION_MESSAGE);
|
||||
|
||||
assertTrue("Test results do not show the listener message: " + output,
|
||||
i > 0);
|
||||
i > 0);
|
||||
|
||||
int j = output.indexOf(JOB_ASSOCIATION_MESSAGE, i + 1);
|
||||
|
||||
assertTrue("Test results do not show the listener message: " + output,
|
||||
j > i);
|
||||
j > i);
|
||||
|
||||
|
||||
String taskTitle = "Demo Batch Job Task";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2016 the original author or authors.
|
||||
# Copyright 2015-2019 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.
|
||||
@@ -13,6 +13,5 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
logging.level.root=DEBUG
|
||||
spring.application.name=Demo Batch Job Task
|
||||
|
||||
Reference in New Issue
Block a user