fixed source check style miss alingments
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c4333314 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c4333314 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c4333314 Branch: refs/heads/master Commit: c43333141e07af8f2a61c54e7225ba358344835f Parents: d1c6ddc Author: Joseluis Pedrosa <joseluis.pedr...@elephanttalk.com> Authored: Thu Apr 28 16:58:09 2016 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sat May 28 08:48:19 2016 +0200 ---------------------------------------------------------------------- .../spring/batch/SpringBatchComponent.java | 4 +++- .../component/spring/batch/SpringBatchEndpoint.java | 2 +- .../component/spring/batch/SpringBatchProducer.java | 14 ++++++-------- .../spring/batch/SpringBatchEndpointTest.java | 16 ++++++++-------- 4 files changed, 18 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/c4333314/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchComponent.java b/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchComponent.java index bd1fbf9..828d58d 100644 --- a/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchComponent.java +++ b/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchComponent.java @@ -24,8 +24,10 @@ import org.springframework.batch.core.launch.JobLauncher; public class SpringBatchComponent extends UriEndpointComponent { + public static final String DYNAMIC_JOBNAME = "CamelSpringBatchDynamicJobName"; + private static final String DEFAULT_JOB_LAUNCHER_REF_NAME = "jobLauncher"; - public static final String DYNAMIC_JOBNAME = "DYNAMIC_JOBNAME_HEADER"; + private JobLauncher jobLauncher; private JobLauncher defaultResolvedJobLauncher; http://git-wip-us.apache.org/repos/asf/camel/blob/c4333314/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchEndpoint.java b/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchEndpoint.java index 72df88d..c70ba53 100644 --- a/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchEndpoint.java +++ b/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchEndpoint.java @@ -85,7 +85,7 @@ public class SpringBatchEndpoint extends DefaultEndpoint { if (jobLauncher == null) { jobLauncher = resolveJobLauncher(); } - if (job == null && jobName != null && jobName.compareTo("dynamic")!=0) { + if (job == null && jobName != null && jobName.compareTo("dynamic") != 0) { job = CamelContextHelper.mandatoryLookup(getCamelContext(), jobName, Job.class); } } http://git-wip-us.apache.org/repos/asf/camel/blob/c4333314/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchProducer.java b/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchProducer.java index a192193..188b71a 100644 --- a/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchProducer.java +++ b/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchProducer.java @@ -52,23 +52,21 @@ public class SpringBatchProducer extends DefaultProducer { Job job2run = this.job; - if (messageJobName != null) - { + if (messageJobName != null) { Job dynamicJob = CamelContextHelper.mandatoryLookup(getEndpoint().getCamelContext(), messageJobName, Job.class); job2run = dynamicJob; - if (job2run == null) - { - exchange.setException(new CamelExchangeException("Found header " + SpringBatchComponent.DYNAMIC_JOBNAME + - " with value " +messageJobName + " but could not find a Job in camel context", exchange)); + if (job2run == null) { + exchange.setException(new CamelExchangeException("Found header " + SpringBatchComponent.DYNAMIC_JOBNAME + + " with value " + messageJobName + " but could not find a Job in camel context", exchange)); return; } } if (job2run == null) { - exchange.setException( new CamelExchangeException("jobName was not specified in the endpoint construction " + - " and header "+ SpringBatchComponent.DYNAMIC_JOBNAME + " could not be found", exchange)); + exchange.setException(new CamelExchangeException("jobName was not specified in the endpoint construction " + + " and header " + SpringBatchComponent.DYNAMIC_JOBNAME + " could not be found", exchange)); return; } http://git-wip-us.apache.org/repos/asf/camel/blob/c4333314/components/camel-spring-batch/src/test/java/org/apache/camel/component/spring/batch/SpringBatchEndpointTest.java ---------------------------------------------------------------------- diff --git a/components/camel-spring-batch/src/test/java/org/apache/camel/component/spring/batch/SpringBatchEndpointTest.java b/components/camel-spring-batch/src/test/java/org/apache/camel/component/spring/batch/SpringBatchEndpointTest.java index 00e6c52..dcc0851 100644 --- a/components/camel-spring-batch/src/test/java/org/apache/camel/component/spring/batch/SpringBatchEndpointTest.java +++ b/components/camel-spring-batch/src/test/java/org/apache/camel/component/spring/batch/SpringBatchEndpointTest.java @@ -99,16 +99,16 @@ public class SpringBatchEndpointTest extends CamelTestSupport { // Tests - @Test + @Test public void dynamicJobFailsIfHeaderNotPressent() throws Exception { - mockEndpoint.expectedMessageCount(0); - errorEndpoint.expectedMessageCount(1); + mockEndpoint.expectedMessageCount(0); + errorEndpoint.expectedMessageCount(1); - //dynamic job should fail as header is not present and the job is dynamic - sendBody("direct:dyanmic", "Start the job, please."); - mockEndpoint.assertIsSatisfied(); - mockEndpoint.assertIsSatisfied(); + //dynamic job should fail as header is not present and the job is dynamic + sendBody("direct:dyanmic", "Start the job, please."); + mockEndpoint.assertIsSatisfied(); + mockEndpoint.assertIsSatisfied(); } @Test @@ -118,7 +118,7 @@ public class SpringBatchEndpointTest extends CamelTestSupport { errorEndpoint.expectedMessageCount(1); //dynamic job should fail as header is present but the job does not exists - header(SpringBatchComponent.DYNAMIC_JOBNAME).append("thisJobDoesNotExsistAtAll" +Date.from(Instant.now())); + header(SpringBatchComponent.DYNAMIC_JOBNAME).append("thisJobDoesNotExsistAtAll" + Date.from(Instant.now())); sendBody("direct:dyanmic", "Start the job, please."); mockEndpoint.assertIsSatisfied();