BATCH-674: Added section on Testing Individual Steps

This commit is contained in:
dhgarrette
2009-01-27 22:29:40 +00:00
parent 3bc8a53c22
commit 88cd809b94

View File

@@ -81,12 +81,30 @@
simpleJdbcTemplate.update("insert into CUSTOMER values (?, 0, ?, 100000)", i, "customer" + i);
}
JobExecution jobExecution = this.launchJob();
JobExecution jobExecution = <emphasis role="bold">this.launchJob()</emphasis>;
Assert.assertEquals("COMPLETED", jobExecution.getExitStatus());
}
}
</programlisting>
</section>
<section>
<title>Testing Individual Steps</title>
<para>For complex batch jobs, test cases in the end-to-end tesing approach
may become unmanageable. It these cases, it may be more useful to have
test cases to test individual steps on their own. The
<classname>AbstractJobTests</classname> class contains a method
<methodname>launchStep</methodname> that takes a step name and runs just
that particular <classname>Step</classname>. This approach allows for more
targeted tests by allowing the test to set up data for just that step and
to validate its results directly.</para>
<programlisting>
JobExecution jobExecution = this.launchStep("loadFileStep");
</programlisting>
</section>