@Test public void testNullStep() throws Exception { handler = new TaskExecutorPartitionHandler(); try { handler.handle(stepExecutionSplitter, stepExecution); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected String message = e.getMessage(); assertTrue("Wrong message: " + message, message.contains("Step")); } }
@Test public void testConfiguration() throws Exception { handler = new TaskExecutorPartitionHandler(); try { handler.afterPropertiesSet(); fail("Expected IllegalStateException when no step is set"); } catch (IllegalStateException e) { // expected String message = e.getMessage(); assertEquals("Wrong message: " + message, "A Step must be provided.", message); } }
TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(this.step); if (taskExecutor == null) {
@Test public void testPartitionStepWithProxyHandler() throws Exception { StepParserStepFactoryBean<Object, Object> fb = new StepParserStepFactoryBean<>(); fb.setBeanName("step1"); fb.setAllowStartIfComplete(true); fb.setJobRepository(new JobRepositorySupport()); fb.setStartLimit(5); fb.setListeners(new StepListener[] { new StepExecutionListenerSupport() }); fb.setTaskExecutor(new SyncTaskExecutor()); SimplePartitioner partitioner = new SimplePartitioner(); fb.setPartitioner(partitioner); TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(new StepSupport("foo")); ProxyFactory factory = new ProxyFactory(partitionHandler); fb.setPartitionHandler((PartitionHandler) factory.getProxy()); Object step = fb.getObject(); assertTrue(step instanceof PartitionStep); Object handler = ReflectionTestUtils.getField(step, "partitionHandler"); assertTrue(handler instanceof Advised); }
TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(getStep()); if (getTaskExecutor() == null) {
private void configurePartitionStep(PartitionStep ts) { Assert.state(partitioner != null, "A Partitioner must be provided for a partition step"); Assert.state(step != null, "A Step must be provided for a partition step"); configureAbstractStep(ts); if (partitionHandler != null) { ts.setPartitionHandler(partitionHandler); } else { TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(step); if (taskExecutor == null) { taskExecutor = new SyncTaskExecutor(); } partitionHandler.setGridSize(gridSize); partitionHandler.setTaskExecutor(taskExecutor); ts.setPartitionHandler(partitionHandler); } SimpleStepExecutionSplitter splitter = new SimpleStepExecutionSplitter(jobRepository, step, partitioner); ts.setStepExecutionSplitter(splitter); }
TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(this.step); if (taskExecutor == null) {
TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(this.step); if (taskExecutor == null) {
TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(this.step); if (taskExecutor == null) {
TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(getStep()); if (getTaskExecutor() == null) {
TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(getStep()); if (getTaskExecutor() == null) {
TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(getStep()); if (getTaskExecutor() == null) {