/** * Launch the entire job, including all steps. * * @return JobExecution, so that the test can validate the exit status * @throws Exception thrown if error occurs launching the job. */ public JobExecution launchJob() throws Exception { return this.launchJob(this.getUniqueJobParameters()); }
/** * Output should be the same as input */ @Test public void testJob() throws Exception { jobLauncherTestUtils.launchJob(); AssertFile.assertFileEquals(new FileSystemResource(INPUT_FILE), new FileSystemResource(OUTPUT_FILE)); } }
@Test public void testJobLaunch() throws Exception { jobLauncherTestUtils.launchJob(); assertFileEquals(new ClassPathResource(EXPECTED), new FileSystemResource(ACTUAL)); }
@Test public void testLaunchJob() throws Exception { assertFalse(new File("build/groovyJob/output/files.zip").exists()); jobLauncherTestUtils.launchJob(); assertTrue(new File("build/groovyJob/output/files.zip").exists()); }
@Test public void testJobLaunch() throws Exception { jobLauncherTestUtils.launchJob(); assertEquals(EXPECTED_RESULT, StringUtils.replace(IOUtils.toString(output.getInputStream(), "UTF-8"), System .getProperty("line.separator"), "")); } }
@Test public void testLaunchJob() throws Exception { jobLauncherTestUtils.launchJob(); int count = jobExplorer.getJobInstances("amqp-example-job", 0, 1).size(); assertTrue(count > 0); }
@Test public void testJobLaunch() throws Exception { jobLauncherTestUtils.launchJob(); // items processed = items read + 2 exceptions assertEquals(10, itemWriter.getItems().size()); }
@Test public void testJob() throws Exception { // when JobExecution jobExecution = this.jobLauncherTestUtils.launchJob(); // then Assert.assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus()); }
@Test public void testLaunchJob() throws Exception { jobLauncherTestUtils.launchJob(); //items processed = items read + 2 exceptions assertEquals(itemGenerator.getLimit()+2, itemProcessor.getCounter()); }
@Test public void runTest() throws Exception { JobParameters jobParameters = jobLauncherTestUtils.getUniqueJobParameters(); JobExecution je1 = jobLauncherTestUtils.launchJob(jobParameters); assertEquals(BatchStatus.FAILED, je1.getStatus()); AssertFile.assertLineCount(10, outputResource); JobExecution je2 = jobLauncherTestUtils.launchJob(jobParameters); assertEquals(BatchStatus.COMPLETED, je2.getStatus()); AssertFile.assertLineCount(20, outputResource); }
@Test public void testLaunchJob() throws Exception { jobLauncherTestUtils.launchJob(); //items processed = items read + 2 exceptions assertEquals(itemGenerator.getLimit()+2, itemProcessor.getCounter()); }
@Test public void testLaunchJob() throws Exception { int before = JdbcTestUtils.countRowsInTable(jdbcTemplate, "BATCH_STAGING"); JobExecution execution = jobLauncherTestUtils.launchJob(); int after = JdbcTestUtils.countRowsInTable(jdbcTemplate, "BATCH_STAGING"); assertEquals(BatchStatus.COMPLETED, execution.getStatus()); assertEquals(after - before, execution.getStepExecutions().iterator().next().getReadCount()); }
@Test public void testRemotePartitioningJob() throws Exception { // when JobExecution jobExecution = this.jobLauncherTestUtils.launchJob(); // then Assert.assertEquals(ExitStatus.COMPLETED.getExitCode(), jobExecution.getExitStatus().getExitCode()); Assert.assertEquals(4, jobExecution.getStepExecutions().size()); // master + 3 workers }
@Test public void testJob() throws Exception { assertEquals(BatchStatus.COMPLETED, jobLauncherTestUtils.launchJob().getStatus()); this.verifyTasklet(1); this.verifyTasklet(2); }
@Test public void testLaunchJob() throws Exception { jdbcTemplate.update("DELETE FROM PLAYERS"); jdbcTemplate.update("DELETE FROM GAMES"); jdbcTemplate.update("DELETE FROM PLAYER_SUMMARY"); jobLauncherTestUtils.launchJob(); int count = jdbcTemplate.queryForObject("SELECT COUNT(*) from PLAYER_SUMMARY", Integer.class); assertTrue(count > 0); } }
@Test public void testLaunchJob() throws Exception { jobLauncherTestUtils.launchJob(); assertTrue(personService.getReturnedCount() > 0); assertEquals(personService.getReturnedCount(), personService.getReceivedCount()); }
@Test public void testJobLaunch() throws Exception { jdbcTemplate.update("DELETE from TRADE"); int before = jdbcTemplate.queryForObject("SELECT COUNT(*) from TRADE", Integer.class); jobLauncherTestUtils.launchJob(); checkOutputFile("build/test-outputs/CustomerReport1.txt"); checkOutputFile("build/test-outputs/CustomerReport2.txt"); checkOutputTable(before); }
@Test public void testJobLaunch() throws Exception { jdbcTemplate.update("DELETE FROM TRADE"); jobLauncherTestUtils.launchJob(new DefaultJobParametersConverter() .getJobParameters(PropertiesConverter .stringToProperties("run.id(long)=1,parameter=true,run.date=20070122,input.file=classpath:data/fixedLengthImportJob/input/20070122.teststream.ImportTradeDataStep.txt"))); int after = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM TRADE", Integer.class); assertEquals(5, after); } }
@Test public void testRemoteChunkingJob() throws Exception { // when JobExecution jobExecution = this.jobLauncherTestUtils.launchJob(); // then Assert.assertEquals(ExitStatus.COMPLETED.getExitCode(), jobExecution.getExitStatus().getExitCode()); Assert.assertEquals( "Waited for 2 results.", // the master sent 2 chunks ({1, 2, 3} and {4, 5, 6}) to workers jobExecution.getExitStatus().getExitDescription()); }
@Test public void testLaunchJob() throws Exception { JobExecution jobExecution = jobLauncherTestUtils.launchJob(new JobParametersBuilder().addString("value", "foo") .toJobParameters()); assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus()); assertEquals("yes", jobExecution.getExecutionContext().getString("done")); }