當前位置: 首頁>>代碼示例>>Java>>正文


Java JobExecution.getStepExecutions方法代碼示例

本文整理匯總了Java中org.springframework.batch.core.JobExecution.getStepExecutions方法的典型用法代碼示例。如果您正苦於以下問題:Java JobExecution.getStepExecutions方法的具體用法?Java JobExecution.getStepExecutions怎麽用?Java JobExecution.getStepExecutions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.batch.core.JobExecution的用法示例。


在下文中一共展示了JobExecution.getStepExecutions方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testCreateGenericArchive

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
@Test
public void testCreateGenericArchive() throws NoSuchJobException,
JobExecutionAlreadyRunningException, JobRestartException,
JobInstanceAlreadyCompleteException, JobParametersInvalidException, IOException {
	Map<String, JobParameter> parameters =
			new HashMap<String, JobParameter>();

	JobParameters jobParameters = new JobParameters(parameters);

	Job palmwebArchive = jobLocator.getJob("PalmWeb");
	assertNotNull("Palmweb must not be null",  palmwebArchive);
	JobExecution jobExecution = jobLauncher.run(palmwebArchive, jobParameters);
	assertEquals("The job should complete successfully",jobExecution.getExitStatus().getExitCode(),"COMPLETED");
	for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
		logger.info(stepExecution.getStepName() + " "
				+ stepExecution.getReadCount() + " "
				+ stepExecution.getFilterCount() + " "
				+ stepExecution.getWriteCount() + " " + stepExecution.getCommitCount());
	}
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:21,代碼來源:PalmwebIntegrationTest.java

示例2: testNotModifiedResponse

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
/**
 *
 * @throws IOException
 *             if a temporary file cannot be created.
 * @throws NoSuchJobException
 *             if SpeciesPageHarvestingJob cannot be located
 * @throws JobParametersInvalidException
 *             if the job parameters are invalid
 * @throws JobInstanceAlreadyCompleteException
 *             if the job has already completed
 * @throws JobRestartException
 *             if the job cannot be restarted
 * @throws JobExecutionAlreadyRunningException
 *             if the job is already running
 */
@Test
public final void testNotModifiedResponse() throws IOException,
NoSuchJobException, JobExecutionAlreadyRunningException,
JobRestartException, JobInstanceAlreadyCompleteException,
JobParametersInvalidException {
	Map<String, JobParameter> parameters = new HashMap<String, JobParameter>();
	parameters.put("query.string", new JobParameter("select i from Image i"));

	JobParameters jobParameters = new JobParameters(parameters);

	Job job = jobLocator.getJob("ImageProcessing");
	assertNotNull("ImageProcessing must not be null", job);
	JobExecution jobExecution = jobLauncher.run(job, jobParameters);
	assertEquals("The job should complete successfully",jobExecution.getExitStatus().getExitCode(),"COMPLETED");

	for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
		logger.info(stepExecution.getStepName() + " "
				+ stepExecution.getReadCount() + " "
				+ stepExecution.getFilterCount() + " "
				+ stepExecution.getWriteCount());
	}
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:38,代碼來源:ImageProcessingJobIntegrationTest.java

示例3: JobExecutionEvent

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
/**
 * Constructor for the StepExecution to initialize the DTO.
 *
 * @param original the StepExecution to build this DTO around.
 */
public JobExecutionEvent(JobExecution original) {
	this.jobParameters = new JobParametersEvent(original.getJobParameters().getParameters());
	this.jobInstance = new JobInstanceEvent(original.getJobInstance().getId(), original.getJobInstance().getJobName());
	for(StepExecution stepExecution : original.getStepExecutions()){
		stepExecutions.add(new StepExecutionEvent(stepExecution));
	}
	this.status = original.getStatus();
	this.startTime = original.getStartTime();
	this.createTime = original.getCreateTime();
	this.endTime = original.getEndTime();
	this.lastUpdated = original.getLastUpdated();
	this.exitStatus = new ExitStatus(original.getExitStatus());
	this.executionContext = original.getExecutionContext();
	this.failureExceptions = original.getFailureExceptions();
	this.jobConfigurationName = original.getJobConfigurationName();
	this.setId(original.getId());
	this.setVersion(original.getVersion());
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-task,代碼行數:24,代碼來源:JobExecutionEvent.java

示例4: JobExecutionInfo

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
public JobExecutionInfo(JobExecution jobExecution, String baseUrl) {
	resourceIdentifier = jobExecution.getJobInstance().getJobParameters().getString("resource.identifier");
	DateTime sTime = new DateTime(jobExecution.getStartTime());
	DateTime eTime = new DateTime(jobExecution.getEndTime());
	duration = eTime.minus(sTime.getMillis());
	startTime = sTime;
	exitDescription = jobExecution.getExitStatus().getExitDescription();
	exitCode = jobExecution.getExitStatus().getExitCode();
	id = jobExecution.getId();
	jobInstance = baseUrl + "/jobs/"	+ jobExecution.getJobInstance().getJobName() + "/"	+ jobExecution.getJobInstance().getId();
	resource = baseUrl + "/jobs/executions/"	+ jobExecution.getId();
	this.baseUrl = baseUrl;
	status = jobExecution.getStatus();

	Integer writeSkip = 0;
	for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
		recordsRead += stepExecution.getReadCount();
		readSkip += stepExecution.getReadSkipCount();
		processSkip += stepExecution.getProcessSkipCount();
		written += stepExecution.getWriteCount();
		writeSkip += stepExecution.getWriteSkipCount();
	}
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:24,代碼來源:JobExecutionInfo.java

示例5: AdaptedJobExecution

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
public AdaptedJobExecution(JobExecution jobExecution) {
    this.id = jobExecution.getId();
    if (jobExecution.getVersion() == null) {
        jobExecution.setVersion(0);
    } else {
        this.version = jobExecution.getVersion();
    }
    this.jobInstance = jobExecution.getJobInstance();
    this.jobParameters = jobExecution.getJobParameters();
    this.createDateTime = jobExecution.getCreateTime();
    this.endDateTime = jobExecution.getEndTime();
    this.lastUpdatedDateTime = jobExecution.getLastUpdated();
    this.startDateTime = jobExecution.getStartTime();
    if (jobExecution.getStatus() == null) {
        this.status = BatchStatus.STARTING.toString();
    } else {
        this.status = jobExecution.getStatus().toString();
    }
    this.exitStatus = jobExecution.getExitStatus().toString();
    for (StepExecution step : jobExecution.getStepExecutions()) {
        stepExecutions.add(step);
    }
    this.executionContext = jobExecution.getExecutionContext();
}
 
開發者ID:marklogic-community,項目名稱:marklogic-spring-batch,代碼行數:25,代碼來源:AdaptedJobExecution.java

示例6: getStepExecutions

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
private Collection<StepExecution> getStepExecutions() {
	JobExplorer jobExplorer = this.applicationContext.getBean(JobExplorer.class);
	List<JobInstance> jobInstances = jobExplorer.findJobInstancesByJobName("job", 0, 1);
	assertEquals(1, jobInstances.size());
	JobInstance jobInstance = jobInstances.get(0);
	List<JobExecution> jobExecutions = jobExplorer.getJobExecutions(jobInstance);
	assertEquals(1, jobExecutions.size());
	JobExecution jobExecution = jobExecutions.get(0);
	return jobExecution.getStepExecutions();
}
 
開發者ID:spring-cloud-task-app-starters,項目名稱:composed-task-runner,代碼行數:11,代碼來源:ComposedRunnerVisitorTests.java

示例7: afterJob

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
@Override
public void afterJob(JobExecution jobExecution) {
	for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
		if (stepExecution.getSkipCount() > 0) {
			jobExecution.setExitStatus(ExitStatus.FAILED);
			jobExecution.setStatus(BatchStatus.FAILED);
			return;
		}
	}
}
 
開發者ID:namics,項目名稱:spring-batch-support,代碼行數:11,代碼來源:FailIfSkippedJobExecutionListener.java

示例8: testNotModifiedResponse

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
/**
 *
 * @throws IOException
 *             if a temporary file cannot be created.
 * @throws NoSuchJobException
 *             if SpeciesPageHarvestingJob cannot be located
 * @throws JobParametersInvalidException
 *             if the job parameters are invalid
 * @throws JobInstanceAlreadyCompleteException
 *             if the job has already completed
 * @throws JobRestartException
 *             if the job cannot be restarted
 * @throws JobExecutionAlreadyRunningException
 *             if the job is already running
 */
@Test
public final void testNotModifiedResponse() throws IOException,
NoSuchJobException, JobExecutionAlreadyRunningException,
JobRestartException, JobInstanceAlreadyCompleteException,
JobParametersInvalidException {
	Session session = sessionFactory.openSession();
	Transaction tx = session.beginTransaction();

	List<Taxon> taxa = session.createQuery("from Taxon as taxon").list();
	solrIndexingListener.indexObjects(taxa);
	tx.commit();

	Map<String, JobParameter> parameters =
			new HashMap<String, JobParameter>();
	parameters.put("authority.name", new JobParameter("test"));
	String repository = properties.getProperty("test.resource.baseUrl");
	parameters.put("authority.uri", new JobParameter(repository + "iucn.json"));
	parameters.put("authority.last.harvested",
			new JobParameter(Long.toString((IUCNJobIntegrationTest.PAST_DATETIME.getMillis()))));


	JobParameters jobParameters = new JobParameters(parameters);

	Job job = jobLocator.getJob("IUCNImport");
	assertNotNull("IUCNImport must not be null", job);
	JobExecution jobExecution = jobLauncher.run(job, jobParameters);
	assertEquals("The job should complete successfully",jobExecution.getExitStatus().getExitCode(),"COMPLETED");
	for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
		logger.info(stepExecution.getStepName() + " "
				+ stepExecution.getReadCount() + " "
				+ stepExecution.getFilterCount() + " "
				+ stepExecution.getWriteCount() + " " + stepExecution.getCommitCount());
	}
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:50,代碼來源:IUCNJobIntegrationTest.java

示例9: testCreateGenericArchive

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
@Test
public void testCreateGenericArchive() throws NoSuchJobException,
JobExecutionAlreadyRunningException, JobRestartException,
JobInstanceAlreadyCompleteException, JobParametersInvalidException, IOException {
	Map<String, JobParameter> parameters =
			new HashMap<String, JobParameter>();
	parameters.put("specs.file", new JobParameter(specsFile.getFile().getAbsolutePath()));
	parameters.put("items.file", new JobParameter(itemsFile.getFile().getAbsolutePath()));
	parameters.put("taxon.file", new JobParameter(taxonFile.getFile().getAbsolutePath()));
	parameters.put("fields.terminated.by", new JobParameter(","));
	parameters.put("fields.enclosed.by", new JobParameter("\""));
	parameters.put("output.fields",new JobParameter("taxonID,description,language,license"));
	parameters.put("taxon.file.skip.lines", new JobParameter("1"));
	parameters.put("taxon.file.field.names", new JobParameter("taxonID,subfamily,subtribe,tribe,accessRights,bibliographicCitation,created,license,modified,references,rights,rightsHolder,acceptedNameUsage,acceptedNameUsageID,class,datasetID,datasetName,family,genus,infraspecificEpithet,kingdom,nameAccordingTo,namePublishedIn,namePublishedInID,namePublishedInYear,nomenclaturalCode,nomenclaturalStatus,order,originalNameUsage,originalNameUsageID,parentNameUsage,parentNameUsageID,phylum,scientificName,scientificNameAuthorship,scientificNameID,specificEpithet,subgenus,taxonRank,taxonRemarks,taxonomicStatus,verbatimTaxonRank"));
	parameters.put("taxon.file.delimiter", new JobParameter("\t"));
	parameters.put("taxon.file.quote.character", new JobParameter("\""));
	parameters.put("description.file.field.names", new JobParameter("taxonID,description,license,language,type,rights"));
	parameters.put("description.default.values", new JobParameter("license=http://creativecommons.org/licenses/by-nc-sa/3.0,language=EN,type=general,rights=© Copyright The Board of Trustees\\, Royal Botanic Gardens\\, Kew."));
	parameters.put("archive.file", new JobParameter(UUID.randomUUID().toString()));

	JobParameters jobParameters = new JobParameters(parameters);

	Job deltaToDwC = jobLocator.getJob("DeltaToDwC");
	assertNotNull("DeltaToDwC must not be null",  deltaToDwC);
	JobExecution jobExecution = jobLauncher.run(deltaToDwC, jobParameters);
	assertEquals("The job should complete successfully",jobExecution.getExitStatus().getExitCode(),"COMPLETED");
	for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
		logger.info(stepExecution.getStepName() + " "
				+ stepExecution.getReadCount() + " "
				+ stepExecution.getFilterCount() + " "
				+ stepExecution.getWriteCount() + " " + stepExecution.getCommitCount());
	}

}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:35,代碼來源:DeltaNaturalLanguageDwcIntegrationTest.java

示例10: testCreateGenericArchive

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
@Test
public void testCreateGenericArchive() throws NoSuchJobException,
JobExecutionAlreadyRunningException, JobRestartException,
JobInstanceAlreadyCompleteException, JobParametersInvalidException, IOException {
	Map<String, JobParameter> parameters =
			new HashMap<String, JobParameter>();
	parameters.put("species.specs.file", new JobParameter(speciesSpecsFile.getFile().getAbsolutePath()));
	parameters.put("species.items.file", new JobParameter(speciesItemsFile.getFile().getAbsolutePath()));
	parameters.put("species.taxon.file", new JobParameter(speciesTaxonFile.getFile().getAbsolutePath()));
	parameters.put("genera.specs.file", new JobParameter(generaSpecsFile.getFile().getAbsolutePath()));
	parameters.put("genera.items.file", new JobParameter(generaItemsFile.getFile().getAbsolutePath()));
	parameters.put("genera.taxon.file", new JobParameter(generaTaxonFile.getFile().getAbsolutePath()));
	parameters.put("images.file", new JobParameter(imagesFile.getFile().getAbsolutePath()));

	JobParameters jobParameters = new JobParameters(parameters);

	Job deltaToDwC = jobLocator.getJob("Grassbase");
	assertNotNull("Grassbase must not be null",  deltaToDwC);
	JobExecution jobExecution = jobLauncher.run(deltaToDwC, jobParameters);
	assertEquals("The job should complete successfully",jobExecution.getExitStatus().getExitCode(),"COMPLETED");
	for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
		logger.info(stepExecution.getStepName() + " "
				+ stepExecution.getReadCount() + " "
				+ stepExecution.getFilterCount() + " "
				+ stepExecution.getWriteCount() + " " + stepExecution.getCommitCount());
	}

}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:29,代碼來源:GrassbaseIntegrationTest.java

示例11: testNotModifiedResponse

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
/**
 *
 * @throws IOException
 *             if a temporary file cannot be created.
 * @throws NoSuchJobException
 *             if SpeciesPageHarvestingJob cannot be located
 * @throws JobParametersInvalidException
 *             if the job parameters are invalid
 * @throws JobInstanceAlreadyCompleteException
 *             if the job has already completed
 * @throws JobRestartException
 *             if the job cannot be restarted
 * @throws JobExecutionAlreadyRunningException
 *             if the job is already running
 */
@Test
public final void testNotModifiedResponse() throws IOException,
NoSuchJobException, JobExecutionAlreadyRunningException,
JobRestartException, JobInstanceAlreadyCompleteException,
JobParametersInvalidException {
	Session session = sessionFactory.openSession();
	Transaction tx = session.beginTransaction();

	List<Taxon> taxa = session.createQuery("from Taxon as taxon").list();
	solrIndexingListener.indexObjects(taxa);
	tx.commit();

	Map<String, JobParameter> parameters =
			new HashMap<String, JobParameter>();
	parameters.put("family", new JobParameter("Araceae"));
	parameters.put("authority.name", new JobParameter("test"));
	String repository = properties.getProperty("test.resource.baseUrl",
			"http://build.e-monocot.org/git/?p=emonocot.git;a=blob_plain;f=emonocot-harvest/src/test/resources/org/emonocot/job/common/");
	parameters.put("authority.uri", new JobParameter(repository + "list.xml"));

	//parameters.put("authority.uri", new JobParameter("http://data.gbif.org/ws/rest/occurrence/list?taxonconceptkey=6979&maxresults=1000&typesonly=true&format=darwin&mode=raw&startindex="));
	parameters.put("authority.last.harvested",
			new JobParameter(Long.toString((GBIFJobIntegrationTest.PAST_DATETIME.getMillis()))));


	JobParameters jobParameters = new JobParameters(parameters);

	Job job = jobLocator.getJob("GBIFImport");
	assertNotNull("GBIFImport must not be null", job);
	JobExecution jobExecution = jobLauncher.run(job, jobParameters);
	assertEquals("The job should complete successfully",jobExecution.getExitStatus().getExitCode(),"COMPLETED");
	for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
		logger.info(stepExecution.getStepName() + " "
				+ stepExecution.getReadCount() + " "
				+ stepExecution.getFilterCount() + " "
				+ stepExecution.getWriteCount() + " " + stepExecution.getCommitCount());
	}
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:54,代碼來源:GBIFJobIntegrationTest.java

示例12: testNotModifiedResponse

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
/**
 *
 * @throws IOException
 *             if a temporary file cannot be created.
 * @throws NoSuchJobException
 *             if SpeciesPageHarvestingJob cannot be located
 * @throws JobParametersInvalidException
 *             if the job parameters are invalid
 * @throws JobInstanceAlreadyCompleteException
 *             if the job has already completed
 * @throws JobRestartException
 *             if the job cannot be restarted
 * @throws JobExecutionAlreadyRunningException
 *             if the job is already running
 */
@Test
public final void testNotModifiedResponse() throws IOException,
NoSuchJobException, JobExecutionAlreadyRunningException,
JobRestartException, JobInstanceAlreadyCompleteException,
JobParametersInvalidException {
	Map<String, JobParameter> parameters =
			new HashMap<String, JobParameter>();
	parameters.put("query.string", new JobParameter(
			"select t.id from Taxon t join t.parentNameUsage"));

	JobParameters jobParameters = new JobParameters(parameters);

	Job job = jobLocator
			.getJob("CalculateDerivedProperties");
	assertNotNull("CalculateDerivedProperties must not be null",
			job);
	JobExecution jobExecution = jobLauncher.run(job, jobParameters);
	assertEquals("The job should complete successfully",jobExecution.getExitStatus().getExitCode(),"COMPLETED");

	for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
		logger.info(stepExecution.getStepName() + " "
				+ stepExecution.getReadCount() + " "
				+ stepExecution.getFilterCount() + " "
				+ stepExecution.getWriteCount());
	}
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:42,代碼來源:CalculateDerivedPropertiesJobIntegrationTest.java

示例13: testImportTaxa

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
/**
 *
 * @throws IOException
 *             if a temporary file cannot be created.
 * @throws NoSuchJobException
 *             if SpeciesPageHarvestingJob cannot be located
 * @throws JobParametersInvalidException
 *             if the job parameters are invalid
 * @throws JobInstanceAlreadyCompleteException
 *             if the job has already completed
 * @throws JobRestartException
 *             if the job cannot be restarted
 * @throws JobExecutionAlreadyRunningException
 *             if the job is already running
 */
@Test
public final void testImportTaxa() throws IOException,
NoSuchJobException, JobExecutionAlreadyRunningException,
JobRestartException, JobInstanceAlreadyCompleteException,
JobParametersInvalidException {
	Map<String, JobParameter> parameters =
			new HashMap<String, JobParameter>();
	parameters.put("authority.name", new JobParameter(
			"test"));
	parameters.put("family", new JobParameter(
			"Araceae"));
	parameters.put("taxon.processing.mode", new JobParameter("IMPORT_TAXA_BY_AUTHORITY"));
	String repository = properties.getProperty("test.resource.baseUrl");
	parameters.put("authority.uri", new JobParameter(repository + "dwc.zip"));
	parameters.put("authority.last.harvested",
			new JobParameter(Long.toString((TaxonImportingIntegrationTest.PAST_DATETIME.getMillis()))));
	JobParameters jobParameters = new JobParameters(parameters);

	Job darwinCoreArchiveHarvestingJob = jobLocator.getJob("DarwinCoreArchiveHarvesting");
	assertNotNull("DarwinCoreArchiveHarvesting must not be null", darwinCoreArchiveHarvestingJob);
	JobExecution jobExecution = jobLauncher.run(darwinCoreArchiveHarvestingJob, jobParameters);
	assertEquals("The job should complete successfully","COMPLETED",jobExecution.getExitStatus().getExitCode());
	for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
		logger.info(stepExecution.getStepName() + " "
				+ stepExecution.getReadCount() + " "
				+ stepExecution.getFilterCount() + " "
				+ stepExecution.getWriteCount());
	}

	//Test namePublishedIn is saved
	//        assertNotNull("The namePublishedIn should have been saved.",
	//                referenceService.find("urn:example.com:test:ref:numerouno"));
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:49,代碼來源:TaxonImportingIntegrationTest.java

示例14: testImportTaxa

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
/**
 *
 * @throws IOException
 *             if a temporary file cannot be created.
 * @throws NoSuchJobException
 *             if SpeciesPageHarvestingJob cannot be located
 * @throws JobParametersInvalidException
 *             if the job parameters are invalid
 * @throws JobInstanceAlreadyCompleteException
 *             if the job has already completed
 * @throws JobRestartException
 *             if the job cannot be restarted
 * @throws JobExecutionAlreadyRunningException
 *             if the job is already running
 */
@Test
public final void testImportTaxa() throws IOException,
NoSuchJobException, JobExecutionAlreadyRunningException,
JobRestartException, JobInstanceAlreadyCompleteException,
JobParametersInvalidException {
	Map<String, JobParameter> parameters =
			new HashMap<String, JobParameter>();
	parameters.put("authority.name", new JobParameter(
			"test"));
	parameters.put("family", new JobParameter(
			"Araceae"));
	parameters.put("key.processing.mode", new JobParameter("IMPORT_KEYS"));
	parameters.put("taxon.processing.mode", new JobParameter("IMPORT_TAXA_BY_AUTHORITY"));
	parameters.put("authority.uri", new JobParameter("http://build.e-monocot.org/oldtest/test.zip"));
	parameters.put("authority.last.harvested",
			new JobParameter(Long.toString((IdentificationKeyImportingIntegrationTest.PAST_DATETIME.getMillis()))));
	JobParameters jobParameters = new JobParameters(parameters);

	Job darwinCoreArchiveHarvestingJob = jobLocator
			.getJob("DarwinCoreArchiveHarvesting");
	assertNotNull("DarwinCoreArchiveHarvesting must not be null",
			darwinCoreArchiveHarvestingJob);
	JobExecution jobExecution = jobLauncher.run(darwinCoreArchiveHarvestingJob, jobParameters);
	assertEquals("The job should complete successfully",jobExecution.getExitStatus().getExitCode(),"COMPLETED");
	for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
		logger.info(stepExecution.getStepName() + " "
				+ stepExecution.getReadCount() + " "
				+ stepExecution.getFilterCount() + " "
				+ stepExecution.getWriteCount());
	}
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:47,代碼來源:IdentificationKeyImportingIntegrationTest.java

示例15: testNotModifiedResponse

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
/**
 *
 * @throws IOException
 *             if a temporary file cannot be created.
 * @throws NoSuchJobException
 *             if SpeciesPageHarvestingJob cannot be located
 * @throws JobParametersInvalidException
 *             if the job parameters are invalid
 * @throws JobInstanceAlreadyCompleteException
 *             if the job has already completed
 * @throws JobRestartException
 *             if the job cannot be restarted
 * @throws JobExecutionAlreadyRunningException
 *             if the job is already running
 */
@Test
public final void testNotModifiedResponse() throws IOException,
NoSuchJobException, JobExecutionAlreadyRunningException,
JobRestartException, JobInstanceAlreadyCompleteException,
JobParametersInvalidException {
	Map<String, JobParameter> parameters =
			new HashMap<String, JobParameter>();
	parameters.put("query.string", new JobParameter("select t.id from Taxon t"));
	parameters.put("query.type", new JobParameter("org.emonocot.model.Taxon"));
	parameters.put("solr.selected.facets", new JobParameter("base.class_s=org.emonocot.model.Taxon"));

	JobParameters jobParameters = new JobParameters(parameters);

	Job job = jobLocator
			.getJob("ReIndex");
	assertNotNull("ReIndex must not be null",
			job);
	JobExecution jobExecution = jobLauncher.run(job, jobParameters);
	assertEquals("The job should complete successfully",jobExecution.getExitStatus().getExitCode(),"COMPLETED");

	for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
		logger.info(stepExecution.getStepName() + " "
				+ stepExecution.getReadCount() + " "
				+ stepExecution.getFilterCount() + " "
				+ stepExecution.getWriteCount());
	}
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:43,代碼來源:ReIndexingJobIntegrationTest.java


注:本文中的org.springframework.batch.core.JobExecution.getStepExecutions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。