cleanup
This commit is contained in:
@@ -35,7 +35,7 @@ public class DefaultJobKeyGeneratorTests {
|
||||
"foo", "bar").addString("bar", "foo").toJobParameters();
|
||||
JobParameters jobParameters2 = new JobParametersBuilder().addString(
|
||||
"foo", "bar", true).addString("bar", "foo", true)
|
||||
.addString("ignoreMe", "irrelivant", false).toJobParameters();
|
||||
.addString("ignoreMe", "irrelevant", false).toJobParameters();
|
||||
String key1 = jobKeyGenerator.generateKey(jobParameters1);
|
||||
String key2 = jobKeyGenerator.generateKey(jobParameters2);
|
||||
assertEquals(key1, key2);
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
/**
|
||||
/*
|
||||
* Copyright 2008-2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core;
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008-2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -60,7 +60,7 @@ public class MapJobRepositoryConfigurationTests {
|
||||
testConfigurationClass(InvalidBatchConfiguration.class);
|
||||
}
|
||||
|
||||
private void testConfigurationClass(Class clazz) throws Exception {
|
||||
private void testConfigurationClass(Class<?> clazz) throws Exception {
|
||||
GenericApplicationContext context = new AnnotationConfigApplicationContext(clazz);
|
||||
this.jobLauncher = context.getBean(JobLauncher.class);
|
||||
this.jobRepository = context.getBean(JobRepository.class);
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.support;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2010 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.support;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2010-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.support;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -40,6 +55,7 @@ public class AutomaticJobRegistrarTests {
|
||||
registrar.setJobLoader(jobLoader);
|
||||
}
|
||||
|
||||
@SuppressWarnings("cast")
|
||||
@Test
|
||||
public void testOrderedImplemented() throws Exception {
|
||||
|
||||
@@ -57,6 +73,7 @@ public class AutomaticJobRegistrarTests {
|
||||
new ClassPathResource("org/springframework/batch/core/launch/support/job.xml"),
|
||||
new ClassPathResource("org/springframework/batch/core/launch/support/job2.xml") };
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
GenericApplicationContext applicationContext = new GenericApplicationContext();
|
||||
applicationContext.refresh();
|
||||
setUpApplicationContextFactories(jobPaths, applicationContext);
|
||||
@@ -79,6 +96,7 @@ public class AutomaticJobRegistrarTests {
|
||||
|
||||
Resource[] jobPaths = new Resource[] { new ClassPathResource(
|
||||
"org/springframework/batch/core/launch/support/test-environment.xml") };
|
||||
@SuppressWarnings("resource")
|
||||
GenericApplicationContext applicationContext = new GenericApplicationContext();
|
||||
applicationContext.refresh();
|
||||
setUpApplicationContextFactories(jobPaths, applicationContext);
|
||||
@@ -91,6 +109,7 @@ public class AutomaticJobRegistrarTests {
|
||||
|
||||
Resource[] jobPaths = new Resource[] { new ClassPathResource(
|
||||
"org/springframework/batch/core/launch/support/2jobs.xml") };
|
||||
@SuppressWarnings("resource")
|
||||
GenericApplicationContext applicationContext = new GenericApplicationContext();
|
||||
applicationContext.refresh();
|
||||
setUpApplicationContextFactories(jobPaths, applicationContext);
|
||||
@@ -104,6 +123,7 @@ public class AutomaticJobRegistrarTests {
|
||||
|
||||
Resource[] jobPaths = new Resource[] { new ClassPathResource(
|
||||
"org/springframework/batch/core/launch/support/2jobs.xml") };
|
||||
@SuppressWarnings("resource")
|
||||
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
||||
"/org/springframework/batch/core/launch/support/test-environment-with-registry-and-auto-register.xml");
|
||||
registrar.setApplicationContext(applicationContext);
|
||||
@@ -156,6 +176,7 @@ public class AutomaticJobRegistrarTests {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Test
|
||||
public void testInitCalledOnContextRefreshed() throws Exception {
|
||||
|
||||
@@ -176,6 +197,7 @@ public class AutomaticJobRegistrarTests {
|
||||
|
||||
Resource[] jobPaths = new Resource[] { new ClassPathResource(
|
||||
"org/springframework/batch/core/launch/support/2jobs.xml") };
|
||||
@SuppressWarnings("resource")
|
||||
GenericApplicationContext applicationContext = new GenericApplicationContext();
|
||||
applicationContext.refresh();
|
||||
setUpApplicationContextFactories(jobPaths, applicationContext);
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.springframework.batch.core.JobParametersIncrementer;
|
||||
import org.springframework.batch.core.JobParametersValidator;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.configuration.DuplicateJobException;
|
||||
import org.springframework.batch.core.configuration.JobFactory;
|
||||
import org.springframework.batch.core.configuration.JobRegistry;
|
||||
import org.springframework.batch.core.configuration.StepRegistry;
|
||||
import org.springframework.batch.core.launch.NoSuchJobException;
|
||||
@@ -257,25 +256,4 @@ public class DefaultJobLoaderTests {
|
||||
}
|
||||
}
|
||||
|
||||
private static class JobRegistryMock implements JobRegistry {
|
||||
@Override
|
||||
public void register(JobFactory jobFactory) throws DuplicateJobException {
|
||||
// dummy
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregister(String jobName) {
|
||||
// dummy
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getJobNames() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Job getJob(String name) throws NoSuchJobException {
|
||||
throw new NoSuchJobException("Mock implementation does not hold any job.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ public class GenericApplicationContextFactoryTests {
|
||||
public void testCreateJob() {
|
||||
GenericApplicationContextFactory factory = new GenericApplicationContextFactory(
|
||||
new ClassPathResource(ClassUtils.addResourcePathToPackagePath(getClass(), "trivial-context.xml")));
|
||||
@SuppressWarnings("resource")
|
||||
ConfigurableApplicationContext context = factory.createApplicationContext();
|
||||
assertNotNull(context);
|
||||
assertTrue("Wrong id: " + context, context.getId().contains("trivial-context.xml"));
|
||||
@@ -50,6 +51,7 @@ public class GenericApplicationContextFactoryTests {
|
||||
assertEquals("test-job", factory.createApplicationContext().getBeanNamesForType(Job.class)[0]);
|
||||
}
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Test
|
||||
public void testParentConfigurationInherited() {
|
||||
GenericApplicationContextFactory factory = new GenericApplicationContextFactory(
|
||||
@@ -62,6 +64,7 @@ public class GenericApplicationContextFactoryTests {
|
||||
assertEquals(4, context.getBean("foo", Foo.class).values[1], 0.01);
|
||||
}
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Test
|
||||
public void testBeanFactoryPostProcessorOrderRespected() {
|
||||
GenericApplicationContextFactory factory = new GenericApplicationContextFactory(
|
||||
@@ -77,15 +80,18 @@ public class GenericApplicationContextFactoryTests {
|
||||
public void testBeanFactoryProfileRespected() {
|
||||
GenericApplicationContextFactory factory = new GenericApplicationContextFactory(
|
||||
new ClassPathResource(ClassUtils.addResourcePathToPackagePath(getClass(), "profiles.xml")));
|
||||
@SuppressWarnings("resource")
|
||||
ClassPathXmlApplicationContext parentContext = new ClassPathXmlApplicationContext(ClassUtils.addResourcePathToPackagePath(
|
||||
getClass(), "parent-context.xml"));
|
||||
parentContext.getEnvironment().setActiveProfiles("preferred");
|
||||
factory.setApplicationContext(parentContext);
|
||||
@SuppressWarnings("resource")
|
||||
ConfigurableApplicationContext context = factory.createApplicationContext();
|
||||
assertEquals("test-job", context.getBeanNamesForType(Job.class)[0]);
|
||||
assertEquals("spam", context.getBean("test-job", Job.class).getName());
|
||||
}
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Test
|
||||
public void testBeanFactoryPostProcessorsNotCopied() {
|
||||
GenericApplicationContextFactory factory = new GenericApplicationContextFactory(
|
||||
@@ -101,6 +107,7 @@ public class GenericApplicationContextFactoryTests {
|
||||
assertEquals(4, context.getBean("foo", Foo.class).values[1], 0.01);
|
||||
}
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Test
|
||||
public void testBeanFactoryConfigurationNotCopied() {
|
||||
GenericApplicationContextFactory factory = new GenericApplicationContextFactory(new ClassPathResource(ClassUtils.addResourcePathToPackagePath(getClass(),
|
||||
|
||||
@@ -110,6 +110,7 @@ public class JobRegistryBeanPostProcessorTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testExecutionWithApplicationContext() throws Exception {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("test-context.xml", getClass());
|
||||
MapJobRegistry registry = (MapJobRegistry) context.getBean("registry");
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.support;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
@@ -60,7 +60,7 @@ public abstract class AbstractJobParserTests {
|
||||
*/
|
||||
protected JobExecution createJobExecution() throws JobInstanceAlreadyCompleteException, JobRestartException,
|
||||
JobExecutionAlreadyRunningException {
|
||||
return jobRepository.createJobExecution(job.getName(), new JobParametersBuilder().addLong("key1", 1l).toJobParameters());
|
||||
return jobRepository.createJobExecution(job.getName(), new JobParametersBuilder().addLong("key1", 1L).toJobParameters());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
public abstract class AbstractTestComponent {
|
||||
|
||||
@@ -32,21 +32,21 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
public class AutoRegisteringJobScopeTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testJobElement() throws Exception {
|
||||
ConfigurableApplicationContext ctx =
|
||||
new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/AutoRegisteringJobScopeForJobElementTests-context.xml");
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, JobScope> beans = ctx.getBeansOfType(JobScope.class);
|
||||
assertTrue("JobScope not defined properly", beans.size() == 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testStepElement() throws Exception {
|
||||
ConfigurableApplicationContext ctx =
|
||||
new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/AutoRegisteringJobScopeForStepElementTests-context.xml");
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, JobScope> beans = ctx.getBeansOfType(JobScope.class);
|
||||
assertTrue("JobScope not defined properly", beans.size() == 1);
|
||||
}
|
||||
|
||||
@@ -31,19 +31,19 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
public class AutoRegisteringStepScopeTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testJobElement() throws Exception {
|
||||
ConfigurableApplicationContext ctx =
|
||||
new ClassPathXmlApplicationContext("org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForJobElementTests-context.xml");
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, StepScope> beans = ctx.getBeansOfType(StepScope.class);
|
||||
assertTrue("StepScope not defined properly", beans.size() == 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testStepElement() throws Exception {
|
||||
ConfigurableApplicationContext ctx =
|
||||
new ClassPathXmlApplicationContext("org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForStepElementTests-context.xml");
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, StepScope> beans = ctx.getBeansOfType(StepScope.class);
|
||||
assertTrue("StepScope not defined properly", beans.size() == 1);
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ import org.springframework.util.StringUtils;
|
||||
public class ChunkElementParserTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testSimpleAttributes() throws Exception {
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ChunkElementSimpleAttributeParserTests-context.xml");
|
||||
@@ -69,27 +70,30 @@ public class ChunkElementParserTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testCommitIntervalLateBinding() throws Exception {
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ChunkElementLateBindingParserTests-context.xml");
|
||||
Step step = (Step) context.getBean("s1", Step.class);
|
||||
Step step = context.getBean("s1", Step.class);
|
||||
assertNotNull("Step not parsed", step);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testSkipAndRetryAttributes() throws Exception {
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ChunkElementSkipAndRetryAttributeParserTests-context.xml");
|
||||
Step step = (Step) context.getBean("s1", Step.class);
|
||||
Step step = context.getBean("s1", Step.class);
|
||||
assertNotNull("Step not parsed", step);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testIllegalSkipAndRetryAttributes() throws Exception {
|
||||
try {
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ChunkElementIllegalSkipAndRetryAttributeParserTests-context.xml");
|
||||
Step step = (Step) context.getBean("s1", Step.class);
|
||||
Step step = context.getBean("s1", Step.class);
|
||||
assertNotNull("Step not parsed", step);
|
||||
fail("Expected BeanCreationException");
|
||||
} catch (BeanCreationException e) {
|
||||
@@ -99,6 +103,7 @@ public class ChunkElementParserTests {
|
||||
|
||||
@Test
|
||||
public void testRetryPolicyAttribute() throws Exception {
|
||||
@SuppressWarnings("resource")
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ChunkElementRetryPolicyParserTests-context.xml");
|
||||
Map<Class<? extends Throwable>, Boolean> retryable = getNestedExceptionMap("s1", context,
|
||||
@@ -111,6 +116,7 @@ public class ChunkElementParserTests {
|
||||
|
||||
@Test
|
||||
public void testRetryPolicyElement() throws Exception {
|
||||
@SuppressWarnings("resource")
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ChunkElementRetryPolicyParserTests-context.xml");
|
||||
SimpleRetryPolicy policy = (SimpleRetryPolicy) getPolicy("s2", context,
|
||||
@@ -120,6 +126,7 @@ public class ChunkElementParserTests {
|
||||
|
||||
@Test
|
||||
public void testSkipPolicyAttribute() throws Exception {
|
||||
@SuppressWarnings("resource")
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ChunkElementSkipPolicyParserTests-context.xml");
|
||||
SkipPolicy policy = getSkipPolicy("s1", context);
|
||||
@@ -129,6 +136,7 @@ public class ChunkElementParserTests {
|
||||
|
||||
@Test
|
||||
public void testSkipPolicyElement() throws Exception {
|
||||
@SuppressWarnings("resource")
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ChunkElementSkipPolicyParserTests-context.xml");
|
||||
SkipPolicy policy = getSkipPolicy("s2", context);
|
||||
@@ -137,6 +145,7 @@ public class ChunkElementParserTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testProcessorTransactionalAttributes() throws Exception {
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ChunkElementTransactionalAttributeParserTests-context.xml");
|
||||
@@ -150,6 +159,7 @@ public class ChunkElementParserTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testProcessorTransactionalNotAllowedOnSimpleProcessor() throws Exception {
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ChunkElementIllegalAttributeParserTests-context.xml");
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.core.annotation.BeforeJob;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.core.annotation.BeforeStep;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.repeat.CompletionPolicy;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.item.ItemProcessor;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2010 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.retry.RetryCallback;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.core.StepContribution;
|
||||
|
||||
@@ -28,12 +28,14 @@ import org.springframework.util.ClassUtils;
|
||||
public class DuplicateTransitionJobParserTests {
|
||||
|
||||
@Test(expected = BeanDefinitionStoreException.class)
|
||||
@SuppressWarnings("resource")
|
||||
public void testNextAttributeWithNestedElement() throws Exception {
|
||||
new ClassPathXmlApplicationContext(ClassUtils.addResourcePathToPackagePath(getClass(),
|
||||
"NextAttributeMultipleFinalJobParserTests-context.xml"));
|
||||
}
|
||||
|
||||
@Test(expected = BeanDefinitionStoreException.class)
|
||||
@SuppressWarnings("resource")
|
||||
public void testDuplicateTransition() throws Exception {
|
||||
new ClassPathXmlApplicationContext(ClassUtils.addResourcePathToPackagePath(getClass(),
|
||||
"DuplicateTransitionJobParserTests-context.xml"));
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.batch.repeat.RepeatStatus;
|
||||
/**
|
||||
* This tasklet will call
|
||||
* {@link NameStoringTasklet#execute(StepContribution, ChunkContext)} and then
|
||||
* throw an exeception.
|
||||
* throw an exception.
|
||||
*
|
||||
* @author Dan Garrette
|
||||
* @since 2.0
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -88,7 +103,7 @@ public class InlineItemHandlerParserTests {
|
||||
"org/springframework/batch/core/configuration/xml/InlineItemHandlerWithStepScopeParserTests-context.xml");
|
||||
StepSynchronizationManager.register(new StepExecution("step", new JobExecution(123L)));
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SuppressWarnings({ "rawtypes" })
|
||||
Map<String,ItemReader> readers = context.getBeansOfType(ItemReader.class);
|
||||
// Should be 2 each (proxy and target) for the two readers in the steps defined
|
||||
assertEquals(4, readers.size());
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2010 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.core.ExitStatus;
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.springframework.test.util.ReflectionTestUtils;
|
||||
public class ParentStepFactoryBeanParserTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testSimpleAttributes() throws Exception {
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ParentStepFactoryBeanParserTests-context.xml");
|
||||
@@ -43,6 +44,7 @@ public class ParentStepFactoryBeanParserTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testSkippableAttributes() throws Exception {
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ParentSkippableStepFactoryBeanParserTests-context.xml");
|
||||
@@ -54,6 +56,7 @@ public class ParentStepFactoryBeanParserTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testRetryableAttributes() throws Exception {
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ParentRetryableStepFactoryBeanParserTests-context.xml");
|
||||
@@ -66,6 +69,7 @@ public class ParentStepFactoryBeanParserTests {
|
||||
|
||||
// BATCH-1396
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testRetryableLateBindingAttributes() throws Exception {
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ParentRetryableLateBindingStepFactoryBeanParserTests-context.xml");
|
||||
@@ -78,6 +82,7 @@ public class ParentStepFactoryBeanParserTests {
|
||||
|
||||
// BATCH-1396
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testSkippableLateBindingAttributes() throws Exception {
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/ParentSkippableLateBindingStepFactoryBeanParserTests-context.xml");
|
||||
|
||||
@@ -143,8 +143,8 @@ public class PartitionStepParserTests implements ApplicationContextAware {
|
||||
|
||||
/**
|
||||
* BATCH-1509 we now support the ability define steps inline for partitioned
|
||||
* steps. this demonstates that the execution proceeds as expected and that
|
||||
* the partitionhandler has a reference to the inline step definition
|
||||
* steps. this demonstrates that the execution proceeds as expected and that
|
||||
* the partition handler has a reference to the inline step definition
|
||||
*/
|
||||
@Test
|
||||
public void testNestedPartitionStepStepReference() throws Throwable {
|
||||
@@ -178,8 +178,8 @@ public class PartitionStepParserTests implements ApplicationContextAware {
|
||||
|
||||
/**
|
||||
* BATCH-1509 we now support the ability define steps inline for partitioned
|
||||
* steps. this demonstates that the execution proceeds as expected and that
|
||||
* the partitionhandler has a reference to the inline step definition
|
||||
* steps. this demonstrates that the execution proceeds as expected and that
|
||||
* the partition handler has a reference to the inline step definition
|
||||
*/
|
||||
@Test
|
||||
public void testNestedPartitionStep() throws Throwable {
|
||||
|
||||
@@ -55,7 +55,6 @@ public class StepNameTests {
|
||||
catch (BeanCreationException e) {
|
||||
return;
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, StepLocator> stepLocators = context.getBeansOfType(StepLocator.class);
|
||||
this.stepLocators = stepLocators;
|
||||
}
|
||||
|
||||
@@ -77,10 +77,11 @@ public class StepParserTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testTaskletStepAttributes() throws Exception {
|
||||
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml");
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SuppressWarnings({ "rawtypes" })
|
||||
Map<String, StepParserStepFactoryBean> beans = ctx.getBeansOfType(StepParserStepFactoryBean.class);
|
||||
String factoryName = (String) beans.keySet().toArray()[0];
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -92,10 +93,10 @@ public class StepParserTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testStepParserBeanName() throws Exception {
|
||||
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/StepParserBeanNameTests-context.xml");
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
|
||||
assertTrue("'s1' bean not found", beans.containsKey("s1"));
|
||||
Step s1 = (Step) ctx.getBean("s1");
|
||||
@@ -103,16 +104,17 @@ public class StepParserTests {
|
||||
}
|
||||
|
||||
@Test(expected = BeanDefinitionParsingException.class)
|
||||
@SuppressWarnings("resource")
|
||||
public void testStepParserCommitIntervalCompletionPolicy() throws Exception {
|
||||
new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/StepParserCommitIntervalCompletionPolicyTests-context.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testStepParserCommitInterval() throws Exception {
|
||||
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/StepParserCommitIntervalTests-context.xml");
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
|
||||
assertTrue("'s1' bean not found", beans.containsKey("s1"));
|
||||
Step s1 = (Step) ctx.getBean("s1");
|
||||
@@ -122,10 +124,10 @@ public class StepParserTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testStepParserCompletionPolicy() throws Exception {
|
||||
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/StepParserCompletionPolicyTests-context.xml");
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
|
||||
assertTrue("'s1' bean not found", beans.containsKey("s1"));
|
||||
Step s1 = (Step) ctx.getBean("s1");
|
||||
@@ -141,18 +143,21 @@ public class StepParserTests {
|
||||
}
|
||||
|
||||
@Test(expected = BeanDefinitionParsingException.class)
|
||||
@SuppressWarnings("resource")
|
||||
public void testStepParserNoCommitIntervalOrCompletionPolicy() throws Exception {
|
||||
new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/StepParserNoCommitIntervalOrCompletionPolicyTests-context.xml");
|
||||
}
|
||||
|
||||
@Test(expected = BeanDefinitionParsingException.class)
|
||||
@SuppressWarnings("resource")
|
||||
public void testTaskletStepWithBadStepListener() throws Exception {
|
||||
new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/StepParserBadStepListenerTests-context.xml");
|
||||
}
|
||||
|
||||
@Test(expected = BeanDefinitionParsingException.class)
|
||||
@SuppressWarnings("resource")
|
||||
public void testTaskletStepWithBadRetryListener() throws Exception {
|
||||
new ClassPathXmlApplicationContext(
|
||||
"org/springframework/batch/core/configuration/xml/StepParserBadRetryListenerTests-context.xml");
|
||||
|
||||
@@ -78,7 +78,7 @@ public class StepWithSimpleTaskJobParserTests {
|
||||
private TestTasklet assertTasklet(Job job, String stepName, String taskletName) {
|
||||
System.err.println(((FlowJob) job).getStepNames());
|
||||
Step step = ((FlowJob) job).getStep(stepName);
|
||||
assertTrue("Wong type for step name="+stepName+": "+step, step instanceof TaskletStep);
|
||||
assertTrue("Wrong type for step name="+stepName+": "+step, step instanceof TaskletStep);
|
||||
Object tasklet = ReflectionTestUtils.getField(step, "tasklet");
|
||||
assertTrue(tasklet instanceof TestTasklet);
|
||||
TestTasklet testTasklet = (TestTasklet) tasklet;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.core.ExitStatus;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.core.annotation.BeforeJob;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.core.ExitStatus;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2010 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.item.ItemProcessor;
|
||||
|
||||
@@ -1,10 +1,24 @@
|
||||
/*
|
||||
* Copyright 2008-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ItemStreamException;
|
||||
import org.springframework.batch.item.ItemStreamReader;
|
||||
import org.springframework.batch.item.ParseException;
|
||||
import org.springframework.batch.item.UnexpectedInputException;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.retry.RetryCallback;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import org.springframework.batch.core.StepContribution;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008-2012 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.converter;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -92,7 +92,7 @@ public class JobExplorerFactoryBeanTests {
|
||||
public void testCreateExplorer() throws Exception {
|
||||
|
||||
factory.afterPropertiesSet();
|
||||
JobExplorer explorer = (JobExplorer) factory.getObject();
|
||||
JobExplorer explorer = factory.getObject();
|
||||
assertNotNull(explorer);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2010-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.explore.support;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -6,7 +21,6 @@ import org.junit.Test;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.explore.JobExplorer;
|
||||
import org.springframework.batch.core.explore.support.MapJobExplorerFactoryBean;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
import org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean;
|
||||
|
||||
/**
|
||||
@@ -22,12 +36,12 @@ public class MapJobExplorerFactoryBeanTests {
|
||||
public void testCreateExplorer() throws Exception {
|
||||
|
||||
MapJobRepositoryFactoryBean repositoryFactory = new MapJobRepositoryFactoryBean();
|
||||
(repositoryFactory.getObject()).createJobExecution("foo", new JobParameters());
|
||||
repositoryFactory.getObject().createJobExecution("foo", new JobParameters());
|
||||
|
||||
MapJobExplorerFactoryBean tested = new MapJobExplorerFactoryBean(repositoryFactory);
|
||||
tested.afterPropertiesSet();
|
||||
|
||||
JobExplorer explorer = (JobExplorer) tested.getObject();
|
||||
JobExplorer explorer = tested.getObject();
|
||||
|
||||
assertEquals(1, explorer.findRunningJobExecutions("foo").size());
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public class MapJobExplorerIntegrationTests {
|
||||
jobLauncher.run(job, new JobParametersBuilder().addString("test", getClass().getName()).toJobParameters());
|
||||
|
||||
Thread.sleep(500L);
|
||||
JobExplorer explorer = (JobExplorer) new MapJobExplorerFactoryBean(repositoryFactory).getObject();
|
||||
JobExplorer explorer = new MapJobExplorerFactoryBean(repositoryFactory).getObject();
|
||||
Set<JobExecution> executions = explorer.findRunningJobExecutions("job");
|
||||
assertEquals(1, executions.size());
|
||||
assertEquals(1, executions.iterator().next().getStepExecutions().size());
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
/**
|
||||
*
|
||||
/*
|
||||
* Copyright 2013-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.explore.support;
|
||||
|
||||
@@ -50,7 +62,7 @@ import test.jdbc.datasource.DataSourceInitializer;
|
||||
* To illustrate the issue the test simulates the behavior of the {@code StepExecutionRequestHandler}
|
||||
* from the spring-batch-integration project.
|
||||
*
|
||||
* @author "Sergey Shcherbakov"
|
||||
* @author Sergey Shcherbakov
|
||||
*/
|
||||
@ContextConfiguration(classes={SimpleJobExplorerIntegrationTests.Config.class})
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@@ -65,7 +77,7 @@ public class SimpleJobExplorerIntegrationTests {
|
||||
|
||||
@Bean
|
||||
public JobExplorer jobExplorer() throws Exception {
|
||||
return (JobExplorer) jobExplorerFactoryBean().getObject();
|
||||
return jobExplorerFactoryBean().getObject();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2009 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.job;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.job;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -32,7 +47,7 @@ public class SimpleJobFailureTests {
|
||||
|
||||
@Before
|
||||
public void init() throws Exception {
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getJobRepository();
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
|
||||
job.setJobRepository(jobRepository);
|
||||
execution = jobRepository.createJobExecution("job", new JobParameters());
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.springframework.batch.core.job;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
@@ -529,7 +528,7 @@ public class SimpleJobTests {
|
||||
*/
|
||||
private void checkRepository(BatchStatus status, ExitStatus exitStatus) {
|
||||
assertEquals(jobInstance, jobInstanceDao.getJobInstance(job.getName(), jobParameters));
|
||||
// because map dao stores in memory, it can be checked directly
|
||||
// because map DAO stores in memory, it can be checked directly
|
||||
JobExecution jobExecution = jobExecutionDao.findJobExecutions(jobInstance).get(0);
|
||||
assertEquals(jobInstance.getId(), jobExecution.getJobId());
|
||||
assertEquals(status, jobExecution.getStatus());
|
||||
|
||||
@@ -45,7 +45,7 @@ public class SimpleStepHandlerTests {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
MapJobRepositoryFactoryBean jobRepositoryFactoryBean = new MapJobRepositoryFactoryBean();
|
||||
jobRepository = jobRepositoryFactoryBean.getJobRepository();
|
||||
jobRepository = jobRepositoryFactoryBean.getObject();
|
||||
jobExecution = jobRepository.createJobExecution("job", new JobParameters());
|
||||
stepHandler = new SimpleStepHandler(jobRepository);
|
||||
stepHandler.afterPropertiesSet();
|
||||
|
||||
@@ -37,7 +37,7 @@ public class FlowBuilderTests {
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
FlowBuilder<Flow> builder = new FlowBuilder<Flow>("flow");
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getJobRepository();
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
|
||||
JobExecution execution = jobRepository.createJobExecution("foo", new JobParameters());
|
||||
builder.start(new StepSupport("step") {
|
||||
@Override
|
||||
|
||||
@@ -87,7 +87,7 @@ public class FlowJobBuilderTests {
|
||||
|
||||
@Before
|
||||
public void init() throws Exception {
|
||||
jobRepository = new MapJobRepositoryFactoryBean().getJobRepository();
|
||||
jobRepository = new MapJobRepositoryFactoryBean().getObject();
|
||||
execution = jobRepository.createJobExecution("flow", new JobParameters());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2010-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.job.flow;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -37,7 +52,7 @@ public class FlowJobFailureTests {
|
||||
|
||||
@Before
|
||||
public void init() throws Exception {
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getJobRepository();
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
|
||||
job.setJobRepository(jobRepository);
|
||||
execution = jobRepository.createJobExecution("job", new JobParameters());
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class FlowStepTests {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
jobRepository = new MapJobRepositoryFactoryBean().getJobRepository();
|
||||
jobRepository = new MapJobRepositoryFactoryBean().getObject();
|
||||
jobExecution = jobRepository.createJobExecution("job", new JobParameters());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr;
|
||||
|
||||
import static org.mockito.Mockito.doThrow;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr;
|
||||
|
||||
import static org.mockito.Mockito.doThrow;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr;
|
||||
|
||||
import static org.mockito.Mockito.doThrow;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr;
|
||||
|
||||
import static org.mockito.Mockito.doThrow;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class JsrJobContextFactoryBeanTests {
|
||||
|
||||
@Test
|
||||
public void testIntialCreationSingleThread() throws Exception {
|
||||
factoryBean.setJobExecution(new JobExecution(5l));
|
||||
factoryBean.setJobExecution(new JobExecution(5L));
|
||||
factoryBean.setBatchPropertyContext(propertyContext);
|
||||
|
||||
assertTrue(factoryBean.getObjectType().isAssignableFrom(JobContext.class));
|
||||
@@ -68,8 +68,8 @@ public class JsrJobContextFactoryBeanTests {
|
||||
JobContext jobContext1 = factoryBean.getObject();
|
||||
JobContext jobContext2 = factoryBean.getObject();
|
||||
|
||||
assertEquals(5l, jobContext1.getExecutionId());
|
||||
assertEquals(5l, jobContext2.getExecutionId());
|
||||
assertEquals(5L, jobContext1.getExecutionId());
|
||||
assertEquals(5L, jobContext2.getExecutionId());
|
||||
assertTrue(jobContext1 == jobContext2);
|
||||
}
|
||||
|
||||
@@ -77,11 +77,11 @@ public class JsrJobContextFactoryBeanTests {
|
||||
public void testInitialCreationSingleThreadUsingStepScope() throws Exception {
|
||||
factoryBean.setBatchPropertyContext(propertyContext);
|
||||
|
||||
StepSynchronizationManager.register(new StepExecution("step1", new JobExecution(5l)));
|
||||
StepSynchronizationManager.register(new StepExecution("step1", new JobExecution(5L)));
|
||||
|
||||
JobContext jobContext = factoryBean.getObject();
|
||||
|
||||
assertEquals(5l, jobContext.getExecutionId());
|
||||
assertEquals(5L, jobContext.getExecutionId());
|
||||
StepSynchronizationManager.close();
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class JsrJobContextFactoryBeanTests {
|
||||
try {
|
||||
StepSynchronizationManager.register(new StepExecution("step" + count, new JobExecution(count)));
|
||||
JobContext context = factoryBean.getObject();
|
||||
Thread.sleep(1000l);
|
||||
Thread.sleep(1000L);
|
||||
return context;
|
||||
} catch (Throwable ignore) {
|
||||
return null;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -29,7 +44,7 @@ public class JsrJobExecutionTests {
|
||||
|
||||
execution.setId(5L);
|
||||
execution.setCreateTime(new Date(0));
|
||||
execution.setEndTime(new Date(999999999l));
|
||||
execution.setEndTime(new Date(999999999L));
|
||||
execution.setExitStatus(new ExitStatus("exit status"));
|
||||
execution.setLastUpdated(new Date(12345));
|
||||
execution.setStartTime(new Date(98765));
|
||||
@@ -48,7 +63,7 @@ public class JsrJobExecutionTests {
|
||||
public void testGetBasicValues() {
|
||||
assertEquals(javax.batch.runtime.BatchStatus.FAILED, adapter.getBatchStatus());
|
||||
assertEquals(new Date(0), adapter.getCreateTime());
|
||||
assertEquals(new Date(999999999l), adapter.getEndTime());
|
||||
assertEquals(new Date(999999999L), adapter.getEndTime());
|
||||
assertEquals(5L, adapter.getExecutionId());
|
||||
assertEquals("exit status", adapter.getExitStatus());
|
||||
assertEquals("job name", adapter.getJobName());
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -59,7 +74,7 @@ public class JsrJobParametersConverterTests {
|
||||
|
||||
@Test
|
||||
public void testNonStringJobParameters() {
|
||||
JobParameters parameters = new JobParametersBuilder().addLong("key", 5l, false).toJobParameters();
|
||||
JobParameters parameters = new JobParametersBuilder().addLong("key", 5L, false).toJobParameters();
|
||||
Properties props = converter.getProperties(parameters);
|
||||
assertNotNull(props);
|
||||
Set<Entry<Object, Object>> properties = props.entrySet();
|
||||
@@ -70,7 +85,7 @@ public class JsrJobParametersConverterTests {
|
||||
|
||||
@Test
|
||||
public void testJobParametersWithRunId() {
|
||||
JobParameters parameters = new JobParametersBuilder().addLong("key", 5l, false).addLong(JsrJobParametersConverter.JOB_RUN_ID, 2l).toJobParameters();
|
||||
JobParameters parameters = new JobParametersBuilder().addLong("key", 5L, false).addLong(JsrJobParametersConverter.JOB_RUN_ID, 2L).toJobParameters();
|
||||
Properties props = converter.getProperties(parameters);
|
||||
assertNotNull(props);
|
||||
Set<Entry<Object, Object>> properties = props.entrySet();
|
||||
@@ -105,7 +120,7 @@ public class JsrJobParametersConverterTests {
|
||||
JobParameters parameters = converter.getJobParameters(properties);
|
||||
assertEquals(2, parameters.getParameters().size());
|
||||
assertEquals("value", parameters.getString("key"));
|
||||
assertEquals(Long.valueOf(3l), parameters.getLong(JsrJobParametersConverter.JOB_RUN_ID));
|
||||
assertEquals(Long.valueOf(3L), parameters.getLong(JsrJobParametersConverter.JOB_RUN_ID));
|
||||
assertTrue(parameters.getParameters().get(JsrJobParametersConverter.JOB_RUN_ID).isIdentifying());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -62,24 +77,24 @@ public class JsrStepContextFactoryBeanTests {
|
||||
|
||||
@Test
|
||||
public void getObjectSingleThread() throws Exception {
|
||||
StepSynchronizationManager.register(new StepExecution("step1", new JobExecution(5l), 3l));
|
||||
StepSynchronizationManager.register(new StepExecution("step1", new JobExecution(5L), 3L));
|
||||
|
||||
StepContext context1 = factory.getObject();
|
||||
StepContext context2 = factory.getObject();
|
||||
|
||||
assertTrue(context1 == context2);
|
||||
assertEquals(3l, context1.getStepExecutionId());
|
||||
assertEquals(3L, context1.getStepExecutionId());
|
||||
|
||||
StepSynchronizationManager.close();
|
||||
|
||||
StepSynchronizationManager.register(new StepExecution("step2", new JobExecution(5l), 2l));
|
||||
StepSynchronizationManager.register(new StepExecution("step2", new JobExecution(5L), 2L));
|
||||
|
||||
StepContext context3 = factory.getObject();
|
||||
StepContext context4 = factory.getObject();
|
||||
|
||||
assertTrue(context3 == context4);
|
||||
assertTrue(context3 != context2);
|
||||
assertEquals(2l, context3.getStepExecutionId());
|
||||
assertEquals(2L, context3.getStepExecutionId());
|
||||
|
||||
StepSynchronizationManager.close();
|
||||
}
|
||||
@@ -91,13 +106,13 @@ public class JsrStepContextFactoryBeanTests {
|
||||
|
||||
when(propertyContext.getStepProperties("step3")).thenReturn(props);
|
||||
|
||||
StepSynchronizationManager.register(new StepExecution("step3", new JobExecution(5l), 3l));
|
||||
StepSynchronizationManager.register(new StepExecution("step3", new JobExecution(5L), 3L));
|
||||
|
||||
StepContext context1 = factory.getObject();
|
||||
StepContext context2 = factory.getObject();
|
||||
|
||||
assertTrue(context1 == context2);
|
||||
assertEquals(3l, context1.getStepExecutionId());
|
||||
assertEquals(3L, context1.getStepExecutionId());
|
||||
assertEquals("value1", context1.getProperties().get("key1"));
|
||||
|
||||
StepSynchronizationManager.close();
|
||||
@@ -118,7 +133,7 @@ public class JsrStepContextFactoryBeanTests {
|
||||
try {
|
||||
StepSynchronizationManager.register(new StepExecution("step" + count, new JobExecution(count)));
|
||||
StepContext context = factory.getObject();
|
||||
Thread.sleep(1000l);
|
||||
Thread.sleep(1000L);
|
||||
return context;
|
||||
} catch (Throwable ignore) {
|
||||
return null;
|
||||
@@ -159,7 +174,7 @@ public class JsrStepContextFactoryBeanTests {
|
||||
try {
|
||||
StepSynchronizationManager.register(new StepExecution("step" + count, new JobExecution(count)));
|
||||
StepContext context = factory.getObject();
|
||||
Thread.sleep(1000l);
|
||||
Thread.sleep(1000L);
|
||||
return context;
|
||||
} catch (Throwable ignore) {
|
||||
return null;
|
||||
|
||||
@@ -45,10 +45,10 @@ public class JsrStepContextTests {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
JobExecution jobExecution = new JobExecution(1l, new JobParametersBuilder().addString("key", "value").toJobParameters());
|
||||
JobExecution jobExecution = new JobExecution(1L, new JobParametersBuilder().addString("key", "value").toJobParameters());
|
||||
|
||||
stepExecution = new StepExecution("testStep", jobExecution);
|
||||
stepExecution.setId(5l);
|
||||
stepExecution.setId(5L);
|
||||
stepExecution.setStatus(BatchStatus.STARTED);
|
||||
stepExecution.setExitStatus(new ExitStatus("customExitStatus"));
|
||||
stepExecution.setCommitCount(1);
|
||||
@@ -75,7 +75,7 @@ public class JsrStepContextTests {
|
||||
assertEquals(null, stepContext.getExitStatus());
|
||||
stepContext.setExitStatus("customExitStatus");
|
||||
assertEquals("customExitStatus", stepContext.getExitStatus());
|
||||
assertEquals(5l, stepContext.getStepExecutionId());
|
||||
assertEquals(5L, stepContext.getStepExecutionId());
|
||||
assertEquals("testStep", stepContext.getStepName());
|
||||
assertEquals("This is my transient data", stepContext.getTransientUserData());
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -27,10 +42,10 @@ public class JsrStepExecutionTests {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
JobExecution jobExecution = new JobExecution(1l, new JobParametersBuilder().addString("key", "value").toJobParameters());
|
||||
JobExecution jobExecution = new JobExecution(1L, new JobParametersBuilder().addString("key", "value").toJobParameters());
|
||||
|
||||
stepExecution = new StepExecution("testStep", jobExecution);
|
||||
stepExecution.setId(5l);
|
||||
stepExecution.setId(5L);
|
||||
stepExecution.setStatus(BatchStatus.STARTED);
|
||||
stepExecution.setExitStatus(new ExitStatus("customExitStatus"));
|
||||
stepExecution.setCommitCount(1);
|
||||
@@ -62,7 +77,7 @@ public class JsrStepExecutionTests {
|
||||
|
||||
@Test
|
||||
public void testBaseValues() {
|
||||
assertEquals(5l, jsrStepExecution.getStepExecutionId());
|
||||
assertEquals(5L, jsrStepExecution.getStepExecutionId());
|
||||
assertEquals("testStep", jsrStepExecution.getStepName());
|
||||
assertEquals(javax.batch.runtime.BatchStatus.STARTED, jsrStepExecution.getBatchStatus());
|
||||
assertEquals(new Date(0), jsrStepExecution.getStartTime());
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -11,7 +26,7 @@ public class SimpleMetricTests {
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testNullType() {
|
||||
Metric metric = new SimpleMetric(null, 0);
|
||||
new SimpleMetric(null, 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -38,6 +38,7 @@ public class BatchPropertyContextTests {
|
||||
private Map<String, Map<String, Properties>> partitionProperties = new HashMap<String, Map<String, Properties>>();
|
||||
private Map<String, Map<String, Properties>> stepArtifactProperties = new HashMap<String, Map<String, Properties>>();
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Before
|
||||
public void setUp() {
|
||||
Properties step1Properties = new Properties();
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr.configuration.xml;
|
||||
|
||||
import javax.batch.api.chunk.ItemProcessor;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr.configuration.xml;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -48,25 +48,25 @@ public class ExceptionHandlingParsingTests {
|
||||
@Test
|
||||
@Ignore
|
||||
public void testSkippable() throws Exception {
|
||||
JobExecution execution1 = jobLauncher.run(job, new JobParametersBuilder().addLong("run", 1l).toJobParameters());
|
||||
JobExecution execution1 = jobLauncher.run(job, new JobParametersBuilder().addLong("run", 1L).toJobParameters());
|
||||
assertEquals(BatchStatus.FAILED, execution1.getStatus());
|
||||
assertEquals(1, execution1.getStepExecutions().size());
|
||||
assertEquals(1, execution1.getStepExecutions().iterator().next().getSkipCount());
|
||||
assertTrue(execution1.getAllFailureExceptions().get(0).getMessage().contains("But don't skip me"));
|
||||
|
||||
JobExecution execution2 = jobLauncher.run(job, new JobParametersBuilder().addLong("run", 2l).toJobParameters());
|
||||
JobExecution execution2 = jobLauncher.run(job, new JobParametersBuilder().addLong("run", 2L).toJobParameters());
|
||||
assertEquals(BatchStatus.FAILED, execution2.getStatus());
|
||||
assertEquals(2, execution2.getStepExecutions().size());
|
||||
assertTrue(execution2.getAllFailureExceptions().get(0).getMessage().contains("But don't retry me"));
|
||||
|
||||
JobExecution execution3 = jobLauncher.run(job, new JobParametersBuilder().addLong("run", 3l).toJobParameters());
|
||||
JobExecution execution3 = jobLauncher.run(job, new JobParametersBuilder().addLong("run", 3L).toJobParameters());
|
||||
assertEquals(BatchStatus.COMPLETED, execution3.getStatus());
|
||||
assertEquals(3, execution3.getStepExecutions().size());
|
||||
|
||||
List<StepExecution> stepExecutions = new ArrayList<StepExecution>(execution3.getStepExecutions());
|
||||
assertEquals(0, stepExecutions.get(2).getRollbackCount());
|
||||
|
||||
JobExecution execution4 = jobLauncher.run(job, new JobParametersBuilder().addLong("run", 4l).toJobParameters());
|
||||
JobExecution execution4 = jobLauncher.run(job, new JobParametersBuilder().addLong("run", 4L).toJobParameters());
|
||||
assertEquals(BatchStatus.COMPLETED, execution4.getStatus());
|
||||
assertEquals(3, execution4.getStepExecutions().size());
|
||||
}
|
||||
|
||||
@@ -45,16 +45,16 @@ import org.springframework.batch.core.ExitStatus;
|
||||
public class FlowParserTests {
|
||||
@Test
|
||||
public void testDuplicateTransitionPatternsAllowed() throws Exception {
|
||||
JobExecution stoppedExecution = runJob("FlowParserTests-context", new Properties(), 10000l);
|
||||
JobExecution stoppedExecution = runJob("FlowParserTests-context", new Properties(), 10000L);
|
||||
assertEquals(ExitStatus.STOPPED.getExitCode(), stoppedExecution.getExitStatus());
|
||||
|
||||
JobExecution endedExecution = restartJob(stoppedExecution.getExecutionId(), new Properties(), 10000l);
|
||||
JobExecution endedExecution = restartJob(stoppedExecution.getExecutionId(), new Properties(), 10000L);
|
||||
assertEquals(ExitStatus.COMPLETED.getExitCode(), endedExecution.getExitStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWildcardAddedLastWhenUsedWithNextAttrAndNoTransitionElements() throws Exception {
|
||||
JobExecution jobExecution = runJob("FlowParserTestsWildcardAndNextAttrJob", new Properties(), 1000l);
|
||||
JobExecution jobExecution = runJob("FlowParserTestsWildcardAndNextAttrJob", new Properties(), 1000L);
|
||||
assertEquals(ExitStatus.FAILED.getExitCode(), jobExecution.getExitStatus());
|
||||
|
||||
JobOperator jobOperator = BatchRuntime.getJobOperator();
|
||||
@@ -66,7 +66,7 @@ public class FlowParserTests {
|
||||
|
||||
@Test
|
||||
public void testStepGetsFailedTransitionWhenNextAttributePresent() throws Exception {
|
||||
JobExecution jobExecution = runJob("FlowParserTestsStepGetsFailedTransitionWhenNextAttributePresent", new Properties(), 10000l);
|
||||
JobExecution jobExecution = runJob("FlowParserTestsStepGetsFailedTransitionWhenNextAttributePresent", new Properties(), 10000L);
|
||||
assertEquals(ExitStatus.FAILED.getExitCode(), jobExecution.getExitStatus());
|
||||
|
||||
JobOperator jobOperator = BatchRuntime.getJobOperator();
|
||||
@@ -79,7 +79,7 @@ public class FlowParserTests {
|
||||
|
||||
@Test
|
||||
public void testStepNoOverrideWhenNextAndFailedTransitionElementExists() throws Exception {
|
||||
JobExecution jobExecution = runJob("FlowParserTestsStepNoOverrideWhenNextAndFailedTransitionElementExists", new Properties(), 10000l);
|
||||
JobExecution jobExecution = runJob("FlowParserTestsStepNoOverrideWhenNextAndFailedTransitionElementExists", new Properties(), 10000L);
|
||||
assertEquals(ExitStatus.FAILED.getExitCode(), jobExecution.getExitStatus());
|
||||
|
||||
JobOperator jobOperator = BatchRuntime.getJobOperator();
|
||||
|
||||
@@ -68,8 +68,7 @@ public class ItemListenerParsingTests {
|
||||
assertEquals(2, jsrListener.afterWriteCount);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static class SpringItemListener implements ItemReadListener, ItemProcessListener, ItemWriteListener {
|
||||
public static class SpringItemListener implements ItemReadListener<Object>, ItemProcessListener<Object, Object>, ItemWriteListener<Object> {
|
||||
|
||||
protected int beforeReadCount = 0;
|
||||
protected int afterReadCount = 0;
|
||||
@@ -97,17 +96,17 @@ public class ItemListenerParsingTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeWrite(List items) {
|
||||
public void beforeWrite(List<? extends Object> items) {
|
||||
beforeWriteCount++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterWrite(List items) {
|
||||
public void afterWrite(List<? extends Object> items) {
|
||||
afterWriteCount++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWriteError(Exception exception, List items) {
|
||||
public void onWriteError(Exception exception, List<? extends Object> items) {
|
||||
onWriteErrorCount++;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr.configuration.xml;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -40,6 +55,7 @@ public class JsrBeanDefinitionDocumentReaderTests {
|
||||
private ErrorHandler errorHandler = new SimpleSaxErrorHandler(logger);
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testGetJobParameters() {
|
||||
Properties jobParameters = new Properties();
|
||||
jobParameters.setProperty("jobParameter1", "jobParameter1Value");
|
||||
@@ -65,6 +81,7 @@ public class JsrBeanDefinitionDocumentReaderTests {
|
||||
public void testGetJobProperties() {
|
||||
Document document = getDocument("/META-INF/batch-jobs/jsrPropertyPreparseTestJob.xml");
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext();
|
||||
JsrBeanDefinitionDocumentReader documentReader = new JsrBeanDefinitionDocumentReader(applicationContext);
|
||||
documentReader.initProperties(document.getDocumentElement());
|
||||
@@ -84,6 +101,7 @@ public class JsrBeanDefinitionDocumentReaderTests {
|
||||
jobParameters.setProperty("jobParameter2", "#{jobProperties['jobProperty2']}");
|
||||
jobParameters.setProperty("jobParameter3", "#{jobParameters['jobParameter1']}");
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext(jobParameters);
|
||||
applicationContext.setValidating(false);
|
||||
applicationContext.load(new ClassPathResource("baseContext.xml"),
|
||||
@@ -110,6 +128,7 @@ public class JsrBeanDefinitionDocumentReaderTests {
|
||||
Properties jobParameters = new Properties();
|
||||
jobParameters.setProperty("file.name", "myfile.txt");
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext(jobParameters);
|
||||
applicationContext.setValidating(false);
|
||||
applicationContext.load(new ClassPathResource("baseContext.xml"),
|
||||
@@ -130,6 +149,7 @@ public class JsrBeanDefinitionDocumentReaderTests {
|
||||
assertEquals("myfile.txt", resolvedProperties.getProperty("jobProperty3"));
|
||||
}
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Test
|
||||
public void testGenerationOfBeanDefinitionsForMultipleReferences() throws Exception {
|
||||
JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext(new Properties());
|
||||
@@ -184,6 +204,7 @@ public class JsrBeanDefinitionDocumentReaderTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testGenerationOfSpringBeanDefinitionsForMultipleReferences() {
|
||||
JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext(new Properties());
|
||||
applicationContext.setValidating(false);
|
||||
|
||||
@@ -46,7 +46,7 @@ public class JsrSplitParsingTests {
|
||||
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
javax.batch.runtime.JobExecution execution = runJob("JsrSplitParsingTests-context", null, 10000l);
|
||||
javax.batch.runtime.JobExecution execution = runJob("JsrSplitParsingTests-context", null, 10000L);
|
||||
assertEquals(javax.batch.runtime.BatchStatus.COMPLETED, execution.getBatchStatus());
|
||||
assertEquals("COMPLETED", execution.getExitStatus());
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr.configuration.xml;
|
||||
|
||||
import java.util.Properties;
|
||||
@@ -19,6 +34,7 @@ public class JsrXmlApplicationContextTests {
|
||||
private static final String JOB_PARAMETERS_BEAN_DEFINITION_NAME = "jsr_jobParameters";
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testNullProperties() {
|
||||
JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext(null);
|
||||
|
||||
@@ -30,6 +46,7 @@ public class JsrXmlApplicationContextTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testWithProperties() {
|
||||
Properties properties = new Properties();
|
||||
properties.put("prop1key", "prop1val");
|
||||
|
||||
@@ -33,6 +33,7 @@ import static org.junit.Assert.assertEquals;
|
||||
public class ListenerParserTests {
|
||||
@Test
|
||||
public void testStepListenerStepScoped() {
|
||||
@SuppressWarnings("resource")
|
||||
GenericApplicationContext applicationContext = new GenericApplicationContext();
|
||||
|
||||
AbstractBeanDefinition newBeanDefinition = BeanDefinitionBuilder.genericBeanDefinition("stepListener").getBeanDefinition();
|
||||
@@ -49,6 +50,7 @@ public class ListenerParserTests {
|
||||
|
||||
@Test
|
||||
public void testJobListenerSingletonScoped() {
|
||||
@SuppressWarnings("resource")
|
||||
GenericApplicationContext applicationContext = new GenericApplicationContext();
|
||||
|
||||
AbstractBeanDefinition newBeanDefinition = BeanDefinitionBuilder.genericBeanDefinition("jobListener").getBeanDefinition();
|
||||
|
||||
@@ -49,7 +49,7 @@ import org.springframework.util.Assert;
|
||||
public class PartitionParserTests {
|
||||
private Pattern caPattern = Pattern.compile("ca");
|
||||
private Pattern asPattern = Pattern.compile("AS");
|
||||
private static final long TIMEOUT = 10000l;
|
||||
private static final long TIMEOUT = 10000L;
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
|
||||
@@ -53,6 +53,7 @@ public class RetryListenerTests {
|
||||
private static final Log LOG = LogFactory.getLog(RetryListenerTests.class);
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testReadRetryExhausted() throws Exception {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext("org/springframework/batch/core/jsr/configuration/xml/RetryReadListenerExhausted.xml");
|
||||
|
||||
@@ -68,6 +69,7 @@ public class RetryListenerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testReadRetryOnce() throws Exception {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext("org/springframework/batch/core/jsr/configuration/xml/RetryReadListenerRetryOnce.xml");
|
||||
|
||||
@@ -85,6 +87,7 @@ public class RetryListenerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testReadRetryExceptionInListener() throws Exception {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext("org/springframework/batch/core/jsr/configuration/xml/RetryReadListenerListenerException.xml");
|
||||
|
||||
@@ -222,7 +225,7 @@ public class RetryListenerTests {
|
||||
|
||||
@Override
|
||||
public void writeItems(List<Object> items) throws Exception {
|
||||
for(Object item : items) {
|
||||
for(@SuppressWarnings("unused") Object item : items) {
|
||||
if(cnt == 0) {
|
||||
cnt++;
|
||||
LOG.info("one");
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr.configuration.xml;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -88,7 +88,7 @@ public class JsrFlowJobTests {
|
||||
|
||||
MapJobExplorerFactoryBean jobExplorerFactory = new MapJobExplorerFactoryBean(jobRepositoryFactory);
|
||||
jobExplorerFactory.afterPropertiesSet();
|
||||
jobExplorer = (JobExplorer) jobExplorerFactory.getObject();
|
||||
jobExplorer = jobExplorerFactory.getObject();
|
||||
job.setJobExplorer(jobExplorer);
|
||||
}
|
||||
|
||||
@@ -750,7 +750,7 @@ public class JsrFlowJobTests {
|
||||
}
|
||||
|
||||
private void checkRepository(BatchStatus status, ExitStatus exitStatus) {
|
||||
// because map dao stores in memory, it can be checked directly
|
||||
// because map DAO stores in memory, it can be checked directly
|
||||
JobInstance jobInstance = jobExecution.getJobInstance();
|
||||
JobExecution other = jobExecutionDao.findJobExecutions(jobInstance).get(0);
|
||||
assertEquals(jobInstance.getId(), other.getJobId());
|
||||
|
||||
@@ -41,7 +41,7 @@ public class JsrFlowTests extends SimpleFlowTests {
|
||||
|
||||
@Test
|
||||
public void testNextBasedOnBatchStatus() throws Exception {
|
||||
StepExecution stepExecution = new StepExecution("step1", new JobExecution(5l));
|
||||
StepExecution stepExecution = new StepExecution("step1", new JobExecution(5L));
|
||||
stepExecution.setExitStatus(new ExitStatus("unmapped exit code"));
|
||||
stepExecution.setStatus(BatchStatus.FAILED);
|
||||
executor = new FlowExecutor(stepExecution);
|
||||
|
||||
@@ -34,7 +34,7 @@ public class JsrEndStateTests {
|
||||
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
JobExecution jobExecution = JsrTestUtils.runJob("jobWithEndTransition", null, 10000l);
|
||||
JobExecution jobExecution = JsrTestUtils.runJob("jobWithEndTransition", null, 10000L);
|
||||
|
||||
assertEquals(BatchStatus.COMPLETED, jobExecution.getBatchStatus());
|
||||
assertEquals("SUCCESS", jobExecution.getExitStatus());
|
||||
|
||||
@@ -71,7 +71,7 @@ public class JsrJobOperatorTests {
|
||||
@Mock
|
||||
private JobRepository jobRepository;
|
||||
private JobParametersConverter parameterConverter;
|
||||
private static final long TIMEOUT = 10000l;
|
||||
private static final long TIMEOUT = 10000L;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
@@ -128,11 +128,11 @@ public class JsrJobOperatorTests {
|
||||
|
||||
@Test
|
||||
public void testAbandonRoseyScenario() throws Exception {
|
||||
JobExecution jobExecution = new JobExecution(5l);
|
||||
JobExecution jobExecution = new JobExecution(5L);
|
||||
jobExecution.setEndTime(new Date());
|
||||
when(jobExplorer.getJobExecution(5l)).thenReturn(jobExecution);
|
||||
when(jobExplorer.getJobExecution(5L)).thenReturn(jobExecution);
|
||||
|
||||
jsrJobOperator.abandon(5l);
|
||||
jsrJobOperator.abandon(5L);
|
||||
|
||||
ArgumentCaptor<JobExecution> executionCaptor = ArgumentCaptor.forClass(JobExecution.class);
|
||||
verify(jobRepository).update(executionCaptor.capture());
|
||||
@@ -142,40 +142,40 @@ public class JsrJobOperatorTests {
|
||||
|
||||
@Test(expected=NoSuchJobExecutionException.class)
|
||||
public void testAbandonNoSuchJob() throws Exception {
|
||||
jsrJobOperator.abandon(5l);
|
||||
jsrJobOperator.abandon(5L);
|
||||
}
|
||||
|
||||
@Test(expected=JobExecutionIsRunningException.class)
|
||||
public void testAbandonJobRunning() throws Exception {
|
||||
JobExecution jobExecution = new JobExecution(5l);
|
||||
when(jobExplorer.getJobExecution(5l)).thenReturn(jobExecution);
|
||||
JobExecution jobExecution = new JobExecution(5L);
|
||||
when(jobExplorer.getJobExecution(5L)).thenReturn(jobExecution);
|
||||
|
||||
jsrJobOperator.abandon(5l);
|
||||
jsrJobOperator.abandon(5L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetJobExecutionRoseyScenario() {
|
||||
when(jobExplorer.getJobExecution(5l)).thenReturn(new JobExecution(5l));
|
||||
when(jobExplorer.getJobExecution(5L)).thenReturn(new JobExecution(5L));
|
||||
|
||||
assertEquals(5l, jsrJobOperator.getJobExecution(5l).getExecutionId());
|
||||
assertEquals(5L, jsrJobOperator.getJobExecution(5L).getExecutionId());
|
||||
}
|
||||
|
||||
@Test(expected=NoSuchJobExecutionException.class)
|
||||
public void testGetJobExecutionNoExecutionFound() {
|
||||
jsrJobOperator.getJobExecution(5l);
|
||||
jsrJobOperator.getJobExecution(5L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetJobExecutionsRoseyScenario() {
|
||||
org.springframework.batch.core.JobInstance jobInstance = new org.springframework.batch.core.JobInstance(5l, "my job");
|
||||
org.springframework.batch.core.JobInstance jobInstance = new org.springframework.batch.core.JobInstance(5L, "my job");
|
||||
List<JobExecution> executions = new ArrayList<JobExecution>();
|
||||
executions.add(new JobExecution(2l));
|
||||
executions.add(new JobExecution(2L));
|
||||
|
||||
when(jobExplorer.getJobExecutions(jobInstance)).thenReturn(executions);
|
||||
|
||||
List<javax.batch.runtime.JobExecution> jobExecutions = jsrJobOperator.getJobExecutions(jobInstance);
|
||||
assertEquals(1, jobExecutions.size());
|
||||
assertEquals(2l, executions.get(0).getId().longValue());
|
||||
assertEquals(2L, executions.get(0).getId().longValue());
|
||||
}
|
||||
|
||||
@Test(expected=NoSuchJobInstanceException.class)
|
||||
@@ -185,14 +185,14 @@ public class JsrJobOperatorTests {
|
||||
|
||||
@Test(expected=NoSuchJobInstanceException.class)
|
||||
public void testGetJobExecutionsNullReturned() {
|
||||
org.springframework.batch.core.JobInstance jobInstance = new org.springframework.batch.core.JobInstance(5l, "my job");
|
||||
org.springframework.batch.core.JobInstance jobInstance = new org.springframework.batch.core.JobInstance(5L, "my job");
|
||||
|
||||
jsrJobOperator.getJobExecutions(jobInstance);
|
||||
}
|
||||
|
||||
@Test(expected=NoSuchJobInstanceException.class)
|
||||
public void testGetJobExecutionsNoneReturned() {
|
||||
org.springframework.batch.core.JobInstance jobInstance = new org.springframework.batch.core.JobInstance(5l, "my job");
|
||||
org.springframework.batch.core.JobInstance jobInstance = new org.springframework.batch.core.JobInstance(5L, "my job");
|
||||
List<JobExecution> executions = new ArrayList<JobExecution>();
|
||||
|
||||
when(jobExplorer.getJobExecutions(jobInstance)).thenReturn(executions);
|
||||
@@ -202,26 +202,26 @@ public class JsrJobOperatorTests {
|
||||
|
||||
@Test
|
||||
public void testGetJobInstanceRoseyScenario() {
|
||||
JobInstance instance = new JobInstance(1l, "my job");
|
||||
JobExecution execution = new JobExecution(5l);
|
||||
JobInstance instance = new JobInstance(1L, "my job");
|
||||
JobExecution execution = new JobExecution(5L);
|
||||
execution.setJobInstance(instance);
|
||||
|
||||
when(jobExplorer.getJobExecution(5l)).thenReturn(execution);
|
||||
when(jobExplorer.getJobInstance(1l)).thenReturn(instance);
|
||||
when(jobExplorer.getJobExecution(5L)).thenReturn(execution);
|
||||
when(jobExplorer.getJobInstance(1L)).thenReturn(instance);
|
||||
|
||||
javax.batch.runtime.JobInstance jobInstance = jsrJobOperator.getJobInstance(5l);
|
||||
javax.batch.runtime.JobInstance jobInstance = jsrJobOperator.getJobInstance(5L);
|
||||
|
||||
assertEquals(1l, jobInstance.getInstanceId());
|
||||
assertEquals(1L, jobInstance.getInstanceId());
|
||||
assertEquals("my job", jobInstance.getJobName());
|
||||
}
|
||||
|
||||
@Test(expected=NoSuchJobExecutionException.class)
|
||||
public void testGetJobInstanceNoExecution() {
|
||||
JobInstance instance = new JobInstance(1l, "my job");
|
||||
JobExecution execution = new JobExecution(5l);
|
||||
JobInstance instance = new JobInstance(1L, "my job");
|
||||
JobExecution execution = new JobExecution(5L);
|
||||
execution.setJobInstance(instance);
|
||||
|
||||
jsrJobOperator.getJobInstance(5l);
|
||||
jsrJobOperator.getJobInstance(5L);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -248,18 +248,18 @@ public class JsrJobOperatorTests {
|
||||
@Test
|
||||
public void testGetJobInstancesRoseyScenario() {
|
||||
List<JobInstance> instances = new ArrayList<JobInstance>();
|
||||
instances.add(new JobInstance(1l, "myJob"));
|
||||
instances.add(new JobInstance(2l, "myJob"));
|
||||
instances.add(new JobInstance(3l, "myJob"));
|
||||
instances.add(new JobInstance(1L, "myJob"));
|
||||
instances.add(new JobInstance(2L, "myJob"));
|
||||
instances.add(new JobInstance(3L, "myJob"));
|
||||
|
||||
when(jobExplorer.getJobInstances("myJob", 0, 3)).thenReturn(instances);
|
||||
|
||||
List<javax.batch.runtime.JobInstance> jobInstances = jsrJobOperator.getJobInstances("myJob", 0, 3);
|
||||
|
||||
assertEquals(3, jobInstances.size());
|
||||
assertEquals(1l, jobInstances.get(0).getInstanceId());
|
||||
assertEquals(2l, jobInstances.get(1).getInstanceId());
|
||||
assertEquals(3l, jobInstances.get(2).getInstanceId());
|
||||
assertEquals(1L, jobInstances.get(0).getInstanceId());
|
||||
assertEquals(2L, jobInstances.get(1).getInstanceId());
|
||||
assertEquals(3L, jobInstances.get(2).getInstanceId());
|
||||
}
|
||||
|
||||
@Test(expected=NoSuchJobException.class)
|
||||
@@ -293,11 +293,11 @@ public class JsrJobOperatorTests {
|
||||
|
||||
@Test
|
||||
public void testGetParametersRoseyScenario() {
|
||||
JobExecution jobExecution = new JobExecution(5l, new JobParametersBuilder().addString("key1", "value1").addLong(JsrJobParametersConverter.JOB_RUN_ID, 5l).toJobParameters());
|
||||
JobExecution jobExecution = new JobExecution(5L, new JobParametersBuilder().addString("key1", "value1").addLong(JsrJobParametersConverter.JOB_RUN_ID, 5L).toJobParameters());
|
||||
|
||||
when(jobExplorer.getJobExecution(5l)).thenReturn(jobExecution);
|
||||
when(jobExplorer.getJobExecution(5L)).thenReturn(jobExecution);
|
||||
|
||||
Properties params = jsrJobOperator.getParameters(5l);
|
||||
Properties params = jsrJobOperator.getParameters(5L);
|
||||
|
||||
assertEquals("value1", params.get("key1"));
|
||||
assertNull(params.get(JsrJobParametersConverter.JOB_RUN_ID));
|
||||
@@ -305,7 +305,7 @@ public class JsrJobOperatorTests {
|
||||
|
||||
@Test(expected=NoSuchJobExecutionException.class)
|
||||
public void testGetParametersNoExecution() {
|
||||
jsrJobOperator.getParameters(5l);
|
||||
jsrJobOperator.getParameters(5L);
|
||||
}
|
||||
|
||||
@Test(expected=NoSuchJobException.class)
|
||||
@@ -320,26 +320,26 @@ public class JsrJobOperatorTests {
|
||||
@Test
|
||||
public void testGetRunningExecutions() {
|
||||
Set<JobExecution> executions = new HashSet<JobExecution>();
|
||||
executions.add(new JobExecution(5l));
|
||||
executions.add(new JobExecution(5L));
|
||||
|
||||
when(jobExplorer.findRunningJobExecutions("myJob")).thenReturn(executions);
|
||||
|
||||
assertEquals(5l, jsrJobOperator.getRunningExecutions("myJob").get(0).longValue());
|
||||
assertEquals(5L, jsrJobOperator.getRunningExecutions("myJob").get(0).longValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetStepExecutionsRoseyScenario() {
|
||||
JobExecution jobExecution = new JobExecution(5l);
|
||||
JobExecution jobExecution = new JobExecution(5L);
|
||||
List<StepExecution> stepExecutions = new ArrayList<StepExecution>();
|
||||
stepExecutions.add(new StepExecution("step1", jobExecution, 1l));
|
||||
stepExecutions.add(new StepExecution("step2", jobExecution, 2l));
|
||||
stepExecutions.add(new StepExecution("step1", jobExecution, 1L));
|
||||
stepExecutions.add(new StepExecution("step2", jobExecution, 2L));
|
||||
jobExecution.addStepExecutions(stepExecutions);
|
||||
|
||||
when(jobExplorer.getJobExecution(5l)).thenReturn(jobExecution);
|
||||
when(jobExplorer.getStepExecution(5l, 1l)).thenReturn(new StepExecution("step1", jobExecution, 1l));
|
||||
when(jobExplorer.getStepExecution(5l, 2l)).thenReturn(new StepExecution("step2", jobExecution, 2l));
|
||||
when(jobExplorer.getJobExecution(5L)).thenReturn(jobExecution);
|
||||
when(jobExplorer.getStepExecution(5L, 1L)).thenReturn(new StepExecution("step1", jobExecution, 1L));
|
||||
when(jobExplorer.getStepExecution(5L, 2L)).thenReturn(new StepExecution("step2", jobExecution, 2L));
|
||||
|
||||
List<javax.batch.runtime.StepExecution> results = jsrJobOperator.getStepExecutions(5l);
|
||||
List<javax.batch.runtime.StepExecution> results = jsrJobOperator.getStepExecutions(5L);
|
||||
|
||||
assertEquals("step1", results.get(0).getStepName());
|
||||
assertEquals("step2", results.get(1).getStepName());
|
||||
@@ -347,25 +347,25 @@ public class JsrJobOperatorTests {
|
||||
|
||||
@Test(expected=NoSuchJobException.class)
|
||||
public void testGetStepExecutionsNoExecutionReturned() {
|
||||
jsrJobOperator.getStepExecutions(5l);
|
||||
jsrJobOperator.getStepExecutions(5L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetStepExecutionsPartitionedStepScenario() {
|
||||
JobExecution jobExecution = new JobExecution(5l);
|
||||
JobExecution jobExecution = new JobExecution(5L);
|
||||
List<StepExecution> stepExecutions = new ArrayList<StepExecution>();
|
||||
stepExecutions.add(new StepExecution("step1", jobExecution, 1l));
|
||||
stepExecutions.add(new StepExecution("step2", jobExecution, 2l));
|
||||
stepExecutions.add(new StepExecution("step2:partition0", jobExecution, 2l));
|
||||
stepExecutions.add(new StepExecution("step2:partition1", jobExecution, 2l));
|
||||
stepExecutions.add(new StepExecution("step2:partition2", jobExecution, 2l));
|
||||
stepExecutions.add(new StepExecution("step1", jobExecution, 1L));
|
||||
stepExecutions.add(new StepExecution("step2", jobExecution, 2L));
|
||||
stepExecutions.add(new StepExecution("step2:partition0", jobExecution, 2L));
|
||||
stepExecutions.add(new StepExecution("step2:partition1", jobExecution, 2L));
|
||||
stepExecutions.add(new StepExecution("step2:partition2", jobExecution, 2L));
|
||||
jobExecution.addStepExecutions(stepExecutions);
|
||||
|
||||
when(jobExplorer.getJobExecution(5l)).thenReturn(jobExecution);
|
||||
when(jobExplorer.getStepExecution(5l, 1l)).thenReturn(new StepExecution("step1", jobExecution, 1l));
|
||||
when(jobExplorer.getStepExecution(5l, 2l)).thenReturn(new StepExecution("step2", jobExecution, 2l));
|
||||
when(jobExplorer.getJobExecution(5L)).thenReturn(jobExecution);
|
||||
when(jobExplorer.getStepExecution(5L, 1L)).thenReturn(new StepExecution("step1", jobExecution, 1L));
|
||||
when(jobExplorer.getStepExecution(5L, 2L)).thenReturn(new StepExecution("step2", jobExecution, 2L));
|
||||
|
||||
List<javax.batch.runtime.StepExecution> results = jsrJobOperator.getStepExecutions(5l);
|
||||
List<javax.batch.runtime.StepExecution> results = jsrJobOperator.getStepExecutions(5L);
|
||||
|
||||
assertEquals("step1", results.get(0).getStepName());
|
||||
assertEquals("step2", results.get(1).getStepName());
|
||||
@@ -373,11 +373,11 @@ public class JsrJobOperatorTests {
|
||||
|
||||
@Test
|
||||
public void testGetStepExecutionsNoStepExecutions() {
|
||||
JobExecution jobExecution = new JobExecution(5l);
|
||||
JobExecution jobExecution = new JobExecution(5L);
|
||||
|
||||
when(jobExplorer.getJobExecution(5l)).thenReturn(jobExecution);
|
||||
when(jobExplorer.getJobExecution(5L)).thenReturn(jobExecution);
|
||||
|
||||
List<javax.batch.runtime.StepExecution> results = jsrJobOperator.getStepExecutions(5l);
|
||||
List<javax.batch.runtime.StepExecution> results = jsrJobOperator.getStepExecutions(5L);
|
||||
|
||||
assertEquals(0, results.size());
|
||||
}
|
||||
@@ -534,10 +534,10 @@ public class JsrJobOperatorTests {
|
||||
jsrJobOperator = BatchRuntime.getJobOperator();
|
||||
long executionId = jsrJobOperator.start("longRunningJob", null);
|
||||
// Give the job a chance to get started
|
||||
Thread.sleep(1000l);
|
||||
Thread.sleep(1000L);
|
||||
jsrJobOperator.stop(executionId);
|
||||
// Give the job the chance to finish stopping
|
||||
Thread.sleep(1000l);
|
||||
Thread.sleep(1000L);
|
||||
|
||||
assertEquals(BatchStatus.STOPPED, jsrJobOperator.getJobExecution(executionId).getBatchStatus());
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ public class JsrPartitionHandlerTests {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
JobExecution jobExecution = new JobExecution(1L);
|
||||
jobExecution.setJobInstance(new JobInstance(1l, "job"));
|
||||
jobExecution.setJobInstance(new JobInstance(1L, "job"));
|
||||
stepExecution = new StepExecution("step1", jobExecution);
|
||||
stepSplitter = new JsrStepExecutionSplitter(repository, false, "step1", true);
|
||||
Analyzer.collectorData = "";
|
||||
@@ -79,7 +79,7 @@ public class JsrPartitionHandlerTests {
|
||||
});
|
||||
propertyContext = new BatchPropertyContext();
|
||||
handler.setPropertyContext(propertyContext);
|
||||
repository = new MapJobRepositoryFactoryBean().getJobRepository();
|
||||
repository = new MapJobRepositoryFactoryBean().getObject();
|
||||
handler.setJobRepository(repository);
|
||||
MyPartitionReducer.reset();
|
||||
CountingPartitionCollector.reset();
|
||||
@@ -223,7 +223,7 @@ public class JsrPartitionHandlerTests {
|
||||
|
||||
@Test
|
||||
public void testRestartNoOverride() throws Exception {
|
||||
javax.batch.runtime.JobExecution execution1 = JsrTestUtils.runJob("jsrPartitionHandlerRestartWithOverrideJob", null, 1000000l);
|
||||
javax.batch.runtime.JobExecution execution1 = JsrTestUtils.runJob("jsrPartitionHandlerRestartWithOverrideJob", null, 1000000L);
|
||||
assertEquals(BatchStatus.FAILED, execution1.getBatchStatus());
|
||||
assertEquals(1, MyPartitionReducer.beginCount);
|
||||
assertEquals(0, MyPartitionReducer.beforeCount);
|
||||
@@ -234,7 +234,7 @@ public class JsrPartitionHandlerTests {
|
||||
MyPartitionReducer.reset();
|
||||
CountingPartitionCollector.reset();
|
||||
|
||||
javax.batch.runtime.JobExecution execution2 = JsrTestUtils.restartJob(execution1.getExecutionId(), null, 1000000l);
|
||||
javax.batch.runtime.JobExecution execution2 = JsrTestUtils.restartJob(execution1.getExecutionId(), null, 1000000L);
|
||||
assertEquals(BatchStatus.COMPLETED, execution2.getBatchStatus());
|
||||
assertEquals(1, MyPartitionReducer.beginCount);
|
||||
assertEquals(1, MyPartitionReducer.beforeCount);
|
||||
@@ -249,7 +249,7 @@ public class JsrPartitionHandlerTests {
|
||||
Properties jobParameters = new Properties();
|
||||
jobParameters.put("mapper.override", "true");
|
||||
|
||||
javax.batch.runtime.JobExecution execution1 = JsrTestUtils.runJob("jsrPartitionHandlerRestartWithOverrideJob", jobParameters, 1000000l);
|
||||
javax.batch.runtime.JobExecution execution1 = JsrTestUtils.runJob("jsrPartitionHandlerRestartWithOverrideJob", jobParameters, 1000000L);
|
||||
assertEquals(BatchStatus.FAILED, execution1.getBatchStatus());
|
||||
assertEquals(1, MyPartitionReducer.beginCount);
|
||||
assertEquals(0, MyPartitionReducer.beforeCount);
|
||||
@@ -260,7 +260,7 @@ public class JsrPartitionHandlerTests {
|
||||
MyPartitionReducer.reset();
|
||||
CountingPartitionCollector.reset();
|
||||
|
||||
javax.batch.runtime.JobExecution execution2 = JsrTestUtils.restartJob(execution1.getExecutionId(), jobParameters, 1000000l);
|
||||
javax.batch.runtime.JobExecution execution2 = JsrTestUtils.restartJob(execution1.getExecutionId(), jobParameters, 1000000L);
|
||||
assertEquals(BatchStatus.COMPLETED, execution2.getBatchStatus());
|
||||
assertEquals(1, MyPartitionReducer.beginCount);
|
||||
assertEquals(1, MyPartitionReducer.beforeCount);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class JsrStepExecutionSplitterTests {
|
||||
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
Set<StepExecution> executions = splitter.split(new StepExecution("step1", new JobExecution(5l)), 3);
|
||||
Set<StepExecution> executions = splitter.split(new StepExecution("step1", new JobExecution(5L)), 3);
|
||||
|
||||
assertEquals(3, executions.size());
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr.step;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -49,28 +64,28 @@ public class DecisionStepTests {
|
||||
|
||||
@Test
|
||||
public void testDecisionAsFirstStepOfJob() throws Exception {
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionAsFirstStep-context", new Properties(), 10000l);
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionAsFirstStep-context", new Properties(), 10000L);
|
||||
assertEquals(BatchStatus.FAILED, execution.getBatchStatus());
|
||||
assertEquals(0, BatchRuntime.getJobOperator().getStepExecutions(execution.getExecutionId()).size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDecisionThrowsException() throws Exception {
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionThrowsException-context", new Properties(), 10000l);
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionThrowsException-context", new Properties(), 10000L);
|
||||
assertEquals(BatchStatus.FAILED, execution.getBatchStatus());
|
||||
assertEquals(2, BatchRuntime.getJobOperator().getStepExecutions(execution.getExecutionId()).size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDecisionValidExitStatus() throws Exception {
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionValidExitStatus-context", new Properties(), 10000l);
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionValidExitStatus-context", new Properties(), 10000L);
|
||||
assertEquals(BatchStatus.COMPLETED, execution.getBatchStatus());
|
||||
assertEquals(3, BatchRuntime.getJobOperator().getStepExecutions(execution.getExecutionId()).size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDecisionUnmappedExitStatus() throws Exception {
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionInvalidExitStatus-context", new Properties(), 10000l);
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionInvalidExitStatus-context", new Properties(), 10000L);
|
||||
assertEquals(BatchStatus.COMPLETED, execution.getBatchStatus());
|
||||
List<StepExecution> stepExecutions = BatchRuntime.getJobOperator().getStepExecutions(execution.getExecutionId());
|
||||
assertEquals(2, stepExecutions.size());
|
||||
@@ -82,7 +97,7 @@ public class DecisionStepTests {
|
||||
|
||||
@Test
|
||||
public void testDecisionCustomExitStatus() throws Exception {
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionCustomExitStatus-context", new Properties(), 10000l);
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionCustomExitStatus-context", new Properties(), 10000L);
|
||||
assertEquals(BatchStatus.FAILED, execution.getBatchStatus());
|
||||
assertEquals(2, BatchRuntime.getJobOperator().getStepExecutions(execution.getExecutionId()).size());
|
||||
assertEquals("CustomFail", execution.getExitStatus());
|
||||
@@ -90,14 +105,14 @@ public class DecisionStepTests {
|
||||
|
||||
@Test
|
||||
public void testDecisionAfterFlow() throws Exception {
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionAfterFlow-context", new Properties(), 10000l);
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionAfterFlow-context", new Properties(), 10000L);
|
||||
assertEquals(BatchStatus.COMPLETED, execution.getBatchStatus());
|
||||
assertEquals(3, BatchRuntime.getJobOperator().getStepExecutions(execution.getExecutionId()).size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDecisionAfterSplit() throws Exception {
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionAfterSplit-context", new Properties(), 10000l);
|
||||
JobExecution execution = runJob("DecisionStepTests-decisionAfterSplit-context", new Properties(), 10000L);
|
||||
assertEquals(BatchStatus.COMPLETED, execution.getBatchStatus());
|
||||
assertEquals(4, BatchRuntime.getJobOperator().getStepExecutions(execution.getExecutionId()).size());
|
||||
assertEquals(2, StepExecutionCountingDecider.previousStepCount);
|
||||
@@ -105,7 +120,7 @@ public class DecisionStepTests {
|
||||
|
||||
@Test
|
||||
public void testDecisionRestart() throws Exception {
|
||||
JobExecution execution = runJob("DecisionStepTests-restart-context", new Properties(), 10000l);
|
||||
JobExecution execution = runJob("DecisionStepTests-restart-context", new Properties(), 10000L);
|
||||
assertEquals(BatchStatus.STOPPED, execution.getBatchStatus());
|
||||
|
||||
List<StepExecution> stepExecutions = BatchRuntime.getJobOperator().getStepExecutions(execution.getExecutionId());
|
||||
@@ -114,7 +129,7 @@ public class DecisionStepTests {
|
||||
assertEquals("step1", stepExecutions.get(0).getStepName());
|
||||
assertEquals("decision1", stepExecutions.get(1).getStepName());
|
||||
|
||||
JobExecution execution2 = restartJob(execution.getExecutionId(), new Properties(), 10000l);
|
||||
JobExecution execution2 = restartJob(execution.getExecutionId(), new Properties(), 10000L);
|
||||
assertEquals(BatchStatus.COMPLETED, execution2.getBatchStatus());
|
||||
|
||||
List<StepExecution> stepExecutions2 = BatchRuntime.getJobOperator().getStepExecutions(execution2.getExecutionId());
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr.step.batchlet;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr.step.batchlet;
|
||||
|
||||
import javax.batch.api.Batchlet;
|
||||
|
||||
@@ -19,7 +19,7 @@ import javax.batch.api.Batchlet;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Test batchlet that always fails..
|
||||
* Test batchlet that always fails.
|
||||
* </p>
|
||||
*
|
||||
* @author Chris Schaefer
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.jsr.step.batchlet;
|
||||
|
||||
import javax.batch.api.Batchlet;
|
||||
|
||||
@@ -70,7 +70,7 @@ public class JsrChunkProcessorTests {
|
||||
|
||||
builder = new JsrSimpleStepBuilder<String, String>(new StepBuilder("step1"));
|
||||
builder.setBatchPropertyContext(new BatchPropertyContext());
|
||||
repository = new MapJobRepositoryFactoryBean().getJobRepository();
|
||||
repository = new MapJobRepositoryFactoryBean().getObject();
|
||||
builder.repository(repository);
|
||||
builder.transactionManager(new ResourcelessTransactionManager());
|
||||
stepExecution = null;
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.springframework.batch.core.ItemWriteListener;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.JobInterruptedException;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.SkipListener;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.jsr.configuration.support.BatchPropertyContext;
|
||||
@@ -50,7 +51,7 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
private FailingListItemReader reader;
|
||||
private FailingCountingItemProcessor processor;
|
||||
private StoringItemWriter writer;
|
||||
private CountingListener readListener;
|
||||
private CountingListener listener;
|
||||
private JsrFaultTolerantStepBuilder<String, String> builder;
|
||||
private JobRepository repository;
|
||||
private StepExecution stepExecution;
|
||||
@@ -67,11 +68,11 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
reader = new FailingListItemReader(items);
|
||||
processor = new FailingCountingItemProcessor();
|
||||
writer = new StoringItemWriter();
|
||||
readListener = new CountingListener();
|
||||
listener = new CountingListener();
|
||||
|
||||
builder = new JsrFaultTolerantStepBuilder<String, String>(new StepBuilder("step1"));
|
||||
builder.setBatchPropertyContext(new BatchPropertyContext());
|
||||
repository = new MapJobRepositoryFactoryBean().getJobRepository();
|
||||
repository = new MapJobRepositoryFactoryBean().getObject();
|
||||
builder.repository(repository);
|
||||
builder.transactionManager(new ResourcelessTransactionManager());
|
||||
stepExecution = null;
|
||||
@@ -80,7 +81,7 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
@Test
|
||||
public void testNoInputNoListeners() throws Exception{
|
||||
reader = new FailingListItemReader(new ArrayList<String>());
|
||||
Step step = builder.chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -122,7 +123,7 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
|
||||
@Test
|
||||
public void testSimpleScenarioNoProcessor() throws Exception{
|
||||
Step step = builder.chunk(25).reader(reader).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.chunk(25).reader(reader).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -134,15 +135,15 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
assertEquals(25, stepExecution.getWriteCount());
|
||||
assertEquals(0, stepExecution.getFilterCount());
|
||||
assertEquals(0, stepExecution.getWriteSkipCount());
|
||||
assertEquals(0, readListener.afterProcess);
|
||||
assertEquals(25, readListener.afterRead);
|
||||
assertEquals(1, readListener.afterWrite);
|
||||
assertEquals(0, readListener.beforeProcess);
|
||||
assertEquals(26, readListener.beforeRead);
|
||||
assertEquals(1, readListener.beforeWriteCount);
|
||||
assertEquals(0, readListener.onProcessError);
|
||||
assertEquals(0, readListener.onReadError);
|
||||
assertEquals(0, readListener.onWriteError);
|
||||
assertEquals(0, listener.afterProcess);
|
||||
assertEquals(25, listener.afterRead);
|
||||
assertEquals(1, listener.afterWrite);
|
||||
assertEquals(0, listener.beforeProcess);
|
||||
assertEquals(26, listener.beforeRead);
|
||||
assertEquals(1, listener.beforeWriteCount);
|
||||
assertEquals(0, listener.onProcessError);
|
||||
assertEquals(0, listener.onReadError);
|
||||
assertEquals(0, listener.onWriteError);
|
||||
assertEquals(0, processor.count);
|
||||
|
||||
int count = 0;
|
||||
@@ -155,7 +156,7 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
@Test
|
||||
public void testProcessorFilteringNoListeners() throws Exception{
|
||||
processor.filter = true;
|
||||
Step step = builder.chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -180,7 +181,7 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
public void testSkipReadError() throws Exception{
|
||||
reader.failCount = 10;
|
||||
|
||||
Step step = builder.faultTolerant().skip(RuntimeException.class).skipLimit(20).chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.faultTolerant().skip(RuntimeException.class).skipLimit(20).chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -196,22 +197,22 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
assertEquals(0, stepExecution.getFilterCount());
|
||||
assertEquals(0, stepExecution.getWriteSkipCount());
|
||||
assertEquals(0, stepExecution.getFailureExceptions().size());
|
||||
assertEquals(25, readListener.afterProcess);
|
||||
assertEquals(25, readListener.afterRead);
|
||||
assertEquals(1, readListener.afterWrite);
|
||||
assertEquals(25, readListener.beforeProcess);
|
||||
assertEquals(27, readListener.beforeRead);
|
||||
assertEquals(1, readListener.beforeWriteCount);
|
||||
assertEquals(0, readListener.onProcessError);
|
||||
assertEquals(1, readListener.onReadError);
|
||||
assertEquals(0, readListener.onWriteError);
|
||||
assertEquals(25, listener.afterProcess);
|
||||
assertEquals(25, listener.afterRead);
|
||||
assertEquals(1, listener.afterWrite);
|
||||
assertEquals(25, listener.beforeProcess);
|
||||
assertEquals(27, listener.beforeRead);
|
||||
assertEquals(1, listener.beforeWriteCount);
|
||||
assertEquals(0, listener.onProcessError);
|
||||
assertEquals(1, listener.onReadError);
|
||||
assertEquals(0, listener.onWriteError);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetryReadError() throws Exception{
|
||||
reader.failCount = 10;
|
||||
|
||||
Step step = builder.faultTolerant().retry(RuntimeException.class).retryLimit(20).chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.faultTolerant().retry(RuntimeException.class).retryLimit(20).chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -226,22 +227,22 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
assertEquals(0, stepExecution.getFilterCount());
|
||||
assertEquals(0, stepExecution.getWriteSkipCount());
|
||||
assertEquals(0, stepExecution.getFailureExceptions().size());
|
||||
assertEquals(25, readListener.afterProcess);
|
||||
assertEquals(25, readListener.afterRead);
|
||||
assertEquals(1, readListener.afterWrite);
|
||||
assertEquals(25, readListener.beforeProcess);
|
||||
assertEquals(27, readListener.beforeRead);
|
||||
assertEquals(1, readListener.beforeWriteCount);
|
||||
assertEquals(0, readListener.onProcessError);
|
||||
assertEquals(1, readListener.onReadError);
|
||||
assertEquals(0, readListener.onWriteError);
|
||||
assertEquals(25, listener.afterProcess);
|
||||
assertEquals(25, listener.afterRead);
|
||||
assertEquals(1, listener.afterWrite);
|
||||
assertEquals(25, listener.beforeProcess);
|
||||
assertEquals(27, listener.beforeRead);
|
||||
assertEquals(1, listener.beforeWriteCount);
|
||||
assertEquals(0, listener.onProcessError);
|
||||
assertEquals(1, listener.onReadError);
|
||||
assertEquals(0, listener.onWriteError);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReadError() throws Exception{
|
||||
reader.failCount = 10;
|
||||
|
||||
Step step = builder.chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -258,22 +259,22 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
assertEquals(0, stepExecution.getWriteSkipCount());
|
||||
assertEquals(1, stepExecution.getFailureExceptions().size());
|
||||
assertEquals("expected at read index 10", stepExecution.getFailureExceptions().get(0).getCause().getMessage());
|
||||
assertEquals(9, readListener.afterProcess);
|
||||
assertEquals(9, readListener.afterRead);
|
||||
assertEquals(0, readListener.afterWrite);
|
||||
assertEquals(9, readListener.beforeProcess);
|
||||
assertEquals(10, readListener.beforeRead);
|
||||
assertEquals(0, readListener.beforeWriteCount);
|
||||
assertEquals(0, readListener.onProcessError);
|
||||
assertEquals(1, readListener.onReadError);
|
||||
assertEquals(0, readListener.onWriteError);
|
||||
assertEquals(9, listener.afterProcess);
|
||||
assertEquals(9, listener.afterRead);
|
||||
assertEquals(0, listener.afterWrite);
|
||||
assertEquals(9, listener.beforeProcess);
|
||||
assertEquals(10, listener.beforeRead);
|
||||
assertEquals(0, listener.beforeWriteCount);
|
||||
assertEquals(0, listener.onProcessError);
|
||||
assertEquals(1, listener.onReadError);
|
||||
assertEquals(0, listener.onWriteError);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcessError() throws Exception{
|
||||
processor.failCount = 10;
|
||||
|
||||
Step step = builder.chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -288,22 +289,22 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
assertEquals(0, stepExecution.getFilterCount());
|
||||
assertEquals(0, stepExecution.getWriteSkipCount());
|
||||
assertEquals("expected at process index 10", stepExecution.getFailureExceptions().get(0).getCause().getMessage());
|
||||
assertEquals(9, readListener.afterProcess);
|
||||
assertEquals(10, readListener.afterRead);
|
||||
assertEquals(0, readListener.afterWrite);
|
||||
assertEquals(10, readListener.beforeProcess);
|
||||
assertEquals(10, readListener.beforeRead);
|
||||
assertEquals(0, readListener.beforeWriteCount);
|
||||
assertEquals(1, readListener.onProcessError);
|
||||
assertEquals(0, readListener.onReadError);
|
||||
assertEquals(0, readListener.onWriteError);
|
||||
assertEquals(9, listener.afterProcess);
|
||||
assertEquals(10, listener.afterRead);
|
||||
assertEquals(0, listener.afterWrite);
|
||||
assertEquals(10, listener.beforeProcess);
|
||||
assertEquals(10, listener.beforeRead);
|
||||
assertEquals(0, listener.beforeWriteCount);
|
||||
assertEquals(1, listener.onProcessError);
|
||||
assertEquals(0, listener.onReadError);
|
||||
assertEquals(0, listener.onWriteError);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSkipProcessError() throws Exception{
|
||||
processor.failCount = 10;
|
||||
|
||||
Step step = builder.faultTolerant().skip(RuntimeException.class).skipLimit(20).chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.faultTolerant().skip(RuntimeException.class).skipLimit(20).chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -319,22 +320,22 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
assertEquals(1, stepExecution.getFilterCount());
|
||||
assertEquals(0, stepExecution.getWriteSkipCount());
|
||||
assertEquals(0, stepExecution.getFailureExceptions().size());
|
||||
assertEquals(24, readListener.afterProcess);
|
||||
assertEquals(25, readListener.afterRead);
|
||||
assertEquals(1, readListener.afterWrite);
|
||||
assertEquals(25, readListener.beforeProcess);
|
||||
assertEquals(26, readListener.beforeRead);
|
||||
assertEquals(1, readListener.beforeWriteCount);
|
||||
assertEquals(1, readListener.onProcessError);
|
||||
assertEquals(0, readListener.onReadError);
|
||||
assertEquals(0, readListener.onWriteError);
|
||||
assertEquals(24, listener.afterProcess);
|
||||
assertEquals(25, listener.afterRead);
|
||||
assertEquals(1, listener.afterWrite);
|
||||
assertEquals(25, listener.beforeProcess);
|
||||
assertEquals(26, listener.beforeRead);
|
||||
assertEquals(1, listener.beforeWriteCount);
|
||||
assertEquals(1, listener.onProcessError);
|
||||
assertEquals(0, listener.onReadError);
|
||||
assertEquals(0, listener.onWriteError);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetryProcessError() throws Exception{
|
||||
processor.failCount = 10;
|
||||
|
||||
Step step = builder.faultTolerant().retry(RuntimeException.class).retryLimit(20).chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.faultTolerant().retry(RuntimeException.class).retryLimit(20).chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -350,22 +351,22 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
assertEquals(0, stepExecution.getFilterCount());
|
||||
assertEquals(0, stepExecution.getWriteSkipCount());
|
||||
assertEquals(0, stepExecution.getFailureExceptions().size());
|
||||
assertEquals(25, readListener.afterProcess);
|
||||
assertEquals(25, readListener.afterRead);
|
||||
assertEquals(1, readListener.afterWrite);
|
||||
assertEquals(26, readListener.beforeProcess);
|
||||
assertEquals(26, readListener.beforeRead);
|
||||
assertEquals(1, readListener.beforeWriteCount);
|
||||
assertEquals(1, readListener.onProcessError);
|
||||
assertEquals(0, readListener.onReadError);
|
||||
assertEquals(0, readListener.onWriteError);
|
||||
assertEquals(25, listener.afterProcess);
|
||||
assertEquals(25, listener.afterRead);
|
||||
assertEquals(1, listener.afterWrite);
|
||||
assertEquals(26, listener.beforeProcess);
|
||||
assertEquals(26, listener.beforeRead);
|
||||
assertEquals(1, listener.beforeWriteCount);
|
||||
assertEquals(1, listener.onProcessError);
|
||||
assertEquals(0, listener.onReadError);
|
||||
assertEquals(0, listener.onWriteError);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWriteError() throws Exception{
|
||||
writer.fail = true;
|
||||
|
||||
Step step = builder.chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -379,22 +380,22 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
assertEquals(0, stepExecution.getWriteCount());
|
||||
assertEquals(0, stepExecution.getFilterCount());
|
||||
assertEquals(0, stepExecution.getWriteSkipCount());
|
||||
assertEquals(25, readListener.afterProcess);
|
||||
assertEquals(25, readListener.afterRead);
|
||||
assertEquals(0, readListener.afterWrite);
|
||||
assertEquals(25, readListener.beforeProcess);
|
||||
assertEquals(25, readListener.beforeRead);
|
||||
assertEquals(1, readListener.beforeWriteCount);
|
||||
assertEquals(0, readListener.onProcessError);
|
||||
assertEquals(0, readListener.onReadError);
|
||||
assertEquals(1, readListener.onWriteError);
|
||||
assertEquals(25, listener.afterProcess);
|
||||
assertEquals(25, listener.afterRead);
|
||||
assertEquals(0, listener.afterWrite);
|
||||
assertEquals(25, listener.beforeProcess);
|
||||
assertEquals(25, listener.beforeRead);
|
||||
assertEquals(1, listener.beforeWriteCount);
|
||||
assertEquals(0, listener.onProcessError);
|
||||
assertEquals(0, listener.onReadError);
|
||||
assertEquals(1, listener.onWriteError);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetryWriteError() throws Exception{
|
||||
writer.fail = true;
|
||||
|
||||
Step step = builder.faultTolerant().retry(RuntimeException.class).retryLimit(25).chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.faultTolerant().retry(RuntimeException.class).retryLimit(25).chunk(25).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -408,22 +409,22 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
assertEquals(25, stepExecution.getWriteCount());
|
||||
assertEquals(0, stepExecution.getFilterCount());
|
||||
assertEquals(0, stepExecution.getWriteSkipCount());
|
||||
assertEquals(25, readListener.afterProcess);
|
||||
assertEquals(25, readListener.afterRead);
|
||||
assertEquals(1, readListener.afterWrite);
|
||||
assertEquals(25, readListener.beforeProcess);
|
||||
assertEquals(26, readListener.beforeRead);
|
||||
assertEquals(2, readListener.beforeWriteCount);
|
||||
assertEquals(0, readListener.onProcessError);
|
||||
assertEquals(0, readListener.onReadError);
|
||||
assertEquals(1, readListener.onWriteError);
|
||||
assertEquals(25, listener.afterProcess);
|
||||
assertEquals(25, listener.afterRead);
|
||||
assertEquals(1, listener.afterWrite);
|
||||
assertEquals(25, listener.beforeProcess);
|
||||
assertEquals(26, listener.beforeRead);
|
||||
assertEquals(2, listener.beforeWriteCount);
|
||||
assertEquals(0, listener.onProcessError);
|
||||
assertEquals(0, listener.onReadError);
|
||||
assertEquals(1, listener.onWriteError);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSkipWriteError() throws Exception{
|
||||
writer.fail = true;
|
||||
|
||||
Step step = builder.faultTolerant().skip(RuntimeException.class).skipLimit(25).chunk(7).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.faultTolerant().skip(RuntimeException.class).skipLimit(25).chunk(7).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -437,21 +438,24 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
assertEquals(18, stepExecution.getWriteCount());
|
||||
assertEquals(0, stepExecution.getFilterCount());
|
||||
assertEquals(1, stepExecution.getWriteSkipCount());
|
||||
assertEquals(25, readListener.afterProcess);
|
||||
assertEquals(25, readListener.afterRead);
|
||||
assertEquals(3, readListener.afterWrite);
|
||||
assertEquals(25, readListener.beforeProcess);
|
||||
assertEquals(26, readListener.beforeRead);
|
||||
assertEquals(4, readListener.beforeWriteCount);
|
||||
assertEquals(0, readListener.onProcessError);
|
||||
assertEquals(0, readListener.onReadError);
|
||||
assertEquals(1, readListener.onWriteError);
|
||||
assertEquals(25, listener.afterProcess);
|
||||
assertEquals(25, listener.afterRead);
|
||||
assertEquals(3, listener.afterWrite);
|
||||
assertEquals(25, listener.beforeProcess);
|
||||
assertEquals(26, listener.beforeRead);
|
||||
assertEquals(4, listener.beforeWriteCount);
|
||||
assertEquals(0, listener.onProcessError);
|
||||
assertEquals(0, listener.onReadError);
|
||||
assertEquals(1, listener.onWriteError);
|
||||
assertEquals(0, listener.onSkipInRead);
|
||||
assertEquals(0, listener.onSkipInProcess);
|
||||
assertEquals(1, listener.onSkipInWrite);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testMultipleChunks() throws Exception{
|
||||
|
||||
Step step = builder.chunk(10).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) readListener).build();
|
||||
Step step = builder.chunk(10).reader(reader).processor(processor).writer(writer).listener((ItemReadListener<String>) listener).build();
|
||||
|
||||
runStep(step);
|
||||
|
||||
@@ -465,15 +469,15 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
assertEquals(25, stepExecution.getWriteCount());
|
||||
assertEquals(0, stepExecution.getFilterCount());
|
||||
assertEquals(0, stepExecution.getWriteSkipCount());
|
||||
assertEquals(25, readListener.afterProcess);
|
||||
assertEquals(25, readListener.afterRead);
|
||||
assertEquals(3, readListener.afterWrite);
|
||||
assertEquals(25, readListener.beforeProcess);
|
||||
assertEquals(26, readListener.beforeRead);
|
||||
assertEquals(3, readListener.beforeWriteCount);
|
||||
assertEquals(0, readListener.onProcessError);
|
||||
assertEquals(0, readListener.onReadError);
|
||||
assertEquals(0, readListener.onWriteError);
|
||||
assertEquals(25, listener.afterProcess);
|
||||
assertEquals(25, listener.afterRead);
|
||||
assertEquals(3, listener.afterWrite);
|
||||
assertEquals(25, listener.beforeProcess);
|
||||
assertEquals(26, listener.beforeRead);
|
||||
assertEquals(3, listener.beforeWriteCount);
|
||||
assertEquals(0, listener.onProcessError);
|
||||
assertEquals(0, listener.onReadError);
|
||||
assertEquals(0, listener.onWriteError);
|
||||
}
|
||||
|
||||
protected void runStep(Step step)
|
||||
@@ -542,7 +546,7 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
}
|
||||
}
|
||||
|
||||
public static class CountingListener implements ItemReadListener<String>, ItemProcessListener<String, String>, ItemWriteListener<String> {
|
||||
public static class CountingListener implements ItemReadListener<String>, ItemProcessListener<String, String>, ItemWriteListener<String>, SkipListener<String, List<Object>> {
|
||||
|
||||
protected int beforeWriteCount = 0;
|
||||
protected int afterWrite = 0;
|
||||
@@ -553,6 +557,9 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
protected int beforeRead = 0;
|
||||
protected int afterRead = 0;
|
||||
protected int onReadError = 0;
|
||||
protected int onSkipInRead = 0;
|
||||
protected int onSkipInProcess = 0;
|
||||
protected int onSkipInWrite = 0;
|
||||
|
||||
@Override
|
||||
public void beforeWrite(List<? extends String> items) {
|
||||
@@ -599,5 +606,20 @@ public class JsrFaultTolerantChunkProcessorTests {
|
||||
public void onReadError(Exception ex) {
|
||||
onReadError++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSkipInRead(Throwable t) {
|
||||
onSkipInRead++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSkipInWrite(List<Object> items, Throwable t) {
|
||||
onSkipInWrite++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSkipInProcess(String item, Throwable t) {
|
||||
onSkipInProcess++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user