This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RepeatTest implements TestRule { | |
private int count; | |
public RepeatTest(int count) { | |
if (count < 2 ) { | |
throw new IllegalArgumentException("Count must be >= 2"); | |
} | |
this.count = count; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.jeasy.flows.work; | |
public abstract class ContextAwareWork implements Work { | |
private String name; | |
protected ExecutionContext executionContext; | |
public ContextAwareWork(String name, ExecutionContext executionContext) { | |
this.name = name; | |
this.executionContext = executionContext; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.springframework.batch.item; | |
import org.junit.Test; | |
import java.text.DateFormat; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import static org.junit.Assert.assertEquals; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.batch.core.StepContribution; | |
import org.springframework.batch.core.scope.context.ChunkContext; | |
import org.springframework.batch.core.step.tasklet.Tasklet; | |
import org.springframework.batch.repeat.RepeatStatus; | |
public class GreetingTasklet implements Tasklet { | |
@Override | |
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) { | |
Object name = chunkContext.getStepContext().getJobParameters().get("name"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.helloworldjob; | |
import org.springframework.batch.core.Job; | |
import org.springframework.batch.core.JobParameters; | |
import org.springframework.batch.core.JobParametersBuilder; | |
import org.springframework.batch.core.Step; | |
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; | |
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; | |
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; | |
import org.springframework.batch.core.converter.JobParametersConverter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.easybatch.core.job.Job; | |
import org.easybatch.core.job.JobBuilder; | |
import org.easybatch.core.processor.RecordProcessor; | |
import org.easybatch.core.reader.StringRecordReader; | |
import org.easybatch.core.record.StringRecord; | |
import org.easybatch.core.writer.StandardOutputRecordWriter; | |
public class UppercaseJob { | |
private String text; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.easybatch.tutorials.fieldext; | |
import org.easybatch.core.job.Job; | |
import org.easybatch.core.job.JobBuilder; | |
import org.easybatch.core.job.JobExecutor; | |
import org.easybatch.core.reader.IterableRecordReader; | |
import org.easybatch.core.writer.StandardOutputRecordWriter; | |
import org.easybatch.flatfile.DelimitedRecordMarshaller; | |
import org.easybatch.tutorials.common.Tweet; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.InputStream; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import org.easybatch.core.job.Job; | |
import org.easybatch.core.job.JobBuilder; | |
import org.easybatch.core.job.JobExecutor; | |
import org.easybatch.core.writer.FileRecordWriter; | |
import org.easybatch.extensions.gson.GsonRecordMapper; | |
import org.easybatch.json.JsonRecordReader; | |
import com.google.gson.Gson; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static java.lang.Long.parseLong; | |
import static java.lang.String.valueOf; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.Properties; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.*; | |
public class DatabaseUtil { | |
private static final String DATABASE_URL = "jdbc:hsqldb:mem"; | |
private static final String USER = "sa"; | |
private static final String PASSWORD = "pwd"; | |
public static Connection getConnection() throws SQLException { | |
return DriverManager.getConnection(DATABASE_URL, USER, PASSWORD); |