Reputation: 44970
Is there a reason why org.springframework.xd.dirt.test.SingleNodeIntegrationTestSupport
is not providing methods for job testing?
Job module integration tests in Spring XD project are carried with a different tools e.g. org.springframework.xd.integration.test.AbstractJobTest
which copies all the files into a running Spring XD container (copyJobToCluster
method).
Are there technical reasons why it's not possible to start up embedded Spring XD for job testing e.g. class loader setup?
Upvotes: 0
Views: 82
Reputation: 1723
I can't think of any technical reason why you couldn't run an embedded container to test a job. For stream testing, XD provides test fixtures that make it easy to send a message to a stream and receive and verify the result. Processing a single message in a stream is expected to happen "fast", and verifying the resulting payload from a source, processor (or processing chain) is fairly straightforward. Testing a sink requires more work to verify the state of whatever external resource is bound to it. These characteristics make stream testing practical for a unit integration test. On the other hand, a batch job can run for an arbitrarily long time which is not necessarily a good fit for Junit IMHO. Technically, there may be some boilerplate code to trigger a job, and detect when a job is complete and such things could be supported by the testing framework. I'm not sure what can be done beyond that.
Upvotes: 1